Spaces being stripped from $SERVICENOTES$ macro


I’ve defined a Service Note , and reference it in my notify-by-email command.

All spaces are removed from between each word! This works fine on 2.4, but not on 3.0.1

Any ideas?

Here’s my email command:

define command{ command_name notify-by-email command_line /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$\n\nService Notes:\n\n$SERVICENOTES$" | /bin/mailx -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ -- -r }

Here’s my service definition:

define service{ use generic-24x7 ; Name of service template to use hostgroup_name dns_servers service_description DNS: External notification_options c,r check_command check_dns! contact_groups unix-email } define serviceextinfo{ hostgroup_name dns_servers service_description DNS: External notes "This alert indicates that the DNS server on this system is no longer providing lookups for external hosts.\n\nUNIX: To restart DNS, do this as root:\n service named restart" }

Here’s what the email looks like:

Sent: Thursday, April 10, 2008 3:00 PM
To: Unix
Subject: ** PROBLEM alert - xxxxxxxx/DNS: External is CRITICAL **


Notification Type: PROBLEM

Service: DNS: External
Host: spdm2058a
Address: xxxxxxxx

Date/Time: Thu Apr 10 19:00:12 GMT 2008

Additional Info:


Service Notes:



Did you try writing the notes without double quotation marks?


That did work - interesting that the behavior changed from 2.4 to 3.0.1

Thanks for figuring out this simple resolution!