I get the below output when running a plugin from the nagios server, which is the correct output.
WARNING:
plmdb003.prod.cin.mp-emaxx.com
SPACE USAGE WARNING
COLOR...TABLESPACE.................WARN..ALERT...%FREE......TOTAL_MB...FREE_MB
-------|-------------------------|-----|------|-------|-------------|---------
yellow..LABREP_DATA..............60000G....30G....0.86..17,172,608...148,224
When I get the email notification, data in the additional info field is truncated. I thought it was because of the pipe symbol, so I removed the pipe symbol from illegal_macro_output_chars in nagios.cfg but that didn't resolve the issue.
Additional Info:
WARNING:p879jhuk
SPACE USAGE WARNING
COLOR...TABLESPACE.................WARN..ALERT...%FREE......TOTAL_MB...FREE_MB
-------
This is the notify-service-by-email command being used.
/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$$LONGSERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
service alert email notification - data truncated
-
avandemore
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: service alert email notification - data truncated
What happens if you put a space between $SERVICEOUTPUT$ $LONGSERVICEOUTPUT$?
Previous Nagios employee
Re: service alert email notification - data truncated
I added the space but the data is still being truncated in the email notification.
/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$ $LONGSERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$ $LONGSERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
Re: service alert email notification - data truncated
You probably want to not use the pipe character in plugin output (other than for perfdata). Its reserved to separate output from perfdata, so it gets removed as part of processing the plugin output.
-
avandemore
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: service alert email notification - data truncated
Thanks @gormank but the pipe character is required in this context. Without it, it wouldn't work at all.
Previous Nagios employee