Skip to main content

Hi,

This is my first topic, please keep nice with me ;-)

i have create a service wich use a script python. i build an url to return on the field “Extended status information”

for example : https://myhost.com/detail?param1=4&param2=12


 

 

But when i receive the notification by mail, the character “&” (Ampersand or esperluette in french) is missing



This is my command of notification by email :

/usr/bin/printf "%b" "$SERVICEOUTPUT$\n\$LONGSERVICEOUTPUT$\nNotes : $SERVICENOTES$\nLien d'aide de resolution : $SERVICENOTESURL$\n\n\nDate/Time: $DATE$/$TIME$\nService: $SERVICEDESC$\nHote : $HOSTALIAS$\nStatut : $SERVICESTATE$\n\n" | @MAILER@ -r noreply.supervision@isocel.info -s "Supervision ALICE - $SERVICEDESC$" $CONTACTEMAIL$

 

Have you got an idea to keep the “&” on my url please ?

 

Thanks a lot.

Hi,

 

This is because some characters are automatically stripped by engine (Illegal Macro Output Characters) when it substitutes a macro by its value. 

 

You can still remove the & from the list, but as it’s a char interpreted by the shell, it could probably cause a failure in your command execution and even worse open some security hole. 

 

Concerned macro are: 

$HOSTOUTPUT$$HOSTPERFDATA$$HOSTACKAUTHOR$$HOSTACKCOMMENT$$SERVICEOUTPUT$$SERVICEPERFDATA$$SERVICEACKAUTHOR$, and $SERVICEACKCOMMENT$


Hope this helps


Thanks a lot, it works now


Reply