Mail help needed

James Pratt jpratt at norwich.edu
Tue May 12 17:43:44 CEST 2009



-----Original Message-----
From: Martyn [mailto:martyn at chetnet.co.uk] 
Sent: Tuesday, May 12, 2009 11:31 AM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Mail help needed

I have found a provider that will convert Email to Voice but they use
$START$ and $END$ for their system to understand the mails.

I have altered my mail script as below 

/usr/bin/printf "%b" "$START$ Alert\n\nNotification Type:
$NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost:
$HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time:
$LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" $END$ |
/usr/bin/mailx -s " $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$
is $SERVICESTATE$ " $CONTACTEMAIL$

But when I send a test mail I get which just adds a single $ at the
beginning and the end, is there a way to do this or is this happening
because Nagios users the $ itself, sorry for what may seem a dumb
question to you but I just do not know the answer

$ Alert 

Notification Type: PROBLEM 

Service: FTP 
Host: test 
Address: 8x.1x.9x.2x 
State: CRITICAL 

Date/Time: Tue May 12 15:53:40 BST 2009 

Additional Info: 

CRITICAL - Socket timeout after 10 seconds$ 

Cheers 

Martyn 


---

This is because $START$ and $END$ aren't defined in commands.cfg , that
is they contain no variable data so it shows as a blank $ - if you need
to send those explicitly with no variable in your email/notification,
you will likely have to escape the $'s such as:

\$START\$ 

And 

\$END\$ 


Hth,
Cheers,
Jamie



------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
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