From 06bb5d06d5d46e95a031cf50b737b3fd3c8abef7 Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Tue, 11 Nov 2003 10:34:42 +0000 Subject: Added perfdata git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@762 f882894a-f735-0410-b71e-b25c423dba1c diff --git a/plugins/check_users.c b/plugins/check_users.c index 3705ee1..e0a7184 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; } -- cgit v0.10-9-g596f