[Launching a perl script from nagios ]

badreddine meherzi badreddinem at gmail.com
Thu Mar 4 13:07:32 CET 2010


Hi,

I'm trying to make nagios execute a perl script as host problem notification
instead of sending a mail and this doesn't work.
so I've done the following configurations:
The Perl script is for RT ticket creation.
The Perl script "create_ticket.pl" works fine and a ticket is created when
executed with the perl command in shell by the nagios user.
I tried also to put the shell command for ticket creation directly on the
command_line field of the command.cfg file and still don't work.
It works fine for the default notify-host-by-mail command from the command
file and also when executed manually on bash.

COMMAND.CFG

#'notify-host-by-create-ticket' command definition
define command {
       command_name notify-create-ticket
       command_line /home/himilco/perlscript/create_ticket.pl
       # I tried also to put : command_line /opt/rt3/bin/rt create -t ticket
set subject='ticket_from _nagios ' priority=10 queue=General
       }
CONTACT.CFG
#contact definition
define contact{
        contact_name                    nagiosadmin
        use                                   generic-contact
        alias                                  Nagios Admin
        host_notification_commands      notify-create-ticket    ; Create RT
ticket
        email                                 root at localhost
}

I have the right information on the nagios web interface concerning the
hos_notifiction

the nagios log show this line:
************
Mar  4 12:01:25 localhost nagios: HOST NOTIFICATION:
nagiosadmin;pc-yacine;DOWN;notify-create-ticket;CRITICAL - Host Unreachable
(172.16.125.140)
*************
I can provide further configuration information,
I hope that someone can tell me what's wrong , thnks

-- 
Cordialement,
Badreddine MEHERZI
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20100304/5d6d5dc3/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
-------------- 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