Using NRPE to Count Users Signed in Help

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.
hglod
Posts: 9
Joined: Fri Oct 11, 2019 7:14 am

Re: Using NRPE to Count Users Signed in Help

Post 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 96 times
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Using NRPE to Count Users Signed in Help

Post 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$"

Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
hglod
Posts: 9
Joined: Fri Oct 11, 2019 7:14 am

Re: Using NRPE to Count Users Signed in Help

Post 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:
********************
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Using NRPE to Count Users Signed in Help

Post by scottwilkerson »

Can you run this from the windows command line?

Code: Select all

scripts\perl\check_users.exe 2 3 "cadprod.com\administrator"
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
hglod
Posts: 9
Joined: Fri Oct 11, 2019 7:14 am

Re: Using NRPE to Count Users Signed in Help

Post 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:
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Using NRPE to Count Users Signed in Help

Post 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.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
hglod
Posts: 9
Joined: Fri Oct 11, 2019 7:14 am

Re: Using NRPE to Count Users Signed in Help

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Using NRPE to Count Users Signed in Help

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked