Skip to content

check_netint.pl fails for too many interfaces via snmp #40

@liedekef

Description

@liedekef

I needed to add this for the performance output to work, even after setting the octetlength to 65535:

--- check_netint.pl.20131104    2013-11-04 17:24:06.000000000 +0100
+++ check_netint.pl 2013-11-04 17:24:14.000000000 +0100
@@ -1792,15 +1792,21 @@
   # Get the perf value if -f (performance) option defined or -k (check bandwidth)
   if (defined($o_perf) || defined($o_checkperf) || $expected_speed!=0) {
     if (!defined($o_minsnmp)) {
-   verb("Retrieving OIDs: ".join(' ',@oid_perf));
-   $resultf = $session->get_request(
-           Varbindlist => \@oid_perf
-   );
-        if (!defined($resultf)) {
-       printf("ERROR: Statistics table : %s.\n", $session->error);
-       $session->close;
-            exit $ERRORS{"UNKNOWN"};
-   }
+       while (@oid_perf) {
+           my @sublist = splice @oid_perf, 0, 10;
+           verb("Retrieving OIDs: ".join(' ',@sublist));
+           my $oid_resultf = $session->get_request(
+                   Varbindlist => \@sublist
+                   );
+           if (!defined($oid_resultf)) {
+               printf("ERROR: Statistics table : %s.\n", $session->error);
+               $session->close;
+               exit $ERRORS{"UNKNOWN"};
+           }
+           while (my ($key,$value) = each %{$oid_resultf}) {
+               $resultf->{$key}=$value;
+           }
+       }
     }
     else {
         $resultf = $result;

also, in a number of cases the snmp call get_table failed on me, so I needed to add

-maxrepetitions => 1,

to every get_table call.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions