Hello,
I am trying to create a service check using the check_nrpe command where $ARG3$ will be referenced within $ARG2$. The following is a specific example.
$ARG1$ CheckCounter
$ARG2$ -a "Counter:$ARG3$-Avg-Disk-Writes-Sec=\\Cluster CSVFS($ARG3$)\\Writes/sec" ShowAll MaxWarn=99999999 MaxCrit=99999999
$ARG3$ CSV10
If I test this out by using the run check command everything looks good, however when I look at status information under service status I see the following error. Failed to poll counter: -Avg-Disk-Writes-Sec PdhAddCounter failed: c0000bc0: Unable to parse the counter path. Check the format and syntax of the specified path.
Place an ARG inside another ARG in Service Check
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Place an ARG inside another ARG in Service Check
Hello @jvaira,
I would recommend defining this as a custom macro and then using this macro in your check commands. Nagios XI - Macros and Custom Object Variables
I would recommend defining this as a custom macro and then using this macro in your check commands. Nagios XI - Macros and Custom Object Variables
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Place an ARG inside another ARG in Service Check
Hello Ben,
I tried that and am now getting the following error instead Failed to poll counter: PdhCollectQueryData failed: : 800007d5: No data to return.
I tried that and am now getting the following error instead Failed to poll counter: PdhCollectQueryData failed: : 800007d5: No data to return.
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Place an ARG inside another ARG in Service Check
Hi,
Did you re-start Nagios Core after making changes to the resource.cfg file?
Did you re-start Nagios Core after making changes to the resource.cfg file?
Code: Select all
systemctl restart nagios
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Place an ARG inside another ARG in Service Check
Hello,
I set this up as a free variable within the service check and then applied config. Would modifying the resource.cfg file be different?
I set this up as a free variable within the service check and then applied config. Would modifying the resource.cfg file be different?
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Place an ARG inside another ARG in Service Check
Hi,
Yeah, you'll want to use the user macros and add those to the /usr/local/nagios/etc/resource.cfg file . Take a look at the following guide:
https://assets.nagios.com/downloads/nag ... Macros.pdf
Yeah, you'll want to use the user macros and add those to the /usr/local/nagios/etc/resource.cfg file . Take a look at the following guide:
https://assets.nagios.com/downloads/nag ... Macros.pdf
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Place an ARG inside another ARG in Service Check
Hello Ben,
This did the trick, thank you. Just for my own understanding can you please explain why the free variables within the service do not work in this situation. I have used those for quite a few things in the past and never had an issue.
This did the trick, thank you. Just for my own understanding can you please explain why the free variables within the service do not work in this situation. I have used those for quite a few things in the past and never had an issue.
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Place an ARG inside another ARG in Service Check
Hello @jvaira,
The custom or free variable can work as well. What version of Nagios XI are you using? Also, you'll need to add SERVICE or HOST in front of the variable.
The custom or free variable can work as well. What version of Nagios XI are you using? Also, you'll need to add SERVICE or HOST in front of the variable.
https://assets.nagios.com/downloads/nag ... tvars.htmlIn order to prevent name collision among custom variables from different object types, Nagios prepends "_HOST", "_SERVICE", or "_CONTACT" to the beginning of custom host, service, or contact variables, respectively, in macro and environment variable names. The table below shows the corresponding macro and environment variable names for the custom variables that were defined in the example above.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!