first suggest a snapshot, then loadmibs
This commit is contained in:
@@ -36,13 +36,6 @@ ajax '/ajax/data/device/:ip/snmptree/:base' => require_login sub {
|
|||||||
|
|
||||||
content_type 'application/json';
|
content_type 'application/json';
|
||||||
|
|
||||||
return to_json [{
|
|
||||||
text => 'No MIB data. Please run `~/bin/netdisco-do loadmibs`.',
|
|
||||||
children => \0,
|
|
||||||
state => { disabled => \1 },
|
|
||||||
icon => 'icon-search',
|
|
||||||
}] unless schema('netdisco')->resultset('SNMPObject')->count();
|
|
||||||
|
|
||||||
return to_json [{
|
return to_json [{
|
||||||
text => 'No data for this device. You can request a snapshot in the Details tab.',
|
text => 'No data for this device. You can request a snapshot in the Details tab.',
|
||||||
children => \0,
|
children => \0,
|
||||||
@@ -50,6 +43,13 @@ ajax '/ajax/data/device/:ip/snmptree/:base' => require_login sub {
|
|||||||
icon => 'icon-search',
|
icon => 'icon-search',
|
||||||
}] unless schema('netdisco')->resultset('DeviceSnapshot')->find($device->ip);
|
}] unless schema('netdisco')->resultset('DeviceSnapshot')->find($device->ip);
|
||||||
|
|
||||||
|
return to_json [{
|
||||||
|
text => 'No MIB data. Please run `~/bin/netdisco-do loadmibs`.',
|
||||||
|
children => \0,
|
||||||
|
state => { disabled => \1 },
|
||||||
|
icon => 'icon-search',
|
||||||
|
}] unless schema('netdisco')->resultset('SNMPObject')->count();
|
||||||
|
|
||||||
my $items = _get_snmp_data($device->ip, $base);
|
my $items = _get_snmp_data($device->ip, $base);
|
||||||
to_json $items;
|
to_json $items;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user