Page 1 of 1

Check_Local_Users query

Posted: Wed Sep 16, 2015 6:36 am
by neworderfac33
Good afternoon,

In addition to being able to see how many users are logged into a Windows server with:

Code: Select all

define service {
        use                     generic-service
        hostgroup_name          jenkins-test-masters
        service_description     Check Local Users
        check_command           check_local_users
        }
is it possible to return their usernames?

Thanks in advance

Pete

Re: Check_Local_Users query

Posted: Wed Sep 16, 2015 10:13 am
by tmcdonald
That all depends on the plugin that check_local_users is configured to run, but if you are running a setup anything like mine, then you are checking your local Nagios system as opposed to a Windows system, and there does not appear to be a way to list users:

Code: Select all

root@localhost: /usr/local/nagios/libexec
$ ./check_users --help
check_users v2.0.3 (nagios-plugins 2.0.3)
Copyright (c) 1999 Ethan Galstad
Copyright (c) 2000-2014 Nagios Plugin Development Team
        <[email protected]>

This plugin checks the number of users currently logged in on the local
system and generates an error if the number exceeds the thresholds specified.


Usage:
check_users -w <users> -c <users>

Options:
 -h, --help
    Print detailed help screen
 -V, --version
    Print version information
 --extra-opts=[section][@file]
    Read options from an ini file. See
    https://www.nagios-plugins.org/doc/extra-opts.html
    for usage and examples.
 -w, --warning=INTEGER
    Set WARNING status if more than INTEGER users are logged in
 -c, --critical=INTEGER
    Set CRITICAL status if more than INTEGER users are logged in

Send email to [email protected] if you have questions regarding use
of this software. To submit patches or suggest improvements, send email to
[email protected]


Re: Check_Local_Users query

Posted: Wed Sep 16, 2015 10:52 am
by neworderfac33
Thanks for replying.

Here's the Check_Local_Users from commands.cfg

Code: Select all

define command{
        command_name    check_local_users
        command_line    $USER1$/check_users -w $ARG1$ -c $ARG2$
        }
So, it doesn't matter which host definition I call it from, it's still only going to give me the information for the Nagios host? Poo.

Cheers

Pete

Re: Check_Local_Users query

Posted: Wed Sep 16, 2015 3:26 pm
by tgriep
Take a look at this link and see if this would work for you.
http://john.wesorick.com/2011/03/nagios ... ndows.html