Title: [opsview] [11574] check_snmp_sysinfo returns CRITICAL if it cannot connect to SNMP
Revision
11574
Author
tvoon
Date
2013-02-21 18:04:16 +0000 (Thu, 21 Feb 2013)

Log Message

check_snmp_sysinfo returns CRITICAL if it cannot connect to SNMP

Modified Paths


Modified: trunk/CHANGES
===================================================================
--- trunk/CHANGES	2013-02-21 17:40:51 UTC (rev 11573)
+++ trunk/CHANGES	2013-02-21 18:04:16 UTC (rev 11574)
@@ -7,6 +7,7 @@
     Allow tracing of individual hosts in check_snmp_interfaces_cascade
     Allow specifying a throughput range for SNMP alerts
     Restore clicking on product name in footer to get build version information
+    check_snmp_sysinfo now returns CRITICAL if it cannot connect to SNMP
     SNMP throughput thresholds now have an expanded syntax to handle input and output throughput separately
     NOTICES:
     FIXES:

Modified: trunk/opsview-core/lib/Opsview/NagiosPlugin/SNMP.pm
===================================================================
--- trunk/opsview-core/lib/Opsview/NagiosPlugin/SNMP.pm	2013-02-21 17:40:51 UTC (rev 11573)
+++ trunk/opsview-core/lib/Opsview/NagiosPlugin/SNMP.pm	2013-02-21 18:04:16 UTC (rev 11574)
@@ -40,8 +40,9 @@
 ";
 
     my $snmp_args = {
-        "snmp-version"   => "2c",
-        "snmp-check-oid" => ".1.3.6.1.2.1.1.1.0", # sysDescr
+        "snmp-version"                => "2c",
+        "snmp-check-oid"              => ".1.3.6.1.2.1.1.1.0", # sysDescr
+        "snmp-agent-failure-critical" => 0,
         %{ delete $args{snmp} || {} },
     };
 
@@ -227,7 +228,11 @@
                 !defined $session->get_request(
                     $self->{snmp_args}->{"snmp-check-oid"} ) )
             {
-                $self->nagios_die( UNKNOWN,
+                my $status = UNKNOWN;
+                if ( $self->{snmp_args}->{"snmp-agent-failure-critical"} ) {
+                    $status = CRITICAL;
+                }
+                $self->nagios_die( $status,
                     "Agent not responding, tried SNMP v1 and v2c"
                 );
             }

Modified: trunk/opsview-core/nagios-plugins/check_snmp_sysinfo
===================================================================
--- trunk/opsview-core/nagios-plugins/check_snmp_sysinfo	2013-02-21 17:40:51 UTC (rev 11573)
+++ trunk/opsview-core/nagios-plugins/check_snmp_sysinfo	2013-02-21 18:04:16 UTC (rev 11574)
@@ -36,9 +36,10 @@
     blurb =>
       "Checks if SNMP agent is running - returns system info gathered from SNMP",
     snmp => {
-        "snmp-version" => "2c",
-        "v1-fallback"  => 1,
-        "snmp-timeout" => 2,
+        "snmp-version"                => "2c",
+        "v1-fallback"                 => 1,
+        "snmp-timeout"                => 2,
+        "snmp-agent-failure-critical" => 1,
     },
 );
 

_______________________________________________
Opsview-checkins mailing list
Opsview-checkins@lists.opsview.org
http://lists.opsview.org/lists/listinfo/opsview-checkins

Reply via email to