Custom Notification Script

Upayavira uv at upaya.co.uk
Thu Apr 22 14:31:44 CEST 2004


Marc Powell wrote:

> Don't you mean $CONTACTPAGER$? $CONTACTPAGER} is incorrect. You don't 
> specifically say you did it but you should also verify that the script 
> is executable as the nagios user if you haven't already.


Actually, I typed that from memory, as I didn't have access to my server 
at the time. That I only go that bit wrong is rather impressive I think ;-)

Anyway, here is the correct extract from misccommands.cfg (this time 
using cut and paste!):

define command{
        command_name    notify-by-sms
       command_line    /home/web/bin/sendSMS.pl $CONTACTPAGER$ 
"$NOTIFICATIONTY
PE: $HOSTADDRESS$ $HOSTALIAS$: $SERVICEDESC$ is $SERVICESTATE$"
        }

define command{
        command_name    host-notify-by-sms
        command_line    /home/web/bin/sendSMS.pl $CONTACTPAGER$ "Host 
$HOSTALIAS
$ is $HOSTSTATE$; $OUTPUT$; $DATETIME$"
        }

I do not see why this shouldn't work. Unless it is because Nagios tries 
to use its embedded perl to run my Perl script. Might it be doing that?

Thanks,

Upayavira

>     -----Original Message-----
>     *From:* Upayavira [mailto:uv at upaya.co.uk]
>     *Sent:* Thu 4/22/2004 3:41 AM
>     *To:* nagios-users at lists.sourceforge.net
>     *Cc:*
>     *Subject:* [Nagios-users] Custom Notification Script
>
>     Hi,
>
>     I've just installed Nagios, which looks great.
>
>     We have our own SMS gateway, which is accessed via an HTTP post. I
>     have
>     a Perl script that is intended to send the notification messages.
>
>     When I run the script from the command line, it works fine.
>
>     I have put a command into /etc/nagios/misccommands.cfg like so:
>     define command{
>         command_name   notify-by-sms
>         command_line      /home/web/bin/sendSMS.pl $CONTACTPAGER}
>     "This is
>     the message"
>         }
>     Then, if I refer to notify-by-sms, notify-by-email, only the email
>     goes.
>     The script logs to a file, so I know it isn't being called (I've
>     tried
>     logging in as the nagios user and running the script, and it works).
>
>     Any ideas what I need to do to get these notifications working? With
>     this, I'm pretty much there with my Nagios installation, and I'll be
>     able to scrap a ream of perl based monitoring scripts.
>
>     Thanks in advance,
>
>     Upayavira
>     North London, Uk
>
>
>
>
>     -------------------------------------------------------
>     This SF.Net email is sponsored by: IBM Linux Tutorials
>     Free Linux tutorial presented by Daniel Robbins, President and CEO of
>     GenToo technologies. Learn everything from fundamentals to system
>     administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
>     <http://ads.osdn.com/?ad_id=1470&alloc_id=3638&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
>




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&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