check_users: list the users?

Matthias Flacke Matthias.Flacke at gmx.de
Fri Apr 18 00:00:43 CEST 2008


Jay R. Ashworth wrote:
 > I'm setting check_users (via nrpe) to warn at 1 and CRIT at 3 users --
 > I'm putting this on servers that, typically, have no humans logged in
 > at all.
 >
 > Since that's true, I'd like to have the list of users from who -q
 > returned as part of the status message.
 >
 > a) Is this a not uncommon usage, and when I patch the program, should I
 > therefore post and or submit a patch to do this?
 >
 > b) How long can that status message become without breaking 1) nagios
 > and 2) nrpe?
 >
 > Anyone have opinions, answers, or pointers?

...as a check_multi snippet (uses Nagios3 multiline feature):

$ cat users.cmd
command [ count ] = check_users -w 1 -c 3
command [ who_q ] = who -q | head -1

$ ./check_multi -n users -f users.cmd -r 1
users CRITICAL - 2 plugins checked, 1 critical (users), 1 ok
[ 1] users USERS CRITICAL - 3 users currently logged in
[ 2] who_q mflacke mflacke mflacke

Greetz,
Matthias Flacke

-- 
http://my-plugin.de/check_multi

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list