Merge branch 'master' into og-api-tokens-simple
This commit is contained in:
@@ -63,7 +63,23 @@ sub fixup_device_auth {
|
||||
die "error: config: stanza in device_auth must have a tag\n"
|
||||
if not $stanza->{tag} and exists $stanza->{user};
|
||||
|
||||
push @new_stanzas, $stanza
|
||||
push @new_stanzas, $stanza;
|
||||
}
|
||||
|
||||
# import legacy sshcollector configuration
|
||||
my $sshcollector = (setting('sshcollector') || []);
|
||||
foreach my $stanza (@$sshcollector) {
|
||||
# defaults
|
||||
$stanza->{driver} = 'cli';
|
||||
$stanza->{read} = 1;
|
||||
$stanza->{no} ||= [];
|
||||
|
||||
# fixups
|
||||
$stanza->{only} ||= [ scalar delete $stanza->{ip} ||
|
||||
scalar delete $stanza->{hostname} ];
|
||||
$stanza->{username} = scalar delete $stanza->{user};
|
||||
|
||||
push @new_stanzas, $stanza;
|
||||
}
|
||||
|
||||
# legacy config
|
||||
|
||||
@@ -219,7 +219,7 @@ Returns true if the C<$port> L<DBIx::Class> object has a phone connected.
|
||||
=cut
|
||||
|
||||
sub port_has_phone {
|
||||
return (shift)->with_properties->remote_is_phone;
|
||||
return (shift)->properties->remote_is_phone;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
@@ -100,11 +100,19 @@ sub snmp_comm_reindex {
|
||||
}
|
||||
$prefix ||= 'vlan-';
|
||||
|
||||
debug
|
||||
sprintf '[%s] reindexing to "%s%s" (ver: %s, class: %s)',
|
||||
if ($vlan =~ /^[0-9]+$/i && $vlan) {
|
||||
debug sprintf '[%s] reindexing to "%s%s" (ver: %s, class: %s)',
|
||||
$device->ip, $prefix, $vlan, $ver, $snmp->class;
|
||||
$vlan ? $snmp->update(Context => ($prefix . $vlan))
|
||||
: $snmp->update(Context => '');
|
||||
$snmp->update(Context => ($prefix . $vlan));
|
||||
} elsif ($vlan =~ /^[a-z0-9]+$/i && $vlan) {
|
||||
debug sprintf '[%s] reindexing to "%s" (ver: %s, class: %s)',
|
||||
$device->ip, $vlan, $ver, $snmp->class;
|
||||
$snmp->update(Context => ($vlan));
|
||||
} else {
|
||||
debug sprintf '[%s] reindexing without context (ver: %s, class: %s)',
|
||||
$device->ip, $ver, $snmp->class;
|
||||
$snmp->update(Context => '');
|
||||
}
|
||||
}
|
||||
else {
|
||||
my $comm = $snmp->snmp_comm;
|
||||
|
||||
Reference in New Issue
Block a user