[monitoring-plugins] check_snmp: Add thresholds to performance data

Holger Weiss git at monitoring-plugins.org
Fri Nov 28 13:00:09 CET 2014


    Module: monitoring-plugins
    Branch: master
    Commit: 6623a1c7872c2a535f5226c68a0bfcffad256b62
    Author: Andreas Seemueller <andreas.seemueller at gmail.com>
 Committer: Holger Weiss <holger at zedat.fu-berlin.de>
      Date: Tue Feb 11 18:04:56 2014 +0100
       URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=6623a1c

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 2c62a23..ba5b1d3 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);



More information about the Commits mailing list