summaryrefslogtreecommitdiffstats
path: root/plugins/check_users.c
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2003-11-11 10:34:42 +0000
committerTon 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)
40 int users = -1; 40 int users = -1;
41 int result = STATE_OK; 41 int result = STATE_OK;
42 char input_buffer[MAX_INPUT_BUFFER]; 42 char input_buffer[MAX_INPUT_BUFFER];
43 char *perf;
43 44
44 setlocale (LC_ALL, ""); 45 setlocale (LC_ALL, "");
45 bindtextdomain (PACKAGE, LOCALEDIR); 46 bindtextdomain (PACKAGE, LOCALEDIR);
46 textdomain (PACKAGE); 47 textdomain (PACKAGE);
47 48
49 perf = strdup("");
50
48 if (process_arguments (argc, argv) == ERROR) 51 if (process_arguments (argc, argv) == ERROR)
49 usage (_("Could not parse arguments\n")); 52 usage (_("Could not parse arguments\n"));
50 53
@@ -94,9 +97,15 @@ main (int argc, char **argv)
94 97
95 if (result == STATE_UNKNOWN) 98 if (result == STATE_UNKNOWN)
96 printf (_("Unable to read output\n")); 99 printf (_("Unable to read output\n"));
97 else 100 else {
98 printf (_("USERS %s - %d users currently logged in\n"), state_text (result), 101 asprintf(&perf, "%s", perfdata ("users", users, "",
99 users); 102 TRUE, wusers,
103 TRUE, cusers,
104 TRUE, 0,
105 FALSE, 0));
106 printf (_("USERS %s - %d users currently logged in |%s\n"), state_text (result),
107 users, perf);
108 }
100 109
101 return result; 110 return result;
102} 111}