Using NRPE to Count Users Signed in Help
Using NRPE to Count Users Signed in Help
Hi everyone I am relatively new to Nagios however over the past month I have gotten it up and running to ping our devices on the network. Next step is to count the number of users we have signed into our server farm and it's giving me some trouble. For reference I have used this https://support.nagios.com/forum/viewto ... =7&t=40102 post and this script https://exchange.nagios.org/directory/P ... 29/details to get started with NRPE. I am testing using an old Windows desktop with NSClient++ installed and Nagios Core running on a Raspberry Pi.
So when I run "./check_nrpe -H 192.168.0.99 -c check_users 2 3 cadprod.com\administrator" from my Pi I pull this error:
***********************
operable program or batch file.
Argument "$ARG1$" isn't numeric in numeric ge (>=) at (eval 24) line 41.
Argument "$ARG2$" isn't numeric in numeric lt (<) at (eval 24) line 41.
Critical: 0 users logged in
Active Sessions:
***********************
Any ideas? I have attached my nsclient.ini for reference. Let me know if you would like to see any other config files.
So when I run "./check_nrpe -H 192.168.0.99 -c check_users 2 3 cadprod.com\administrator" from my Pi I pull this error:
***********************
operable program or batch file.
Argument "$ARG1$" isn't numeric in numeric ge (>=) at (eval 24) line 41.
Argument "$ARG2$" isn't numeric in numeric lt (<) at (eval 24) line 41.
Critical: 0 users logged in
Active Sessions:
***********************
Any ideas? I have attached my nsclient.ini for reference. Let me know if you would like to see any other config files.
-
- 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
Try
Code: Select all
./check_nrpe -H 192.168.0.99 -c check_users -a 2 3 'cadprod.com\administrator'
Re: Using NRPE to Count Users Signed in Help
I pull the error "Exception processing request: Request command contained illegal metachars!" which I have noticed previously when I use the -a option.
If I don't include -a I pull the same error from the OP.
If I don't include -a I pull the same error from the OP.
-
- 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
Ya this is because of the \hglod wrote:Exception processing request: Request command contained illegal metachars!
You will need to add the following to the [/settings/NRPE/server] section of the nsclient.ini
Code: Select all
allow nasty characters = 1
Re: Using NRPE to Count Users Signed in Help
Actually I missed a line in the OP from the first error. The full error is:
'query' is not recognized as an internal or external command,
operable program or batch file.
Argument "$ARG1$" isn't numeric in numeric ge (>=) at (eval 24) line 41.
Argument "$ARG2$" isn't numeric in numeric lt (<) at (eval 24) line 41.
Critical: 0 users logged in
Active Sessions:
'query' is not recognized as an internal or external command,
operable program or batch file.
Argument "$ARG1$" isn't numeric in numeric ge (>=) at (eval 24) line 41.
Argument "$ARG2$" isn't numeric in numeric lt (<) at (eval 24) line 41.
Critical: 0 users logged in
Active Sessions:
-
- 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
Then try the command again with the -ascottwilkerson wrote:Ya this is because of the \hglod wrote:Exception processing request: Request command contained illegal metachars!
You will need to add the following to the [/settings/NRPE/server] section of the nsclient.ini
Then restart nsclient++Code: Select all
allow nasty characters = 1
Re: Using NRPE to Count Users Signed in Help
After allowing nasty characters I get "Arguments not allowed see nsclient.log for details" and the error in the log is:
2019-10-11 09:17:23: error:c:\source\master\modules\CheckExternalScripts\CheckExternalScripts.cpp:360: Arguments not allowed in CheckExternalScripts set /settings/external scripts/allow arguments=true
But I already have it set to true in my .ini.
2019-10-11 09:17:23: error:c:\source\master\modules\CheckExternalScripts\CheckExternalScripts.cpp:360: Arguments not allowed in CheckExternalScripts set /settings/external scripts/allow arguments=true
But I already have it set to true in my .ini.
-
- 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
You may need to add this to the [/settings/external scripts] section too
Code: Select all
allow nasty characters = 1
Re: Using NRPE to Count Users Signed in Help
Getting the exact same error and the same log entry after allowing nasty chars in external scripts.
-
- 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
Can you re-share your nsclient.inihglod wrote:Getting the exact same error and the same log entry after allowing nasty chars in external scripts.
thanks