Page 1 of 1

Time to run a command in Nagios Core

Posted: Mon Apr 27, 2020 9:01 pm
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.

Re: Time to run a command in Nagios Core

Posted: Wed Apr 29, 2020 2:40 pm
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