trap scripting

Sebastian Kayser mls at skayser.de
Tue Dec 13 09:21:07 CET 2005


* Hugo van der Kooij <hvdkooij at vanderkooij.org> wrote:
> I think I will give a go at writing my own scripts to send out UP and DOWN
> notifications based on the SNMP traps I get from my router.
> 
> If I understood the manual (nagios/docs/extcommands.html) correctly all I
> have to do is that I just have to write a single line to the fifo like:
> 
> PROCESS_HOST_CHECK_RESULT <host>;<status>;<whatever details I would
> like to add about the trap>
>
> [...]
> 
> I could send a message like:
> 
> PROCESS_HOST_CHECK_RESULT Internet;DOWN;TRAP: PPP LCP Closed
> 
> And the host would be considered down as it will read this as a passive
> check result.
> 
> Or did I misread anything?

Have a look at "External Command Detail: PROCESS_HOST_CHECK_RESULT"
http://shorl.com/dagolemistuty

You are missing the timestamp, a semicolon and i don't know wether DOWN
as a status is accepted (i use the numeric status codes 012).

So rather it should be

[<timestamp>] PROCESS_HOST_CHECK_RESULT;Internet;1;TRAP: PPP LCP Closed

- sebastian


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
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