Check_Local_Users query

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Check_Local_Users query

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Check_Local_Users query

Post 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]

Former Nagios employee
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: Check_Local_Users query

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Check_Local_Users query

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked