Page 1 of 1

Running plug-in remotely

Posted: Wed Jan 22, 2014 3:31 pm
by barry_mclellan
Hello,

I am pretty new to Nagios and was hoping someone could answer this easy question!

I have downloaded and installed check_hpasm (http://exchange.nagios.org/directory/Pl ... sm/details). I compiled this on my Nagios server (virtual), and my physical remote server. The command runs properly when run manually on the remote server)

I setup the 'command' in Nagios to look like this: $USER1$/check_hpasm

I was hoping this command would execute on my remote server (I assigned this server in the monitoring service). Unfortunately this executes the plug-in locally instead and fails as my virtual image is not running hp monitoring software (/sbin/hpasmcli) since it is virtual.

Is there some way to execute this remotely?

Thanks!
Barry

Re: Running plug-in remotely

Posted: Wed Jan 22, 2014 3:37 pm
by tmcdonald
Checks cannot by default run on a remote system for various technical and security reasons. You want to look into NRPE (Nagios Remote Plugin Executor). There's a pretty good article explaining how to set it up:

http://www.tecmint.com/how-to-add-linux ... ng-server/

You will want to add your check to the remote machine in step 4-5 and configure it in step 10.

Re: Running plug-in remotely

Posted: Wed Jan 22, 2014 3:59 pm
by barry_mclellan
Thanks for the quick reply!

That sure seems like a lot of work! I was hoping that since I had installed the Nagios agent on my remote machine, it would have provided the ability to execute plugin's through it's own interface.

Is the typical thing for remote monitoring to attempt to use SNMP whereever possible?

This was my first plug-in for evaluating Nagios, should I assume that for all of this stuff; if it cannot be executed from the Nagios server, it will require this plugin?


Have a great day!
Barry

Re: Running plug-in remotely

Posted: Wed Jan 22, 2014 4:23 pm
by tmcdonald
barry_mclellan wrote:I was hoping that since I had installed the Nagios agent on my remote machine [...]
Ahh. You never mentioned you had installed anything other than the plugin on your physical machine. What do you mean by "agent"? Do you mean Nagios Core, another XI server, or something else?

As for SNMP, it's a pretty solid method for most checks you'll want to do on a network. We see a lot of SNMP questions around here.

And last but not least, if you want to execute remote checks you will need to install some sort of agent on the remote machine. Imagine the security risk if you could just run whatever check you wanted without permission!

Re: Running plug-in remotely

Posted: Wed Jan 22, 2014 4:53 pm
by barry_mclellan
Sorry about that, I just thought those wizards were a standard thing when adding a server.

It was the Linux Server wizard which told me to install the agent 'linux-nrpe-agent'

Thanks!
Barry

Re: Running plug-in remotely

Posted: Wed Jan 22, 2014 4:56 pm
by slansing
There is a bit of confusion going on here, the XI linux agent is NRPE, which is what tmcdonald was talking about, so you have that correct. You will need to move a plugin that has no remote check functionality "the ability to pass it a host address and expect it to be run on the Nagios server." Is this what you are looking at doing? If so we are more than happy to help you out!

Re: Running plug-in remotely

Posted: Wed Jan 22, 2014 5:08 pm
by barry_mclellan
Thanks so much for the quick replies!

Yes, lots of confusion, I guess it is hard when you are new to realize what has gone from a downloaded plug-in,to a built in plug-in!

I will re-read tmcdonald's previous post. I would like to just execute the command 'check_hpasm' and have it run on the remote linux server, not on my nagios server.


Thanks!

Re: Running plug-in remotely

Posted: Wed Jan 22, 2014 5:21 pm
by slansing
Okay so in this case that plugin has the ability to pass it a host address, that means you can use it locally on your Nagios server without having to install a remote agent. Unless you do really want to place it on the remote system and run it locally. There are a few examples of how to run the plugin from your nagios server at:

http://labs.consol.de/nagios/check_hpasm/

As it should have been installed to /usr/local/nagios/libexec/ try running the following:

Code: Select all

/usr/local/nagios/libexec/check_hpasm -H <address.of.hp.server> -C <community string>

Re: Running plug-in remotely

Posted: Wed Jan 22, 2014 5:31 pm
by barry_mclellan
The only problem I have is that my host system doesn't have the executable required by check_hpasm locally to run. The local server is virtual so I do not have the HP executables on that server.

I could copy them over, but in the end, I may be running Nagio's on something other than an HP server, so wanted to have it executed at the source server itself.

Thanks!
Barry

Re: Running plug-in remotely

Posted: Wed Jan 22, 2014 5:59 pm
by lmiltchev
I haven't used this plugin, but looking at the info - there are two modes that you can use:

1. Local mode (with NRPE) - you will need to install an agent (as tmcdonald suggested)
2. Remote mode (as slansing suggested)

You will need to make a judgment call and decide which one is better for you.