summaryrefslogtreecommitdiffstats
path: root/plugins/check_snmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_snmp.c')
-rw-r--r--plugins/check_snmp.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index da9638c4..abe54cfb 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -468,6 +468,9 @@ main (int argc, char **argv)
468 /* Process this block for numeric comparisons */ 468 /* Process this block for numeric comparisons */
469 /* Make some special values,like Timeticks numeric only if a threshold is defined */ 469 /* Make some special values,like Timeticks numeric only if a threshold is defined */
470 if (thlds[i]->warning || thlds[i]->critical || calculate_rate) { 470 if (thlds[i]->warning || thlds[i]->critical || calculate_rate) {
471 if (verbose > 2) {
472 print_thresholds(" thresholds", thlds[i]);
473 }
471 ptr = strpbrk (show, "-0123456789"); 474 ptr = strpbrk (show, "-0123456789");
472 if (ptr == NULL) 475 if (ptr == NULL)
473 die (STATE_UNKNOWN,_("No valid data returned (%s)\n"), show); 476 die (STATE_UNKNOWN,_("No valid data returned (%s)\n"), show);
@@ -576,20 +579,23 @@ main (int argc, char **argv)
576 len = sizeof(perfstr)-strlen(perfstr)-1; 579 len = sizeof(perfstr)-strlen(perfstr)-1;
577 strncat(perfstr, show, len>ptr-show ? ptr-show : len); 580 strncat(perfstr, show, len>ptr-show ? ptr-show : len);
578 581
582 if (type)
583 strncat(perfstr, type, sizeof(perfstr)-strlen(perfstr)-1);
584
579 if (warning_thresholds) { 585 if (warning_thresholds) {
580 strncat(perfstr, ";", sizeof(perfstr)-strlen(perfstr)-1); 586 strncat(perfstr, ";", sizeof(perfstr)-strlen(perfstr)-1);
581 strncat(perfstr, warning_thresholds, sizeof(perfstr)-strlen(perfstr)-1); 587 if(thlds[i]->warning && thlds[i]->warning->text)
588 strncat(perfstr, thlds[i]->warning->text, sizeof(perfstr)-strlen(perfstr)-1);
582 } 589 }
583 590
584 if (critical_thresholds) { 591 if (critical_thresholds) {
585 if (!warning_thresholds) 592 if (!warning_thresholds)
586 strncat(perfstr, ";", sizeof(perfstr)-strlen(perfstr)-1); 593 strncat(perfstr, ";", sizeof(perfstr)-strlen(perfstr)-1);
587 strncat(perfstr, ";", sizeof(perfstr)-strlen(perfstr)-1); 594 strncat(perfstr, ";", sizeof(perfstr)-strlen(perfstr)-1);
588 strncat(perfstr, critical_thresholds, sizeof(perfstr)-strlen(perfstr)-1); 595 if(thlds[i]->critical && thlds[i]->critical->text)
596 strncat(perfstr, thlds[i]->critical->text, sizeof(perfstr)-strlen(perfstr)-1);
589 } 597 }
590 598
591 if (type)
592 strncat(perfstr, type, sizeof(perfstr)-strlen(perfstr)-1);
593 strncat(perfstr, " ", sizeof(perfstr)-strlen(perfstr)-1); 599 strncat(perfstr, " ", sizeof(perfstr)-strlen(perfstr)-1);
594 } 600 }
595 } 601 }
@@ -1160,7 +1166,7 @@ print_help (void)
1160 printf ("(%s \"%s\")\n", _("default is") ,DEFAULT_COMMUNITY); 1166 printf ("(%s \"%s\")\n", _("default is") ,DEFAULT_COMMUNITY);
1161 printf (" %s\n", "-U, --secname=USERNAME"); 1167 printf (" %s\n", "-U, --secname=USERNAME");
1162 printf (" %s\n", _("SNMPv3 username")); 1168 printf (" %s\n", _("SNMPv3 username"));
1163 printf (" %s\n", "-A, --authpassword=PASSWORD"); 1169 printf (" %s\n", "-A, --authpasswd=PASSWORD");
1164 printf (" %s\n", _("SNMPv3 authentication password")); 1170 printf (" %s\n", _("SNMPv3 authentication password"));
1165 printf (" %s\n", "-X, --privpasswd=PASSWORD"); 1171 printf (" %s\n", "-X, --privpasswd=PASSWORD");
1166 printf (" %s\n", _("SNMPv3 privacy password")); 1172 printf (" %s\n", _("SNMPv3 privacy password"));
@@ -1207,8 +1213,9 @@ print_help (void)
1207 printf (" %s\n", _("Separates output on multiple OID requests")); 1213 printf (" %s\n", _("Separates output on multiple OID requests"));
1208 1214
1209 printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); 1215 printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT);
1216 printf (" %s\n", _("NOTE the final timeout value is calculated using this formula: timeout_interval * retries + 5"));
1210 printf (" %s\n", "-e, --retries=INTEGER"); 1217 printf (" %s\n", "-e, --retries=INTEGER");
1211 printf (" %s\n", _("Number of retries to be used in the requests")); 1218 printf (" %s%i\n", _("Number of retries to be used in the requests, default: "), DEFAULT_RETRIES);
1212 1219
1213 printf (" %s\n", "-O, --perf-oids"); 1220 printf (" %s\n", "-O, --perf-oids");
1214 printf (" %s\n", _("Label performance data with OIDs instead of --label's")); 1221 printf (" %s\n", _("Label performance data with OIDs instead of --label's"));