problems with action_url/notes_url URL truncation

Eric Pearce epearce at amberpoint.com
Wed Dec 10 19:08:31 CET 2008


Sorry if this in the docs or FAQ - I didn't see it if it is.
I'm running nagios 3.0.6 and 1.4.13 plugins.
I want to have a URL in the email host notification that would allow me to connect to an Avocent KVM switch.  This is what I have for the host definition:


define host{
        use     generic-host
        host_name       dbtest
        alias   dbtest
        contact_groups  buildpeople
        action_url      https://kvmswitch/cgi-bin/kvm.cgi?&file=overview-dsr&userID=1326154034&index=25
}

This URL works fine if you use it directly in a browser.  

I changed the notify-host-by-email command to include action_url via $HOSTACTIONURL$:

# 'notify-host-by-email' command definition
define command{
        command_name    notify-host-by-email
        command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NO
TIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOST
OUTPUT$\n\nDate/Time: $LONGDATETIME$\nKVM URL: $HOSTACTIONURL$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
        }


But the resulting email message seems to have lost all but the first "&" character, so the URL now looks like:

KVM URL: https://kvmswitch/cgi-bin/kvm.cgi?file=overview-dsruserID=1326154034index=25

What am I missing here? I see others posting examples of URLs with arguements, which implies that they are working for them.
thanks
-e
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20081210/698304a9/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
-------------- 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