Time to run a command in Nagios Core

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.
Locked
phamcong96hy
Posts: 1
Joined: Mon Apr 27, 2020 8:49 pm

Time to run a command in Nagios Core

Post by phamcong96hy »

I am installing Nagios Core 4.3.2 on Centos 8. When I write a plugin /usr/local/nagios/libexec/check_defacement.sh set in tor and curl. in the check_defacement.sh file, there is a segment:

Code: Select all

service tor start
curl -s --socks5-hotsname 127.0.0.1:9050 - $url > /tmp/check_defacement_ $url
service tor stop
When I run the command directly, it returns the file /tmp/check_defacement_ $ url. But when I ran through nagios with command.cfg and object.cfg, it returned file empty /tmp/check_defacement_ $url.
User avatar
jdunitz
Posts: 235
Joined: Wed Feb 05, 2020 2:50 pm

Re: Time to run a command in Nagios Core

Post by jdunitz »

Hi Pham,

How is $url getting passed to the script? Most likely, there's something in how you're doing that that's getting lost when Nagios runs it.

Can you post your commands.cfg and object.cfg, or at least the important pieces of those files?
Be sure to remove or obscure any sensitive information.

We'll have a look at your configs and see what might be wrong; it might be that how you're calling the script from within commands.cfg isn't quite right.

--Jeffrey
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!
Locked