You’ll have to create duplicate contacts and in the duplicates you would set a command for host_notification_commands/service_notification_commands that is defined to run a script.
pager pager_number or pager_email_gateway
The multi.sh script would read the multiline output to a variable which you could send by an 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\n$output" | /usr/bin/mail -a"X
-Alert: nagios" -s "* $NOTIFICATIONTYPE Service Alert: $HOSTALIAS/$SERVICEDESC is $SERVICESTATE **” $CONTACTEMAIL
The bolded part is an output from a file with multiline output. The only thing you’ll have to deal with is handling the macro variables from nagios. You can forward them to this script through a command definition after a command_line variable as input variables for a bash script ($1, $2, $3 etc.) or you can enable environment variables in nagios.cfg which would make them accesible all over the system (but it slows down the system, read the explanation about it in nagios.cfg).