Custom command

Jim Pye jim.pye at pyenet.co.nz
Thu Feb 2 21:36:17 CET 2006


Robert,

One thing I discovered with the script is that it uses the alarm()
functionality of the Linux kernel to help catch communication time outs.
Both Windows (and NetWare) do not support this functionality in their
PERL implementations. The script does account for Windows (I had to
modify it for NetWare) by detecting the OS and turning off that
function.

I am wondering if FreeBSD implementation of this alert function is not
working correctly. Or as the program works when running at commandline
that a permissions issue is being seen with this function. I do not have
a freeBSD to try the script on myself.

Not sure of your hacking skills but the lines that involve this alarm()
call are documented in the code and all I did for NetWare was add to the
OS test, at each of the places where it tests for Windows (about 5 or
6), the string returned by NetWare.

HTH
Jim


On Thu, 2006-02-02 at 10:21 -0500, Robert Fitzpatrick wrote:
> Thanks to Jim here on the list, I have defined a command to send an
> e-mail using a sendEmail perl script. From the command line, the script
> works fine. When I try to use the new notify-by-sendEmail as the
> service_notification_commands for my contact, Nagios logs the message as
> sent, which never makes it to the SMTP server and I get this error in
> the /var/log/messages:
> 
> Feb  2 10:13:39 esmtp kernel: pid 14486 (nagios), uid 2004: exited on
> signal 10
> 
> I have the same permissions on the file as the other commands that
> Nagios uses in the minimail.cfg, like /usr/bin/mail:
> 
> esmtp# ls -lah /usr/local/bin/sendEmail
> -r-xr-xr-x  1 root  wheel    62K Feb  1 17:58 /usr/local/bin/sendEmail
> 
> Can someone suggest why I get this error? I simplified the new command
> without the variables like below, I can copy and paste this command to
> the command line and the message gets sent successfully:
> 
> define command{
>         command_name    notify-by-sendEmail
>         command_line    /usr/local/bin/sendEmail -f
> nagios at esmtp.webtent.net -t robert at webtent.com -s 10.0.0.40 -m "Body" -u
> "Subject"
>         }
> 
> define contact{
>         contact_name                    webtent
>         alias                           WebTent
>         service_notification_period     24x7
>         host_notification_period        24x7
>         service_notification_options    w,u,c,r
>         host_notification_options       d,r
>         service_notification_commands   notify-by-sendEmail
>         host_notification_commands      host-notify-by-email
>         email                           support at mydomain.com
>         }
> 
> 
-- 
Jim Pye
PyeNet Universal

email: jim.pye at pyenet.co.nz | Phone: +64 4 527 8284 | Fax: +64 4 528 9693
                     web site: http://www.pyenet.co.nz



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
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