shell script in nagios
Anthony
anthony-nagios at hogan.id.au
Mon Sep 7 18:54:13 CEST 2009
Nagios doesn't have inbuilt ssh support per se.. It's allll about the
plugins.
You could make a shell script on your nagios box to perform the SSH, parse
the response and then return the relevant error level and text as per the
nagios plugin guidelines.. you can use utils.sh as a base..
Making up check plugins for nagios is pretty easy.. They just have to return
an exit code of 0-3 depending on the state of the app and an appropriate
status message. You can optionally add performance data to that.
For information on building your own plugins, consult:
http://nagiosplug.sourceforge.net/developer-guidelines.html
Otherwise, make the script on the remote server and use NSCA or NRPE to
push/pull (respectively) the results from the remote machine to the nagios
box.
Otherwise have a look Nagios Exchange to see if someone's built an ssh
execution plugin with string parsing.
http://exchange.nagios.org/index.php?option=com_mtree&task=search&Itemid=74&searchword=ssh
... looks like there might be a few options already (didn't go further than
the above search page)
On Tue, Sep 8, 2009 at 02:13, Melanie Pfefer <melanie_pfefer at yahoo.co.uk>wrote:
> Hi,
>
> I have a shell script that greps for error in a log file and returns the
> entries if any.
>
> Now I want to run this shell script in nagios so that the check runs
> periodically.
>
> I expect nagios to do ssh and execute the shell script. If errors appear,
> the subject returns error in its subject and send the errors in attachement.
>
> any idea please? thanks for sharing your ideas and experience
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090908/ae3fa33d/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
-------------- 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