[monitoring-plugins] improved includes and some comments
Lorenz Kästle
git at monitoring-plugins.org
Sun Jul 6 23:40:12 CEST 2025
Module: monitoring-plugins
Branch: master
Commit: fedff97c96ec7f7866fa15bd38b9a349cf260cad
Author: Lorenz Kästle <12514511+RincewindsHat at users.noreply.github.com>
Date: Thu Mar 13 23:51:51 2025 +0100
URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=fedff97c
improved includes and some comments
---
plugins/check_load.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/plugins/check_load.c b/plugins/check_load.c
index 57be8c69..5d3e6237 100644
--- a/plugins/check_load.c
+++ b/plugins/check_load.c
@@ -28,28 +28,24 @@
*
*****************************************************************************/
-#include "output.h"
-#include "perfdata.h"
-#include "thresholds.h"
const char *progname = "check_load";
const char *copyright = "1999-2022";
const char *email = "devel at monitoring-plugins.org";
#include "./common.h"
+#include <string.h>
#include "./runcmd.h"
#include "./utils.h"
#include "./popen.h"
-#include "states.h"
+#include "../lib/states.h"
+#include "../lib/output.h"
+#include "../lib/perfdata.h"
+#include "../lib/thresholds.h"
#include "check_load.d/config.h"
+// getloadavg comes from gnulib
#include "../gl/stdlib.h"
-#include <string.h>
-
-#ifdef HAVE_SYS_LOADAVG_H
-# include <sys/loadavg.h>
-#endif
-
/* needed for compilation under NetBSD, as suggested by Andy Doran */
#ifndef LOADAVG_1MIN
# define LOADAVG_1MIN 0
@@ -136,6 +132,7 @@ int main(int argc, char **argv) {
double load_values[3] = {0, 0, 0};
+ // this should be getloadavg from gnulib, should work everywhere™
int error = getloadavg(load_values, 3);
if (error != 3) {
die(STATE_UNKNOWN, _("Failed to retrieve load values"));
More information about the Commits
mailing list