Alert info being truncated by Hipchat notfications.
Re: Alert info being truncated by Hipchat notfications.
It is not showing up, related; The email template is applied as default to all users and the contacts have notify-service-by-email and xi_service_notification_handle as their notification commands.
Re: Alert info being truncated by Hipchat notfications.
The contacts already have this applied.tmcdonald wrote:Something isn't adding up. Your template shows ***** Nagios XI Alert ***** but the email you receive shows ***** Nagios Monitor XI Alert ***** which is defined by the notify-host-by-email command. You likely need to make your contact use the xi_host_notification_handler and xi_service_notification_handler commands in the CCM, and the changes will take effect.
Re: Alert info being truncated by Hipchat notfications.
ssax wrote:Let's try this to make sure that the template is actually being applied:
Try this template, have it generate an email, see if the text Long: is even shown in the email.
Code: Select all
***** Nagios XI Alert ***** %alertsummary% Notification Type: %type% Service: %service% Host: %host% Address: %hostaddress% State: %servicestate% Info: %serviceoutput% Long: %longserviceoutput% Date/Time: %datetime% Respond: %responseurl% Nagios URL: %xiserverurl%
I'm not sure if you missed my message, did you try this, what were the results?
Re: Alert info being truncated by Hipchat notfications.
I replied, it's not showing up even with the template set as default for all users.ssax wrote:ssax wrote:Let's try this to make sure that the template is actually being applied:
Try this template, have it generate an email, see if the text Long: is even shown in the email.
Code: Select all
***** Nagios XI Alert ***** %alertsummary% Notification Type: %type% Service: %service% Host: %host% Address: %hostaddress% State: %servicestate% Info: %serviceoutput% Long: %longserviceoutput% Date/Time: %datetime% Respond: %responseurl% Nagios URL: %xiserverurl%
I'm not sure if you missed my message, did you try this, what were the results?
Re: Alert info being truncated by Hipchat notfications.
Can you post the "notify-host-by-email", "notify-service-by-email", "xi_host_notification_handler" and "xi_service_notification_handler" command definitions?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Alert info being truncated by Hipchat notfications.
notify-host-by-email
notify-service-by-email
xi_host_notification_handler
xi_service_notification_handler
Here you go.
Code: Select all
/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$Code: Select all
/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$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$Code: Select all
/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=host --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --lasthoststate=$LASTHOSTSTATE$ --lasthoststateid=$LASTHOSTSTATEID$ --hoststatetype=$HOSTSTATETYPE$ --currentattempt=$HOSTATTEMPT$ --maxattempts=$MAXHOSTATTEMPTS$ --hosteventid=$HOSTEVENTID$ --hostproblemid=$HOSTPROBLEMID$ --hostoutput="$HOSTOUTPUT$" --longhostoutput="$LONGHOSTOUTPUT$" --datetime="$LONGDATETIME$"Code: Select all
/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=service --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --service="$SERVICEDESC$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --servicestate=$SERVICESTATE$ --servicestateid=$SERVICESTATEID$ --lastservicestate=$LASTSERVICESTATE$ --lastservicestateid=$LASTSERVICESTATEID$ --servicestatetype=$SERVICESTATETYPE$ --currentattempt=$SERVICEATTEMPT$ --maxattempts=$MAXSERVICEATTEMPTS$ --serviceeventid=$SERVICEEVENTID$ --serviceproblemid=$SERVICEPROBLEMID$ --serviceoutput="$SERVICEOUTPUT$" --longserviceoutput="$LONGSERVICEOUTPUT$" --datetime="$LONGDATETIME$"Re: Alert info being truncated by Hipchat notfications.
In the upper-right-hand corner, click your username then go to Notification Preferences. What settings do you have for email alerts? It is possible the xi_host/service_notification_handler commands are properly running, but you don't allow any of them to continue due to these settings.
Former Nagios employee
Re: Alert info being truncated by Hipchat notfications.
Thanks, that looks like it corrected the truncating issue. Couple of questions though;
If the email notifications were disabled in the Notification preferences, why was my user still receiving notifications?
Why isn't there some sort of inheritance between the Contact Management and Notification preferences?
Thanks again for the help.
If the email notifications were disabled in the Notification preferences, why was my user still receiving notifications?
Why isn't there some sort of inheritance between the Contact Management and Notification preferences?
Thanks again for the help.
Re: Alert info being truncated by Hipchat notfications.
Going into something soon so I don't have time for a long answer, but basically:
https://assets.nagios.com/downloads/nag ... ntacts.pdf
You had both User-based and contact-based commands enabled. They both ran, but the User-based got blocked by Notification Preferences so you just received the contact-based ones.
In regards to tighter integration between the two, there are cases where you may have a User with no contact, a contact with no User, or a case where you have both but you want them to have different email addresses or other settings.
https://assets.nagios.com/downloads/nag ... ntacts.pdf
You had both User-based and contact-based commands enabled. They both ran, but the User-based got blocked by Notification Preferences so you just received the contact-based ones.
In regards to tighter integration between the two, there are cases where you may have a User with no contact, a contact with no User, or a case where you have both but you want them to have different email addresses or other settings.
Former Nagios employee