summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 11cf4b7)
raw | patch | inline | side by side (parent: 11cf4b7)
author | Ton Voon <tonvoon@users.sourceforge.net> | |
Tue, 18 Feb 2003 22:10:55 +0000 (22:10 +0000) | ||
committer | Ton Voon <tonvoon@users.sourceforge.net> | |
Tue, 18 Feb 2003 22:10:55 +0000 (22:10 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@340 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_load.c | patch | blob | history |
diff --git a/plugins/check_load.c b/plugins/check_load.c
index 896e356b6114098bcc9a217e091de310ff4952c7..7d60d2343a85d2ee1054c5f2f61ca09474b58b0b 100644 (file)
--- a/plugins/check_load.c
+++ b/plugins/check_load.c
float wload1 = -1, wload5 = -1, wload15 = -1;
float cload1 = -1, cload5 = -1, cload15 = -1;
+char *status_line = "";
+
int
main (int argc, char **argv)
{
#endif
return STATE_UNKNOWN;
}
- printf ("load average: %.2f, %.2f, %.2f", la1, la5, la15);
+ asprintf(&status_line, "load average: %.2f, %.2f, %.2f", la1, la5, la15);
if ((la1 >= cload1) || (la5 >= cload5) || (la15 >= cload15)) {
- printf (" CRITICAL\n");
+ printf("CRITICAL - %s\n", status_line);
return STATE_CRITICAL;
}
if ((la1 >= wload1) || (la5 >= wload5) || (la15 >= wload15)) {
- printf (" WARNING\n");
+ printf ("WARNING - %s\n", status_line);
return STATE_WARNING;
}
- printf ("\n");
+ printf ("OK - %s\n", status_line);
return STATE_OK;
}