How to run a remote script in Nagios

Assaf Flatto nagios at flatto.net
Tue May 3 16:45:14 CEST 2011


Tõnis Trei wrote:
> Hello,
>
> Im quite new at Nagios and have run into a small problem.
>
> I need to trigger a script with a parameter on a remote machine and 
> based on the result trigger an alarm or not.
> But im at little loss on how to set it up.
>
> Script is located in /etc/init.d/script.sh on a remote machine and i 
> should run it as "/etc/init.d/script.sh X" where x is the parameter.
> Script returns me the result, eather OK or some text and in case of 
> not being ok, i want to send this text out with an email.
>
> So im wondering that should i specifie a command in command.cfg that 
> would run this script and then create a new service that would trigger 
> this command and mail the results?
>
>
> Thanks,
> Tõnis
The basic way is to do this over nrpe ,
you need to make sure that nrpe ios complied with the command-args 
option and then you can pass the parameter you want to the script  you 
want to trigger .
for more information on NRPE
http://nagios.sourceforge.net/docs/3_0/addons.html#nrpe

Assaf

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list