summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_snmp.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index 88422b15..58d46b11 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -1,31 +1,31 @@
1/***************************************************************************** 1/*****************************************************************************
2* 2*
3* Monitoring check_snmp plugin 3* Monitoring check_snmp plugin
4* 4*
5* License: GPL 5* License: GPL
6* Copyright (c) 1999-2007 Monitoring Plugins Development Team 6* Copyright (c) 1999-2007 Monitoring Plugins Development Team
7* 7*
8* Description: 8* Description:
9* 9*
10* This file contains the check_snmp plugin 10* This file contains the check_snmp plugin
11* 11*
12* Check status of remote machines and obtain system information via SNMP 12* Check status of remote machines and obtain system information via SNMP
13* 13*
14* 14*
15* This program is free software: you can redistribute it and/or modify 15* This program is free software: you can redistribute it and/or modify
16* it under the terms of the GNU General Public License as published by 16* it under the terms of the GNU General Public License as published by
17* the Free Software Foundation, either version 3 of the License, or 17* the Free Software Foundation, either version 3 of the License, or
18* (at your option) any later version. 18* (at your option) any later version.
19* 19*
20* This program is distributed in the hope that it will be useful, 20* This program is distributed in the hope that it will be useful,
21* but WITHOUT ANY WARRANTY; without even the implied warranty of 21* but WITHOUT ANY WARRANTY; without even the implied warranty of
22* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23* GNU General Public License for more details. 23* GNU General Public License for more details.
24* 24*
25* You should have received a copy of the GNU General Public License 25* You should have received a copy of the GNU General Public License
26* along with this program. If not, see <http://www.gnu.org/licenses/>. 26* along with this program. If not, see <http://www.gnu.org/licenses/>.
27* 27*
28* 28*
29*****************************************************************************/ 29*****************************************************************************/
30 30
31const char *progname = "check_snmp"; 31const char *progname = "check_snmp";
@@ -315,7 +315,7 @@ main (int argc, char **argv)
315 for (i = 0; i < numcontext; i++) { 315 for (i = 0; i < numcontext; i++) {
316 command_line[10 + i] = contextargs[i]; 316 command_line[10 + i] = contextargs[i];
317 } 317 }
318 318
319 for (i = 0; i < numauthpriv; i++) { 319 for (i = 0; i < numauthpriv; i++) {
320 command_line[10 + numcontext + i] = authpriv[i]; 320 command_line[10 + numcontext + i] = authpriv[i];
321 } 321 }
@@ -329,7 +329,7 @@ main (int argc, char **argv)
329 329
330 for (i = 0; i < numoids; i++) { 330 for (i = 0; i < numoids; i++) {
331 command_line[10 + numcontext + numauthpriv + 1 + i] = oids[i]; 331 command_line[10 + numcontext + numauthpriv + 1 + i] = oids[i];
332 xasprintf(&cl_hidden_auth, "%s %s", cl_hidden_auth, oids[i]); 332 xasprintf(&cl_hidden_auth, "%s %s", cl_hidden_auth, oids[i]);
333 } 333 }
334 334
335 command_line[10 + numcontext + numauthpriv + 1 + numoids] = NULL; 335 command_line[10 + numcontext + numauthpriv + 1 + numoids] = NULL;
@@ -398,14 +398,14 @@ main (int argc, char **argv)
398 /* We strip out the datatype indicator for PHBs */ 398 /* We strip out the datatype indicator for PHBs */
399 if (strstr (response, "Gauge: ")) { 399 if (strstr (response, "Gauge: ")) {
400 show = strstr (response, "Gauge: ") + 7; 400 show = strstr (response, "Gauge: ") + 7;
401 } 401 }
402 else if (strstr (response, "Gauge32: ")) { 402 else if (strstr (response, "Gauge32: ")) {
403 show = strstr (response, "Gauge32: ") + 9; 403 show = strstr (response, "Gauge32: ") + 9;
404 } 404 }
405 else if (strstr (response, "Counter32: ")) { 405 else if (strstr (response, "Counter32: ")) {
406 show = strstr (response, "Counter32: ") + 11; 406 show = strstr (response, "Counter32: ") + 11;
407 is_counter=1; 407 is_counter=1;
408 if(!calculate_rate) 408 if(!calculate_rate)
409 strcpy(type, "c"); 409 strcpy(type, "c");
410 } 410 }
411 else if (strstr (response, "Counter64: ")) { 411 else if (strstr (response, "Counter64: ")) {
@@ -607,7 +607,7 @@ main (int argc, char **argv)
607 state_string=malloc(string_length); 607 state_string=malloc(string_length);
608 if(state_string==NULL) 608 if(state_string==NULL)
609 die(STATE_UNKNOWN, _("Cannot malloc")); 609 die(STATE_UNKNOWN, _("Cannot malloc"));
610 610
611 current_length=0; 611 current_length=0;
612 for(i=0; i<total_oids; i++) { 612 for(i=0; i<total_oids; i++) {
613 xasprintf(&temp_string,"%.0f",response_value[i]); 613 xasprintf(&temp_string,"%.0f",response_value[i]);
@@ -629,7 +629,7 @@ main (int argc, char **argv)
629 state_string[--current_length]='\0'; 629 state_string[--current_length]='\0';
630 if (verbose > 2) 630 if (verbose > 2)
631 printf("State string=%s\n",state_string); 631 printf("State string=%s\n",state_string);
632 632
633 /* This is not strictly the same as time now, but any subtle variations will cancel out */ 633 /* This is not strictly the same as time now, but any subtle variations will cancel out */
634 np_state_write_string(current_time, state_string ); 634 np_state_write_string(current_time, state_string );
635 if(previous_state==NULL) { 635 if(previous_state==NULL) {
@@ -1006,7 +1006,7 @@ validate_arguments ()
1006 contextargs[0] = strdup ("-n"); 1006 contextargs[0] = strdup ("-n");
1007 contextargs[1] = strdup (context); 1007 contextargs[1] = strdup (context);
1008 } 1008 }
1009 1009
1010 if (seclevel == NULL) 1010 if (seclevel == NULL)
1011 xasprintf(&seclevel, "noAuthNoPriv"); 1011 xasprintf(&seclevel, "noAuthNoPriv");
1012 1012
@@ -1166,7 +1166,7 @@ print_help (void)
1166 printf ("(%s \"%s\")\n", _("default is") ,DEFAULT_COMMUNITY); 1166 printf ("(%s \"%s\")\n", _("default is") ,DEFAULT_COMMUNITY);
1167 printf (" %s\n", "-U, --secname=USERNAME"); 1167 printf (" %s\n", "-U, --secname=USERNAME");
1168 printf (" %s\n", _("SNMPv3 username")); 1168 printf (" %s\n", _("SNMPv3 username"));
1169 printf (" %s\n", "-A, --authpasswd=PASSWORD"); 1169 printf (" %s\n", "-A, --authpassword=PASSWORD");
1170 printf (" %s\n", _("SNMPv3 authentication password")); 1170 printf (" %s\n", _("SNMPv3 authentication password"));
1171 printf (" %s\n", "-X, --privpasswd=PASSWORD"); 1171 printf (" %s\n", "-X, --privpasswd=PASSWORD");
1172 printf (" %s\n", _("SNMPv3 privacy password")); 1172 printf (" %s\n", _("SNMPv3 privacy password"));