How to run a remote script in Nagios

Tõnis Trei tonis.trei at gmail.com
Wed May 4 15:30:43 CEST 2011


I got it solved by using check_by_ssh. Will keep in mind and check nrpe next
time i need something similiar and can install a plugin to a remote machine.

Thanks for the help :)

Tõnis

2011/5/4 Tõnis Trei <tonis.trei at gmail.com>

> Doesn't nrpe require some installation on the remote machine?
> I can't install that plugin to the remote machine so ill trie to get it
> done with check_by_ssh.
> As i understand it doesn't require any additional plugins on the remote.
>
> But what puzzles me the most, is how Nagios will send the result of the
> script check in the alarm notification.
> Script echoes back some text and i can't figure out how to send that text
> back in the notification if result <>OK
>
> I guess there has to be some check on Nagios side regarding the result,
> where i should specify what is and what is not OK. But is there anything i
> should do, so that Nagios would be able to actually fetch the result and
> send it in the notification?
>
> Tõnis
>
>
> On 3 May 2011 17:45, Assaf Flatto <nagios at flatto.net> wrote:
>
>> 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
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20110504/05784b70/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
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
-------------- next part --------------
_______________________________________________
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