diff options
author | Andreas Seemueller <andreas.seemueller@gmail.com> | 2014-02-11 18:04:56 +0100 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2014-11-28 12:56:07 +0100 |
commit | 6623a1c7872c2a535f5226c68a0bfcffad256b62 (patch) | |
tree | ed084286d823faa35352406981b8dcad555cc070 /plugins/check_snmp.c | |
parent | 668efcda1e1e33de5b442c704c8f2d0a64c59f56 (diff) | |
download | monitoring-plugins-6623a1c7872c2a535f5226c68a0bfcffad256b62.tar.gz |
check_snmp: Add thresholds to performance data
Diffstat (limited to 'plugins/check_snmp.c')
-rw-r--r-- | plugins/check_snmp.c | 12 |
1 files changed, 12 insertions, 0 deletions
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); |