Page 1 of 1
Performance Graphing in Notification Emails
Posted: Wed Mar 11, 2020 2:06 pm
by nicholashadaway
I have enabled performance graphing in the admin -> components configuration page, but I am unable to determine how to receive the graphs in emails. can you please tell me how to use this core feature?
Re: Performance Graphing in Notification Emails
Posted: Wed Mar 11, 2020 4:12 pm
by jdunitz
From the front page of XI, go to:
Admin -> System Extensions -> Manage Components
scroll way down the list into "Core Components" and find Performance Graphing
click on the wrench to go into the settings, check the box to enable graphics, and set a time period.
Apply settings and that should do it.
Let me know if you run into any issues.
--Jeffrey
Re: Performance Graphing in Notification Emails
Posted: Thu Mar 12, 2020 10:17 am
by nicholashadaway
Thats what I did (checked the box and chose the 4 hour time period) but I am not seeing graphs in my notification emails. Is there a variable I need to include in the notify command to add graphs to emails?
Re: Performance Graphing in Notification Emails
Posted: Thu Mar 12, 2020 12:26 pm
by scottwilkerson
nicholashadaway wrote:Thats what I did (checked the box and chose the 4 hour time period) but I am not seeing graphs in my notification emails. Is there a variable I need to include in the notify command to add graphs to emails?
It is worth noting that the graphs only work if you are using the
xi_host_notification_handler and
xi_service_notification_handler for the users and will not work with just contacts.
Is this how your users/contacts are setup?
Re: Performance Graphing in Notification Emails
Posted: Fri Mar 13, 2020 12:04 pm
by nicholashadaway
I have attached a screenshot to show what I have in my commands. It appears to be "removed" ?
If you can point me to how to get this setup properly, it would be much appreciated.
Re: Performance Graphing in Notification Emails
Posted: Fri Mar 13, 2020 12:30 pm
by scottwilkerson
Oh boy, not sure who removed that, but they should be set to this
xi_host_notification_handler
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$"
xi_service_notification_handler
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$"
Finally, these need to be added to the contacts that receive the notifications that you want to get perf graphs
Re: Performance Graphing in Notification Emails
Posted: Mon Mar 16, 2020 9:48 am
by nicholashadaway
I have updated my contact with the command but I am not actually receiving any emails now. What am I missing?
2020-03-16T09:38:04.905153-05:00 mon0003 nagios: SERVICE NOTIFICATION: Nicholas Hadaway;tynan.mgic.net;PROD: Assembly Document Service - ads_batch.log [check_log3];CUSTOM (OK);xi_service_notification_handler;OK: Found 0 lines (limit=500/1000): No matches found.;Nicholas Hadaway;test
/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: Performance Graphing in Notification Emails
Posted: Mon Mar 16, 2020 10:03 am
by scottwilkerson
If you log in as this user, and click on the username in the upper right
is the email address correct?
Under "Notification Preferences" are notifications enabled?
Under "Notification Methods" is email enabled?
Re: Performance Graphing in Notification Emails
Posted: Mon Mar 16, 2020 10:17 am
by nicholashadaway
yes. emails still not working as expected.
Clicking "send test notifications" works... but not from an actual service check.
Re: Performance Graphing in Notification Emails
Posted: Mon Mar 16, 2020 3:22 pm
by scottwilkerson
Can I have you run the following
Code: Select all
tail -f /usr/local/nagiosxi/var/eventman.log
And then try to force an alert for a host/service that this user is assigned to to see if any errors are showing