[Nagiosplug-checkins] CVS: nagiosplug/plugins check_users.c,1.9,1.10
Ton Voon
tonvoon at users.sourceforge.net
Tue Nov 11 02:35:35 CET 2003
Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv25928
Modified Files:
check_users.c
Log Message:
Added perfdata
Index: check_users.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_users.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** check_users.c 22 Aug 2003 06:22:38 -0000 1.9
--- check_users.c 11 Nov 2003 10:34:42 -0000 1.10
***************
*** 41,44 ****
--- 41,45 ----
int result = STATE_OK;
char input_buffer[MAX_INPUT_BUFFER];
+ char *perf;
setlocale (LC_ALL, "");
***************
*** 46,49 ****
--- 47,52 ----
textdomain (PACKAGE);
+ perf = strdup("");
+
if (process_arguments (argc, argv) == ERROR)
usage (_("Could not parse arguments\n"));
***************
*** 95,101 ****
if (result == STATE_UNKNOWN)
printf (_("Unable to read output\n"));
! else
! printf (_("USERS %s - %d users currently logged in\n"), state_text (result),
! users);
return result;
--- 98,110 ----
if (result == STATE_UNKNOWN)
printf (_("Unable to read output\n"));
! 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;
More information about the Commits
mailing list