ePN Trouble

Daniel Wittenberg daniel.wittenberg.r0ko at statefarm.com
Mon Feb 7 16:31:47 CET 2011


Add this to your script in the first 10 lines to keep epn from parsing:

 

# nagios: -epn

 

Dan

 

From: Juan-Francisco Diez [mailto:mochu33 at gmail.com] 
Sent: Monday, February 07, 2011 4:29 AM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] ePN Trouble

 

Hi all,

I use a script to notify service problems. The script run well with perl
but not with ePN. The error it sent to the /var/log/messages is:

nagios: **ePN failed to compile
/usr/lib/nagios/eventhandlers/notify-service-by-email.pl: "String found
where operator expected at (eval 8) line 52, near "case "PROBLEM""" at
/usr/bin/p1.pl line 159.

In the script I use the Switch.pm to assign a different text depending
on the notification type. The switch is like this:

switch ($optnotiftype) {
        case "PROBLEM"                            { $NOTIFTYPE='Problem'
}
        case "RECOVERY"                          { $NOTIFTYPE='Recovery'
}
        case "ACKNOWLEDGEMENT"          { $NOTIFTYPE='Notification
Acknowkedge' }
        case "DOWNTIMESTART"                { $NOTIFTYPE='Start of
Planned Stop' }
        case "DOWNTIMEEND"                    { $NOTIFTYPE='End of
Planned Stop' }
        case "DOWNTIMECANCELLED"        { $NOTIFTYPE='Planned Stop
Canceled' }
        else                                                  {
$NOTIFTYPE=$optnotiftype }
}

All the vars are defined and the script run OK with perl.

Can someone help me to fix this problem?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20110207/d28b0dd5/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
-------------- 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