Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
liedekef opened this issue Nov 5, 2013 · 2 comments
Open

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

liedekef opened this issue Nov 5, 2013 · 2 comments

Comments

@liedekef
Copy link

liedekef commented Nov 5, 2013

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.

@willixix
Copy link
Owner

willixix commented Nov 7, 2013

You're doing something opposite to what check_netint is deigned to do with it optimizations which are aimed at minimizing number of queries and obtaining all results together ....

So --maxrepetitions=1 effectively turns off bulk snmp, which results in many more queries for table queries. And splitting @oid_perf into blocks of 10 results in many more queries for single OIDs. That you have to do it all points to bug in your vendor's SNMP implementation. You really should contact their tech support.

Now I will take your feedback here and in the future may add option to limit number of SNMP OIDs retrieved together for those with buggy vendor software. However this should not be a common case use.

@liedekef
Copy link
Author

liedekef commented Nov 7, 2013

I understand that this is indeed contrary to the optimizations, but I had the issue with lots of linux servers, just centos servers with standard snmp. Take there into account 8 interfaces, some bondings, venet interfaces and such et voila: no output any more ... I really did test the limits of it all and some just have too many interfaces for snmp to handle in one go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants