> -----Original Message-----
> From: Mr Gabriel [mailto:[email protected]]
> Sent: Monday, 25 January 2010 09:49
> To: [email protected]
> Subject: [Nagios-users] How to run a perl script instead of sending
> emails?
> 
> Dear All,
> 
> I have a perl script that connects to my asterisk instance, and calls
> who ever is on shift to log in, and take care of whatever broke. I
> would
> like to initiate this script whenever there is a critical alert that
> has
> gone off more than once - how can I best achieve this?
> 
> I would like these to run instead of an email when out of hours, and
> when a critical alert has been left unattended to for some time

What a cool idea..

Fairly simple.

Use service escalation to change the contact for 2nd notification onward, and 
set the contact's notification 'command' to be the perl routine to poke 
asterisk.

define serviceescalation{
        host_name                       nt-3
        service_description     Processor Load
        first_notification      2
        last_notification               2
        notification_interval   30
        contacts                        +thephone
        escalation_options      c
        }

define contact{
        contact_name                    jdoe
        alias                           John Doe
        host_notifications_enabled      1
        service_notifications_enabled   1
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    c,u
        host_notification_options       d,u,r
        service_notification_commands   notify-by-phone
        host_notification_commands      host-notify-by-phone
        email                                   [email protected]
        pager                                   
[email protected]
        address1                                [email protected]
        address2                                555-555-5555
        }

define command{
        command_name    notify-by-phone
        command_line    /usr/local/bin/service-phone.pl
        }
define command{
        command_name    host-notify-by-phone
        command_line    /usr/local/bin/host-phone.pl
        }

Examples pulled from the documentation., modified slightly.

Stuart

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Nagios-users mailing list
[email protected]
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

Reply via email to