RES: RES: RES: Parameters not passed toeventhandler'sscript

Marc Powell marc at ena.com
Wed Mar 5 20:22:03 CET 2008



> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-
> bounces at lists.sourceforge.net] On Behalf Of Bráulio H. Soares
> Sent: Wednesday, March 05, 2008 12:37 PM
> To: Bráulio H. Soares; Marc Powell; nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] RES: RES: RES: Parameters not passed
> toeventhandler'sscript
> 
> I'm using to tests purposes the script attached.
> It's only send a e-mail when a change status occurs, based on the
> parameters $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$.
> 
> I'm thinking by the following way:
> The conditions to the "cases" are not being matched.


> > The command with the parameters is this:
> > command_line /fakepath/nagios/fake_script $SERVICESTATE$
> > $SERVICESTATETYPE$ $SERVICEATTEMPT$

$1 in your script should be 'OK', etc, presuming this is a service event handler. It will be null otherwise. However, the values $SERVICESTATE$, $SERVICESTATETYPE$ and $SERVICEATTEMPT$ will *always* be null within the script. Nagios doesn't perform macro substitution within scripts, only on the command_line used to call the script. In your script they'd be $1, $2 and $3 respectively if called as above.

Why don't you provide full information in one concise e-mail. There are too many going around with hints and bits in each. If you're trying to get an event handler to work --

- a precise description of the scenario you are testing and the results you expect.
- Nagios version
- host{} definition
-- host check_command command{} definition
-- host event_handler command{} definition
-- host event handler script
- service{} definition
-- service check_command command{} definition
-- service event_handler command{} definition
-- service event_handler script


--
Marc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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