Hi I have been trying to use the check counter function via nrpe+nsclient but I keep getting a "No counters specified: add counter=<name of counter>" unknown status in Nagios. Anyone can comment on what I am doing wrong. Here're the different ways that I have tried defining the services with no luck:
check_command check_nrpe!CheckCounter!'Counter:Idle Timer=\Processor Information(_Total)\% Idle Time' Showall MaxWarn=80 MaxCritcrit=90
check_command check_nrpe!CheckCounter!'Counter:% Processor Used Core 0=\Processor(0)\% Processor Time' ShowAll MaxWarn=80 MaxCrit=90
check_command check_nrpe!CheckCounter!'Counter=\\Print Queue(Microsoft XPS Document Writer)\\Jobs' MaxWarn=5 MaxCrit=15 ShowAll
CheckSystem is enabled on the nsclient++ agent. Thank you
nrpe nsclient++ check counter - No counters specified
Re: nrpe nsclient++ check counter - No counters specified
Can you show us the actual command run from the command line along with the output of it?
Example:
Also, show us the "check_nrpe" command definition.
Example:
Code: Select all
[root@localhost libexec]# ./check_nrpe -H x.x.x.x -c CheckCounter -a 'Counter:Idle Timer=\Processor Information(_Total)\% Idle Time' Showall MaxWarn=80 MaxCritcrit=90
WARNING: Idle Timer = 94|'Idle Timernone'=94;80;0Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: nrpe nsclient++ check counter - No counters specified
Also - to add to what Ludmil mentioned, I did some testing on my end. I was seeing mixed results with single quotes, but it worked with double quotes. Could you try using double quotes?
Code: Select all
[root@localhost libexec]# ./check_nrpe -H 192.168.5.47 -c CheckCounter -a "Counter=\\Server\\Errors Logon"
OK: \Server\Errors Logon = 0|'\Server\Errors Logonnone'=0;0;0
[root@localhost libexec]# ./check_nrpe -H 192.168.5.47 -c CheckCounter -a 'Counter=\\Server\\Errors Logon'
Failed to poll counter: PdhCollectQueryData failed: : 800007d5: No data to return.
Former Nagios Employee
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: nrpe nsclient++ check counter - No counters specified
This article explains how the counters need to be referenced (double slashes):
https://support.nagios.com/kb/article.php?id=126
This one explains how to add a service:
https://support.nagios.com/kb/article.php?id=127
https://support.nagios.com/kb/article.php?id=126
This one explains how to add a service:
https://support.nagios.com/kb/article.php?id=127
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: nrpe nsclient++ check counter - No counters specified
Thanks all!
Turns out I did not initiate the nsclient config file properly. By running nscp settings --generate --add-defaults --load-all in the nsclient install folder, I am able to set allow arguments and allow nasty characters to 1. Did the trick.
With regards to slashes and quotes, single slashes work with single quotes, and double slashes work with double quotes.
Turns out I did not initiate the nsclient config file properly. By running nscp settings --generate --add-defaults --load-all in the nsclient install folder, I am able to set allow arguments and allow nasty characters to 1. Did the trick.
Code: Select all
root@nagioscore:/usr/lib/nagios/plugins# ./check_nrpe -H winserver -c CheckCounter -a 'Counter:Idle Timer=\Processor Information(_Total)\% Idle Time' Showall MaxWarn=80 MaxCritcrit=90
WARNING: Idle Timer = 95|'Idle Timernone'=95;80;0
Code: Select all
root@nagioscore:/usr/lib/nagios/plugins# ./check_nrpe -H winserver -c CheckCounter -a "Counter=\\Server\\Errors Logon"
OK: \Server\Errors Logon = 0|'\Server\Errors Logonnone'=0;0;0
Re: nrpe nsclient++ check counter - No counters specified
Ah, nice find -- I had ruled out the single quotes.
Are we good to mark this as resolved?
Are we good to mark this as resolved?
Former Nagios Employee
Re: nrpe nsclient++ check counter - No counters specified
Just add on, my command was defined wrongly - this was the main cause of the error as checkcounter requires the -a attribute to be defined.lmiltchev wrote:Can you show us the actual command run from the command line along with the output of it?
Example:Also, show us the "check_nrpe" command definition.Code: Select all
[root@localhost libexec]# ./check_nrpe -H x.x.x.x -c CheckCounter -a 'Counter:Idle Timer=\Processor Information(_Total)\% Idle Time' Showall MaxWarn=80 MaxCritcrit=90 WARNING: Idle Timer = 94|'Idle Timernone'=94;80;0
Wrong
Code: Select all
define command{
command_name check_nrpe
command_line /usr/lib/nagios/plugins/check_nrpe -H '$HOSTADDRESS$' -c '$ARG1$'
}
Code: Select all
define command {
command_name check_nrpe
command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$