From: Stephen L Johnson Date: Wed, 29 Nov 2000 17:12:49 +0000 (+0000) Subject: added $Id$ RCS string and added @HOST_DEFAULTS to list of possible params X-Git-Tag: spong-2_7_2~48 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d7f646672ee38e77b08ddd686b61a5fb36b3b10;p=spong.git added $Id$ RCS string and added @HOST_DEFAULTS to list of possible params --- diff --git a/src/lib/Spong/Network/plugins/check_interfaces b/src/lib/Spong/Network/plugins/check_interfaces index fe18a78..ebebdca 100644 --- a/src/lib/Spong/Network/plugins/check_interfaces +++ b/src/lib/Spong/Network/plugins/check_interfaces @@ -10,6 +10,8 @@ on a host by polling via SNMP. It reports any interfaces that are administratively up but operationally not up. =cut +# +# $Id: check_interfaces,v 1.5 2000/11/29 17:12:49 sljohnson Exp $ # Register the routine with the plugin registry $PLUGINS{'interfaces'} = \&check_interfaces; @@ -27,7 +29,9 @@ sub check_interfaces { my ($host ) = @_; my ($color, $summary, $message ) = ( "green", "", "" ); my $snmp_session; - my ($snmp_community) = $HOSTS{$host}->{'snmp_community'} || 'public'; + my ($snmp_community) = $HOSTS{$host}->{'snmp_community'} || + $HOSTS_DEFAULTS{'snmp_community'} || + 'public'; $snmp_session = SNMP_Session->open ($host, $snmp_community, 161); diff --git a/src/lib/Spong/Network/plugins/check_snmp b/src/lib/Spong/Network/plugins/check_snmp index db11872..bf9c40d 100644 --- a/src/lib/Spong/Network/plugins/check_snmp +++ b/src/lib/Spong/Network/plugins/check_snmp @@ -16,6 +16,8 @@ value retrieved in the snmpget operation. If the values don't agree, a critical (red) status is reported =cut +# +# $Id: check_snmp,v 1.5 2000/11/29 17:12:49 sljohnson Exp $ # Register the routine with the plugin registry $PLUGINS{'snmp'} = \&check_snmp; @@ -32,8 +34,15 @@ sub check_snmp { my ($host ) = @_; my ($color, $summary, $message ) = ( "green", "", "" ); my $snmp_session; - my ($community) = $HOSTS{$host}->{'snmp_community'} || 'public'; - my ($expect) = $HOSTS{$host}->{'expect_oid'}; + + # Find the community name to use + my ($community) = $HOSTS{$host}->{'snmp_community'} || + $HOSTS_DEFAULTS{'snmp_community'} || + 'public'; + + # Find an expect oid to find + my ($expect) = $HOSTS{$host}->{'expect_oid'} || + $HOSTS_DEFAULTS{'expect_oid'}; $snmp_session = SNMP_Session->open ($host, $community, 161);