Page 1 of 1
Use of a local tool with Nagios
Posted: Fri Jun 10, 2016 7:15 am
by nagios_aws
Hello everyone,
Here is my problem:
I want to use a tool in a plugin that I would develop, the thing is that this tool connect to a server and monitor processes' status.
I use it like this:
mytool port@FQDN
this provide me some informations that I will format to the Nagios format.
but the thing is : Can i run a script that is on Nagios server, not on a Nagios client ?
Thank you
Re: Use of a local tool with Nagios
Posted: Fri Jun 10, 2016 8:03 am
by eloyd
I do not know exactly what you are asking, but yes, you can run things locally on the Nagios server just as easily (maybe even easier) than running them on a remote host.
You can also use NCPA, NRDP, NRPE, SSH, and all the other "remote" agents to probe your localhost just as you would a remote host, so you can access everything in the same way.
Re: Use of a local tool with Nagios
Posted: Fri Jun 10, 2016 9:44 am
by rkennedy
Thanks @eloyd!
As long as your script can pull the information it needs, then this will work without an issue.
Re: Use of a local tool with Nagios
Posted: Mon Jun 13, 2016 2:49 am
by nagios_aws
Well, thank you @eloyd !
So, As long as I use "localhost" to be the "remote" host, everything should be fine ?
Re: Use of a local tool with Nagios
Posted: Mon Jun 13, 2016 9:52 am
by eloyd
Generally speaking, yes. The other thing is to make sure that whatever script you are testing is able to be run by the nagios user on the Nagios server. If you are expecting to have elevated root access, you need to include su or sudo commands within your script, and update /etc/sudoers accordingly.
Re: Use of a local tool with Nagios
Posted: Mon Jun 13, 2016 9:59 am
by mcapra
nagios_aws wrote:So, As long as I use "localhost" to be the "remote" host, everything should be fine ?
For most plugins, this is true. Refer to the post @eloyd made above mine for permissions concerns.
Re: Use of a local tool with Nagios
Posted: Tue Jun 14, 2016 2:40 am
by nagios_aws
Okay, thank you for your answers, i'll close this thread

Re: Use of a local tool with Nagios
Posted: Tue Jun 14, 2016 9:01 am
by mcapra
Closing this up!