Nagios checks failing with error restricted path in error
Nagios checks failing with error restricted path in error
Hi,
We have mod gearman integrated with nagios and we are trying to monitoring vms that are in azure and we are seeing below error.
"ERROR: restricted path in effect, but command contains forbidden charater"
We have below entries in our worker.conf file
restrict_path=/usr/local/nagios/libexec
also plugin path is same on nagios and mod gearman worker node
Can some one suggest what can be done to fix this?
We have mod gearman integrated with nagios and we are trying to monitoring vms that are in azure and we are seeing below error.
"ERROR: restricted path in effect, but command contains forbidden charater"
We have below entries in our worker.conf file
restrict_path=/usr/local/nagios/libexec
also plugin path is same on nagios and mod gearman worker node
Can some one suggest what can be done to fix this?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios checks failing with error restricted path in erro
From the mod_gearman documentation
Based on the above, combined with the error you are getting, I would suspect your command contains one of the following which is throwing the error
https://labs.consol.de/nagios/mod-gearman/index.htmlrestrict_path
‘restrict_path` allows you to restrict this worker to only execute plugins from these particular folders. Can be used multiple times to specify more than one folder. Note that when this restriction is active, no shell will be spawned and no shell characters ($&();<>`"’|) are allowed in the command line itself.
Code: Select all
restrict_path=/usr/local/plugins/
Based on the above, combined with the error you are getting, I would suspect your command contains one of the following which is throwing the error
Code: Select all
$&();<>`"’|Re: Nagios checks failing with error restricted path in erro
I have disable restrict path in worker.conf and I still see the same error
I ran gearmand -V and I see version as 0.33
I ran gearmand -V and I see version as 0.33
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios checks failing with error restricted path in erro
Did you restart all the worker services (including the one on the local nagios server) after changing the restrict path on all of the configs?
Re: Nagios checks failing with error restricted path in erro
Yes I did, that restrict path error has gone. But I'm seeing another receive header error. Below is the complete error.
CHECK_NRPE: Receive header underflow - only -1 bytes received (4 expexted). I see below errors in gearmand.log( see logs in attached screenshot)
CHECK_NRPE: Receive header underflow - only -1 bytes received (4 expexted). I see below errors in gearmand.log( see logs in attached screenshot)
You do not have the required permissions to view the files attached to this post.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios checks failing with error restricted path in erro
The errors in the screenshot don't appear to be related to a NRPE error.
Are you sure all of your serves have all of the workers IP addresses in their nrpe.cfg as allowed hosts?
Are you sure all of your serves have all of the workers IP addresses in their nrpe.cfg as allowed hosts?
Re: Nagios checks failing with error restricted path in erro
Those errors are from gearmand.log not from nrpe
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios checks failing with error restricted path in erro
You got this in the gearmand.log?mohan23 wrote:Those errors are from gearmand.log not from nrpe
Code: Select all
CHECK_NRPE: Receive header underflow - only -1 bytes received (4 expexted)Re: Nagios checks failing with error restricted path in erro
I see these in web console
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios checks failing with error restricted path in erro
Which leads back to my question
scottwilkerson wrote:Are you sure all of your servers have all of the workers IP addresses in their nrpe.cfg as allowed hosts?