summaryrefslogtreecommitdiffstats
path: root/plugins/check_users.c
diff options
context:
space:
mode:
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}