Send Netdot-devel mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://osl.uoregon.edu/mailman/listinfo/netdot-devel
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Netdot-devel digest..."
Today's Topics:
1. [SCM] Netdot branch netdot-1.0 updated.
netdot-1.0.4-95-g3c1285c ([email protected])
2. [SCM] Netdot branch master updated. netdot-1.0.4-95-g3c1285c
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Fri, 27 Sep 2013 13:16:46 -0700
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch netdot-1.0 updated.
netdot-1.0.4-95-g3c1285c
To: [email protected]
Message-ID: <[email protected]>
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Netdot".
The branch, netdot-1.0 has been updated
via 3c1285c9e64df79a2e6749e5d46fde094916e0c6 (commit)
from 70b74be2eec976daf7428001218f425db83e9b38 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3c1285c9e64df79a2e6749e5d46fde094916e0c6
Author: Carlos Vicente <[email protected]>
Date: Fri Sep 27 16:16:31 2013 -0400
Fix to previous fix
diff --git a/lib/Netdot/Model/Device.pm b/lib/Netdot/Model/Device.pm
index 4e698c8..4eacb0c 100644
--- a/lib/Netdot/Model/Device.pm
+++ b/lib/Netdot/Model/Device.pm
@@ -712,6 +712,7 @@ sub get_snmp_info {
$logger->debug("Device::get_snmp_info: SNMP target is $dev{snmp_target}");
+ $dev{snmp_version} = $sinfo->snmp_ver;
$dev{community} = $sinfo->snmp_comm if ( defined $sinfo->snmp_ver &&
$sinfo->snmp_ver != 3 );
my $name_src = ( $self->config->get('IFNAME_SHORT') eq '1' )?
@@ -2930,7 +2931,7 @@ sub info_update {
##############################################################
# Fill in some basic device info
- foreach my $field ( qw( community snmp_version layers ipforwarding sysname
+ foreach my $field ( qw( community layers ipforwarding sysname
sysdescription syslocation os collect_arp
collect_fwt ) ){
$devtmp{$field} = $info->{$field} if exists $info->{$field};
}
@@ -2969,19 +2970,24 @@ sub info_update {
}
$devtmp{asset_id} = $asset->id if $asset;
- ##############################################################
- if ( $asset && $asset->product_id && $argv{device_is_new} ){
- my $val = $self->_assign_device_monitored($asset->product_id);
- $devtmp{monitored} = $val;
- $devtmp{snmp_polling} = $val;
- $devtmp{snmp_target}->update({monitored => $val});
- }
##############################################################
- if ( $argv{device_is_new} &&
- (my $g = $self->_assign_monitor_config_group($info)) ){
- $devtmp{monitor_config} = 1;
- $devtmp{monitor_config_group} = $g;
+ # Things to do only when creating the device
+ if ( $argv{device_is_new} ){
+
+ $devtmp{snmp_version} = $info->{snmp_version} if exists
$info->{snmp_version};
+
+ if ( $asset && $asset->product_id ){
+ my $val = $self->_assign_device_monitored($asset->product_id);
+ $devtmp{monitored} = $val;
+ $devtmp{snmp_polling} = $val;
+ $devtmp{snmp_target}->update({monitored => $val});
+ }
+
+ if ( my $g = $self->_assign_monitor_config_group($info) ){
+ $devtmp{monitor_config} = 1;
+ $devtmp{monitor_config_group} = $g;
+ }
}
##############################################################
@@ -4054,34 +4060,21 @@ sub _get_snmp_session {
# Reset dead counter and snmp_down flag
$uargs{snmp_conn_attempts} = 0; $uargs{snmp_down} = 0;
- # We might have tried a different SNMP version and community above.
Rectify DB if necessary
- $uargs{snmp_version} = $sinfoargs{Version} if ( !$self->snmp_version
||
- $self->snmp_version
ne $sinfoargs{Version} );
- $uargs{snmp_bulk} = $sinfoargs{BulkWalk} if ( !$self->snmp_bulk
||
- $self->snmp_bulk ne
$sinfoargs{BulkWalk} );
+ # Fill out some SNMP parameters if they are not set
+ $uargs{snmp_version} = $sinfoargs{Version} unless
defined($self->snmp_version);
+ $uargs{snmp_bulk} = $sinfoargs{BulkWalk} unless
defined($self->snmp_bulk);
+
if ( $sinfoargs{Version} == 3 ){
# Store v3 parameters
- $uargs{snmp_securityname} = $sinfoargs{SecName} if (
- !$self->snmp_securityname || $self->snmp_securityname ne
$sinfoargs{SecName});
-
- $uargs{snmp_securitylevel} = $sinfoargs{SecLevel} if (
- !$self->snmp_securitylevel || $self->snmp_securitylevel ne
$sinfoargs{SecLevel});
-
- $uargs{snmp_authprotocol} = $sinfoargs{AuthProto} if (
- !$self->snmp_authprotocol || $self->snmp_authprotocol ne
$sinfoargs{AuthProto});
-
- $uargs{snmp_authkey} = $sinfoargs{AuthPass} if (
- !$self->snmp_authkey || $self->snmp_authkey ne
$sinfoargs{AuthPass});
-
- $uargs{snmp_privprotocol} = $sinfoargs{PrivProto} if (
- !$self->snmp_privprotocol || $self->snmp_privprotocol ne
$sinfoargs{PrivProto});
-
- $uargs{snmp_privkey} = $sinfoargs{PrivPass} if (
- !$self->snmp_privkey || $self->snmp_privkey ne
$sinfoargs{PrivPass});
+ $uargs{snmp_securityname} = $sinfoargs{SecName} unless
defined($self->snmp_securityname);
+ $uargs{snmp_securitylevel} = $sinfoargs{SecLevel} unless
defined($self->snmp_securitylevel);
+ $uargs{snmp_authprotocol} = $sinfoargs{AuthProto} unless
defined($self->snmp_authprotocol);
+ $uargs{snmp_authkey} = $sinfoargs{AuthPass} unless
defined($self->snmp_authkey);
+ $uargs{snmp_privprotocol} = $sinfoargs{PrivProto} unless
defined($self->snmp_privprotocol);
+ $uargs{snmp_privkey} = $sinfoargs{PrivPass} unless
defined($self->snmp_privkey);
}else{
- $uargs{community} = $sinfoargs{Community} if (!$self->community ||
- $self->community ne
$sinfoargs{Community});
+ $uargs{community} = $sinfoargs{Community} unless
defined($self->community);
}
$self->update(\%uargs) if ( keys %uargs );
}
-----------------------------------------------------------------------
Summary of changes:
lib/Netdot/Model/Device.pm | 65 +++++++++++++++++++------------------------
1 files changed, 29 insertions(+), 36 deletions(-)
hooks/post-receive
--
Netdot
------------------------------
Message: 2
Date: Fri, 27 Sep 2013 13:17:37 -0700
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch master updated.
netdot-1.0.4-95-g3c1285c
To: [email protected]
Message-ID: <[email protected]>
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Netdot".
The branch, master has been updated
via 3c1285c9e64df79a2e6749e5d46fde094916e0c6 (commit)
via 70b74be2eec976daf7428001218f425db83e9b38 (commit)
from 96926a12c04d75dc1305603443e50afaabafa41c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
lib/Netdot/Model/Device.pm | 64 +++++++++++++++++++------------------------
1 files changed, 28 insertions(+), 36 deletions(-)
hooks/post-receive
--
Netdot
------------------------------
_______________________________________________
Netdot-devel mailing list
[email protected]
https://osl.uoregon.edu/mailman/listinfo/netdot-devel
End of Netdot-devel Digest, Vol 78, Issue 5
*******************************************