Page 3 of 4

Re: Check_Users no output returned from plugin

Posted: Wed Sep 07, 2016 10:31 am
by rkennedy
What happens if you pass it without the double quotes?

Re: Check_Users no output returned from plugin

Posted: Wed Sep 07, 2016 3:46 pm
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

Re: Check_Users no output returned from plugin

Posted: Wed Sep 07, 2016 3:53 pm
by kwhogster
I removed the double quotes on both made no difference


Any ideas?

Re: Check_Users no output returned from plugin

Posted: Thu Sep 08, 2016 10:07 am
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?

Re: Check_Users no output returned from plugin

Posted: Thu Sep 08, 2016 12:07 pm
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.

Re: Check_Users no output returned from plugin

Posted: Thu Sep 08, 2016 3:34 pm
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.

Re: Check_Users no output returned from plugin

Posted: Thu Sep 08, 2016 7:53 pm
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.

Re: Check_Users no output returned from plugin

Posted: Fri Sep 09, 2016 10:00 am
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.

Re: Check_Users no output returned from plugin

Posted: Fri Sep 09, 2016 12:24 pm
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

Re: Check_Users no output returned from plugin

Posted: Fri Sep 09, 2016 12:56 pm
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.