Use of a local tool with Nagios

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nagios_aws
Posts: 76
Joined: Wed May 18, 2016 3:34 am

Use of a local tool with Nagios

Post 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
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Use of a local tool with Nagios

Post 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.
Last edited by eloyd on Fri Jun 10, 2016 12:07 pm, edited 1 time in total.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Use of a local tool with Nagios

Post by rkennedy »

Thanks @eloyd!

As long as your script can pull the information it needs, then this will work without an issue.
Former Nagios Employee
nagios_aws
Posts: 76
Joined: Wed May 18, 2016 3:34 am

Re: Use of a local tool with Nagios

Post by nagios_aws »

Well, thank you @eloyd !

So, As long as I use "localhost" to be the "remote" host, everything should be fine ?
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Use of a local tool with Nagios

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Use of a local tool with Nagios

Post 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.
Former Nagios employee
https://www.mcapra.com/
nagios_aws
Posts: 76
Joined: Wed May 18, 2016 3:34 am

Re: Use of a local tool with Nagios

Post by nagios_aws »

Okay, thank you for your answers, i'll close this thread :)
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Use of a local tool with Nagios

Post by mcapra »

Closing this up!
Former Nagios employee
https://www.mcapra.com/
Locked