mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-03-27 04:43:35 -04:00
Added perfdata
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@762 f882894a-f735-0410-b71e-b25c423dba1c
This commit is contained in:
parent
3cf9823dfe
commit
06bb5d06d5
1 changed files with 12 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue