service alert email notification - data truncated

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jh129666
Posts: 98
Joined: Mon Feb 11, 2013 3:45 pm

service alert email notification - data truncated

Post by jh129666 »

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$
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: service alert email notification - data truncated

Post by avandemore »

What happens if you put a space between $SERVICEOUTPUT$ $LONGSERVICEOUTPUT$?
Previous Nagios employee
jh129666
Posts: 98
Joined: Mon Feb 11, 2013 3:45 pm

Re: service alert email notification - data truncated

Post by jh129666 »

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$
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: service alert email notification - data truncated

Post by gormank »

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

Post by avandemore »

Thanks @gormank but the pipe character is required in this context. Without it, it wouldn't work at all.
Previous Nagios employee
Locked