From 6623a1c7872c2a535f5226c68a0bfcffad256b62 Mon Sep 17 00:00:00 2001 From: Andreas Seemueller Date: Tue, 11 Feb 2014 18:04:56 +0100 Subject: check_snmp: Add thresholds to performance data --- plugins/check_snmp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index 2c62a230..ba5b1d37 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c @@ -567,6 +567,18 @@ main (int argc, char **argv) len = sizeof(perfstr)-strlen(perfstr)-1; strncat(perfstr, show, len>ptr-show ? ptr-show : len); + if (warning_thresholds) { + strncat(perfstr, ";", sizeof(perfstr)-strlen(perfstr)-1); + strncat(perfstr, warning_thresholds, sizeof(perfstr)-strlen(perfstr)-1); + } + + if (critical_thresholds) { + if (!warning_thresholds) + strncat(perfstr, ";", sizeof(perfstr)-strlen(perfstr)-1); + strncat(perfstr, ";", sizeof(perfstr)-strlen(perfstr)-1); + strncat(perfstr, critical_thresholds, sizeof(perfstr)-strlen(perfstr)-1); + } + if (type) strncat(perfstr, type, sizeof(perfstr)-strlen(perfstr)-1); strncat(perfstr, " ", sizeof(perfstr)-strlen(perfstr)-1); -- cgit v1.2.3-74-g34f1