[monitoring-plugins] check_snmp: put the "c" (to mark a counter) after ...

Jan Wagner git at monitoring-plugins.org
Wed Apr 7 18:10:12 CEST 2021


    Module: monitoring-plugins
    Branch: wip-2.3.1
    Commit: ac8388682feb1416aa6274788eaa83c4e3f10180
    Author: Gerhard Lausser <gerhard.lausser at consol.de>
 Committer: Jan Wagner <waja at cyconet.org>
      Date: Tue Feb  7 14:15:47 2017 +0100
       URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=ac83886

check_snmp: put the "c" (to mark a counter) after the perfdata value

---

 plugins/check_snmp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index e8a21a4..afc568b 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -576,6 +576,9 @@ main (int argc, char **argv)
 			len = sizeof(perfstr)-strlen(perfstr)-1;
 			strncat(perfstr, show, len>ptr-show ? ptr-show : len);
 
+			if (type)
+				strncat(perfstr, type, sizeof(perfstr)-strlen(perfstr)-1);
+
 			if (warning_thresholds) {
 				strncat(perfstr, ";", sizeof(perfstr)-strlen(perfstr)-1);
 				strncat(perfstr, warning_thresholds, sizeof(perfstr)-strlen(perfstr)-1);
@@ -588,8 +591,6 @@ main (int argc, char **argv)
 				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