Check_Users no output returned from plugin

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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check_Users no output returned from plugin

Post by rkennedy »

What happens if you pass it without the double quotes?
Former Nagios Employee
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Check_Users no output returned from plugin

Post by kwhogster »

The double quotes off which one?

My define command

Code: Select all

define command{
        command_name    check_windows_users
        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_users -a 2 3 "$_HOSTALLOWEDUSERS$"
}
Or in the nsclient.ini

Code: Select all

; A list of scripts available to run from the CheckExternalScripts module. Syntax is: <command>=<script> <arguments>
[/settings/external scripts/scripts]

check_users = scripts\\perl\\check_users.exe $ARG1$ $ARG2$ "$ARG3$"
Thanks
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Check_Users no output returned from plugin

Post by kwhogster »

I removed the double quotes on both made no difference


Any ideas?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check_Users no output returned from plugin

Post by rkennedy »

Let's figure out if it's the variable, or plugin. Please adjust your check command to be the following -

Code: Select all

        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_users -a 2 3 administrator
Does it work at this point?
Former Nagios Employee
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Check_Users no output returned from plugin

Post by kwhogster »

Made the change

command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_users -a 2 3 administrator

Same results

Critical: administrator login is not in allowed users list.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Check_Users no output returned from plugin

Post by tgriep »

You cannot run the check directly from the command line using the login name. It looks like it will only work using the _ALLOWEDUSERS macro which has to be defined in the host configuration file on the Nagios server.
Look at the example from the plugin page and try setting it up again.
https://exchange.nagios.org/directory/P ... 29/details

If you still are having problems, please post the service and host configuration file from the Nagios server and the name of the user account you want to check.
Be sure to check out our Knowledgebase for helpful articles and solutions!
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Check_Users no output returned from plugin

Post by kwhogster »

That is what I used to setup this

The name of the user account I wish to check is administrator which is logged on to this host


the Host entry from my windows.cfg file

Code: Select all

define host{
        use             windows-server  ; Inherit default values from a template
        host_name       TGCS025         ; The name we're giving to this host
        alias           Windows 2008 Exchange 2010 ; A longer name associated with the host
        _ALLOWEDUSERS   administrator
        address         10.2.8.36       ; IP address of the host
        }
MY COMMAND from the commands.cfg

Code: Select all

define command{
        command_name    check_windows_users
        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_users -a 2 3 "$_HOSTALLOWEDUSERS$"
}
My Service from mynrpe.cfg file

Code: Select all

define service {
        host_name                       TGCS025
        service_description             Windows Users
        check_command                   check_windows_users
        servicegroups                   AllServices
        check_interval                  1
        use                             generic-service
}
If you need what is in the nsclient.ini let me know.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Check_Users no output returned from plugin

Post by tgriep »

The configs all look good and it is passing the macro "User Name" over to the windows system as it is in the critical message.
If the administrator account is a domain account, try specifying the login name as follows.

Code: Select all

domain/administrator
Use the forward slash as that will get passed correctly to the Windows server.
Try that and let us know if it works.
Be sure to check out our Knowledgebase for helpful articles and solutions!
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Check_Users no output returned from plugin

Post by kwhogster »

Question

Do you mean like this

Code: Select all

define host{
        use             windows-server  ; Inherit default values from a template
        host_name       TGCS025         ; The name we're giving to this host
        alias           Windows 2008 Exchange 2010 ; A longer name associated with the host
        _ALLOWEDUSERS   mydom/administrator
        address         10.2.8.36       ; IP address of the host
        }
Made this change same results
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Check_Users no output returned from plugin

Post by tgriep »

Do you see anything in the nagios.log file on the Windows server of in any of the Windows Error logs?
The only thing I can think of is that the NSClient++ is running as a service and doesn't have permissions to see who is logged in to the server.
You may have to set the NSClient service to login using a login account with enough permissions to view the accounts.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked