aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_users.c
diff options
context:
space:
mode:
authorGravatar Ton Voon <tonvoon@users.sourceforge.net> 2003-11-11 10:34:42 +0000
committerGravatar Ton Voon <tonvoon@users.sourceforge.net> 2003-11-11 10:34:42 +0000
commit06bb5d06d5d46e95a031cf50b737b3fd3c8abef7 (patch)
tree98903e6840779cc2780dc0b61b07e2133b9a7ab8 /plugins/check_users.c
parent3cf9823dfee9bdb7b6e37ebed8d535ed5ccb309b (diff)
downloadmonitoring-plugins-06bb5d06d5d46e95a031cf50b737b3fd3c8abef7.tar.gz
Added perfdata
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@762 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_users.c')
-rw-r--r--plugins/check_users.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/plugins/check_users.c b/plugins/check_users.c
index 3705ee10..e0a71845 100644
--- a/plugins/check_users.c
+++ b/plugins/check_users.c
@@ -40,11 +40,14 @@ main (int argc, char **argv)
int users = -1;
int result = STATE_OK;
char input_buffer[MAX_INPUT_BUFFER];
+ char *perf;
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ perf = strdup("");
+
if (process_arguments (argc, argv) == ERROR)
usage (_("Could not parse arguments\n"));
@@ -94,9 +97,15 @@ main (int argc, char **argv)
if (result == STATE_UNKNOWN)
printf (_("Unable to read output\n"));
- else
- printf (_("USERS %s - %d users currently logged in\n"), state_text (result),
- users);
+ else {
+ asprintf(&perf, "%s", perfdata ("users", users, "",
+ TRUE, wusers,
+ TRUE, cusers,
+ TRUE, 0,
+ FALSE, 0));
+ printf (_("USERS %s - %d users currently logged in |%s\n"), state_text (result),
+ users, perf);
+ }
return result;
}