Change Email subject line order

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Eddie.Brown
Posts: 7
Joined: Mon Jul 18, 2016 2:03 pm

Change Email subject line order

Post by Eddie.Brown »

Hello Folks,

I am looking for some guidance on how to change the subject line order. So it looks like the below. I am running Core 4.3.1.

CRITICAL Service Alert: Server01 Server/Memory Usage is CRITICAL

The problem is the majority of the tech when checking emails after hours are doing so via their cell phones. The original subject line puts critical at the end which most phones don't pick up. Therefore the critical emails are not being seen.
I found where the code is to make the required changes just not sure what I need to take out and what to leave in.

/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" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$

Any guidance would be appreciated.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Change Email subject line order

Post by cdienger »

Hi Eddie,

Try:

/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" | /bin/mail -s "$SERVICESTATE$ $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked