#888 add 1.0.8802.1.1 and 1.3.111.2.802 to the SNMP browser
This commit is contained in:
@@ -424,13 +424,13 @@ Pass a device in C<-d> to display them:
|
||||
|
||||
=head2 snapshot
|
||||
|
||||
Performs an snmp walk from L<.1.3.6.1> on the device and builds a data
|
||||
structure which SNMP::Info can use to mimic the device. The structure is
|
||||
saved into the L<device_snapshot> database table.
|
||||
Performs snmp walks from C<.1.3.6.1>, C<1.0.8802.1.1>, and C<1.3.111.2.802> on
|
||||
the device and builds a data structure which SNMP::Info can use to mimic the
|
||||
device. The structure is saved into the C<device_snapshot> database table.
|
||||
|
||||
Optionally, pass a value to the L<-p> parameter (mnemonic: persist) and the
|
||||
Optionally, pass a value to the C<-p> parameter (mnemonic: persist) and the
|
||||
base64 encoded data will also be saved to L<NETDISCO_HOME/logs/snapshots/IP>
|
||||
(where L<IP> is the canonical IP of the device passed). Netdisco will load
|
||||
(where C<IP> is the canonical IP of the device passed). Netdisco will load
|
||||
this for any pseudo device with the same canonical IP.
|
||||
|
||||
~/bin/netdisco-do snapshot -d 192.0.2.1 -p yes
|
||||
|
||||
@@ -33,7 +33,7 @@ ajax '/ajax/data/device/:ip/snmptree/:base' => require_login sub {
|
||||
|
||||
my $recurse = ((param('recurse') and param('recurse') eq 'on') ? 0 : 1);
|
||||
my $base = param('base');
|
||||
$base =~ m/^\.1\.3\.6\.1(\.\d+)*$/ or send_error('Bad OID Base', 404);
|
||||
$base =~ m/^\.1(\.\d+)*$/ or send_error('Bad OID Base', 404);
|
||||
|
||||
my $items = _get_snmp_data($device->ip, $base, $recurse);
|
||||
|
||||
@@ -80,8 +80,8 @@ ajax '/ajax/data/device/:ip/snmpnodesearch' => require_login sub {
|
||||
return to_json [] unless $found;
|
||||
|
||||
$found = $found->oid;
|
||||
$found =~ s/^\.1\.3\.6\.1\.?//;
|
||||
my @results = ('.1.3.6.1');
|
||||
$found =~ s/^\.1\.?//;
|
||||
my @results = ('.1');
|
||||
|
||||
foreach my $part (split m/\./, $found) {
|
||||
my $last = $results[-1];
|
||||
@@ -98,7 +98,7 @@ ajax '/ajax/content/device/:ip/snmpnode/:oid' => require_login sub {
|
||||
or send_error('Bad Device', 404);
|
||||
|
||||
my $oid = param('oid');
|
||||
$oid =~ m/^\.1\.3\.6\.1(\.\d+)*$/ or send_error('Bad OID', 404);
|
||||
$oid =~ m/^\.1(\.\d+)*$/ or send_error('Bad OID', 404);
|
||||
|
||||
my $object = schema('netdisco')->resultset('DeviceBrowser')
|
||||
->with_snmp_object($device->ip)->find({ 'snmp_object.oid' => $oid })
|
||||
|
||||
@@ -63,7 +63,7 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
|
||||
value => do { my $m = $oidmap{$_}; encode_base64( nfreeze( [$snmp->$m] ) ); },
|
||||
}} sort {sortable_oid($a) cmp sortable_oid($b)}
|
||||
grep {not $seenoid{$_}++}
|
||||
grep {m/^\.1\.3\.6\.1/}
|
||||
grep {m/^\.1/}
|
||||
map {s/^_//; $_}
|
||||
keys %cache;
|
||||
|
||||
@@ -271,9 +271,10 @@ sub walker {
|
||||
($vars) = $sess->bulkwalk( 0, $repeaters, $var );
|
||||
if ( $sess->{ErrorNum} ) {
|
||||
debug "snapshot $device BULKWALK " . $sess->{ErrorStr};
|
||||
debug "snapshot $device disabling BULKWALK";
|
||||
debug "snapshot $device disabling BULKWALK and trying again...";
|
||||
$vars = [];
|
||||
$bulkwalk = 0;
|
||||
$snmp->{BulkWalk} = 0;
|
||||
delete $sess->{ErrorNum};
|
||||
delete $sess->{ErrorStr};
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
'data' : {
|
||||
'url' : function (node) {
|
||||
return ('[% uri_base | none %]/ajax/data/device/[% device %]/snmptree/'
|
||||
+ (node.id === '#' ? '.1.3.6.1' : node.id) + '?recurse=on');
|
||||
+ (node.id === '#' ? '.1' : node.id) + '?recurse=on');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user