[monitoring-plugins] Fix wrong exit codes

Lorenz Kästle git at monitoring-plugins.org
Thu Feb 20 16:40:13 CET 2025


 Module: monitoring-plugins
 Branch: master
 Commit: faacf5525bef7140f67293125537a9f31ffd25a5
 Author: Lorenz Kästle <12514511+RincewindsHat at users.noreply.github.com>
   Date: Wed Feb 19 19:44:17 2025 +0100
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=faacf552

Fix wrong exit codes

---

 plugins-scripts/check_sensors.sh | 1 -
 plugins/negate.c                 | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/plugins-scripts/check_sensors.sh b/plugins-scripts/check_sensors.sh
old mode 100755
new mode 100644
index 866e0e0f..ba3581b1
--- a/plugins-scripts/check_sensors.sh
+++ b/plugins-scripts/check_sensors.sh
@@ -20,7 +20,6 @@ print_help() {
 	echo "This plugin checks hardware status using the lm_sensors package."
 	echo ""
 	support
-	exit "$STATE_OK"
 }
 
 case "$1" in
diff --git a/plugins/negate.c b/plugins/negate.c
index 7e52fe67..750c0bfb 100644
--- a/plugins/negate.c
+++ b/plugins/negate.c
@@ -133,11 +133,11 @@ static const char **process_arguments(int argc, char **argv) {
 			break;
 		case 'h': /* help */
 			print_help();
-			exit(EXIT_SUCCESS);
+			exit(STATE_UNKNOWN);
 			break;
 		case 'V': /* version */
 			print_revision(progname, NP_VERSION);
-			exit(EXIT_SUCCESS);
+			exit(STATE_UNKNOWN);
 		case 't': /* timeout period */
 			if (!is_integer(optarg))
 				usage2(_("Timeout interval must be a positive integer"), optarg);



More information about the Commits mailing list