OS lvl scripts not running

Marc Powell marc at ena.com
Tue Aug 11 16:17:43 CEST 2009


On Aug 11, 2009, at 5:35 AM, Tim Clarke wrote:

> Aug 11 11:12:38 man6 nagios: SERVICE NOTIFICATION:  
> alladmins;man3;MySQL
> mysql database;OK;notify-service-by-sms;Uptime: 5  Threads: 1
> Questions: 7  Slow queries: 0  Opens: 12  Flush tables: 1  Open  
> tables:
> 6  Queries per second avg: 1.40

Nagios is executing your command_line. This is good.

> The email turns up instantly but not the sms.
>
> Here's the /etc/nagios/objects/commands.cfg entry which you can see by
> the log above is firing:
> define command{
>        command_name    notify-service-by-sms
>        command_line    /usr/bin/smssend $CONTACTPAGER$ "Nagios -
> $NOTIFICATIONTYPE$ : $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$
> ($OUTPUT$)"
> #       command_line    /usr/bin/printf "%b" "To:
> $CONTACTPAGER$\n\nNagios - $NOTIFICATIONTYPE$ :
> $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ ($OUTPUT$)" > `
> mktemp /tmp/out_XXXXXX`
>        }
>
> And you can see the commented out test I put in to see if it would run
> *anything* - that commented out line fails too.

I can't speak to smssend but as for your test, you can't depend on the  
location of mktemp to be in your $PATH. Try specifying the full path  
the mktemp in the command_line or just hard-code a filename for this  
specific test.

--
Marc


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
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