Page 2 of 2

Re: Using NRPE to Count Users Signed in Help

Posted: Fri Oct 11, 2019 8:40 am
by hglod
I have the updated one attached.

But another question, am I able to use this:

command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10

Found in my nrpe config? Do I have to use an external script to monitor users on a Windows machine?
nsclient.ini
(1.3 KiB) Downloaded 110 times

Re: Using NRPE to Count Users Signed in Help

Posted: Fri Oct 11, 2019 8:42 am
by scottwilkerson
I see the problem

You have this

Code: Select all

[/settings/external scripts/scripts]

allow nasty characters = 1
allow arguments=true
;check_user_count = check_user_count.bat
check_users=scripts\\perl\\check_users.exe $ARG1$ $ARG2$ "$ARG3$"
and what you need is this

Code: Select all

[/settings/external scripts]

allow nasty characters = 1
allow arguments=true

[/settings/external scripts/scripts]
;check_user_count = check_user_count.bat
check_users=scripts\\perl\\check_users.exe $ARG1$ $ARG2$ "$ARG3$"


Re: Using NRPE to Count Users Signed in Help

Posted: Fri Oct 11, 2019 8:45 am
by hglod
Awesome so that worked for the -a flag error. But we are back at the original error when I run "./check_nrpe -H 192.168.0.99 -c check_users -a 2 3 'cadprod.com\administrator' ":

*******************
'query' is not recognized as an internal or external command,
operable program or batch file.
OK: 0 users logged in
Active Sessions:
********************

Re: Using NRPE to Count Users Signed in Help

Posted: Fri Oct 11, 2019 8:48 am
by scottwilkerson
Can you run this from the windows command line?

Code: Select all

scripts\perl\check_users.exe 2 3 "cadprod.com\administrator"

Re: Using NRPE to Count Users Signed in Help

Posted: Fri Oct 11, 2019 8:49 am
by hglod
Same error:

'query' is not recognized as an internal or external command,
operable program or batch file.
OK: 0 users logged in
Active Sessions:

Re: Using NRPE to Count Users Signed in Help

Posted: Fri Oct 11, 2019 9:07 am
by scottwilkerson
Ok, you are getting the correct response at the nagios server then, now you have an issue with the plugin, you need to maybe run the help command or something on the plugin as to make sure you are passing the arguments properly.

Re: Using NRPE to Count Users Signed in Help

Posted: Fri Oct 11, 2019 9:09 am
by hglod
Thank you Scott but another question. I able to use this in my nrpe config file to monitor users on a Windows machine?

command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10

Re: Using NRPE to Count Users Signed in Help

Posted: Fri Oct 11, 2019 9:14 am
by scottwilkerson
hglod wrote:Thank you Scott but another question. I able to use this in my nrpe config file to monitor users on a Windows machine?

command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
No that's not possible