Ticket #139 (accepted defect)
solaris printf statement syntax error after import/export from 2.5 to 3.0
| Reported by: | devans3428 | Owned by: | tdondich |
|---|---|---|---|
| Priority: | major | Milestone: | 1.4 |
| Component: | Importer | Version: | 1.0.2 |
| Keywords: | import export printf | Cc: |
Description
OS:solaris9,10 build
Ran the import/export from 2.5 nagios to 3.0 nagios...Exported using the lilac export engine. I was not receiving my alert emails. I later found the import had added some additional characters to my notify-by-email printf command...notice the double and sometime unnecessary "\"....see the diff below:
nagios-2.5 notify-by-email:
/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
nagios-3.0.6 notify-by-email after exporting with lilac-1.0.2:
/usr/bin/printf \"%b\" \"***** Nagios *****\\n\\nNotification Type: $NOTIFICATIONTYPE$\\n\\nService: $SERVICEDESC$\\nHost: $HOSTALIAS$\\nAddress: $HOSTADDRESS$\\nState: $SERVICESTATE$\\n\\nDate/Time: $LONGDATETIME$\\n\\nAdditional Info:\\n\\n$SERVICEOUTPUT$\" | /usr/bin/mailx -s \"** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **\" $CONTACTEMAIL$
