Title: [opsview] [12312] Added Kellen's changes to handle > 100% throughput issue.
Revision
12312
Author
pknight
Date
2013-05-20 12:05:20 +0100 (Mon, 20 May 2013)

Log Message

Added Kellen's changes to handle > 100% throughput issue. New flags: --ignore-no-throughput and --ignore-strange-percent-values

Modified Paths

Modified: trunk/opsview-core/nagios-plugins/check_snmp_interfaces_cascade
===================================================================
--- trunk/opsview-core/nagios-plugins/check_snmp_interfaces_cascade	2013-05-17 16:47:05 UTC (rev 12311)
+++ trunk/opsview-core/nagios-plugins/check_snmp_interfaces_cascade	2013-05-20 11:05:20 UTC (rev 12312)
@@ -129,6 +129,20 @@
     required => 1,
 );
 
+$np->add_arg(
+    spec => "ignore_no_throughput|ignore-no-throughput",
+    help => "--ignore-no-throughput\n"
+      . '   If the device has no throughput, disable unknown status and do not display "no throughput" message',
+    required => 0,
+);
+
+$np->add_arg(
+    spec => "ignore_strange_percent_values|ignore-strange-percent-values",
+    help => "--ignore-strange-percent-values\n"
+      . '   If the device exceeds its expected theoretical maximum throughput, do not go to UNKNOWN status and do not return "Strange percent values"',
+    required => 0,
+);
+
 $np->getopts;
 
 my $hostname = $np->opts->hostname;
@@ -675,13 +689,16 @@
     # Also, continue processing for errors and discards, but may disable in future
     # We make this an UNKNOWN state so that it gets recorded, but not alerted
     unless ( defined $intdata->{octetsIn} && defined $intdata->{octetsOut} ) {
+        my $output = "Interface $intdata->{display_name} is UP";
+        unless ( $np->opts->ignore_no_throughput ) {
+            $output = $output . ". No throughput data available in SNMP";
+        }
+
         push @$results,
           {
             servicename => $servicename,
-            state       => 3,
-            output      => "Interface "
-              . $intdata->{display_name}
-              . " is UP. No throughput data available in SNMP",
+            state       => ( $np->opts->ignore_no_throughput ) ? 0 : 3,
+            output      => $output
           };
         return 1;
     }
@@ -817,8 +834,10 @@
 
         # This is downgraded to be an UNKNOWN state. One scenario is that the device is reporting the wrong speed, and thus the percentage
         # is too high
-        push @$poller_unknowns,
-          "Got strange percent values for interface $intdata->{display_name} (in:${throughput_in_pct}%, out:${throughput_out_pct}%)";
+        unless ( $np->opts->ignore_strange_percent_values ) {
+            push @$poller_unknowns,
+              "Got strange percent values for interface $intdata->{display_name} (in:${throughput_in_pct}%, out:${throughput_out_pct}%)";
+        }
 
         # Disabled for the moment as we shouldn't just discard this result until more data
         #return 0;

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

Reply via email to