custom manage service commands

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ibmkenexa
Posts: 28
Joined: Wed Feb 13, 2019 4:05 am

custom manage service commands

Post by ibmkenexa »

Team,

I need a help to configure nagios alerts with custom "Recovery" and P1_PROBLEM_SERVICE tag in alert subject line.

Requirement: Add tags in subject line as below:

Custom command with subject line : "P1_RECOVERY_SERVICE_ALERT - Nagios Monitor XI Alert for recovery alerts" - It does not work if select only "r" option in manage service command options in contact management.

Custom command with subject line "P1_PROBLEM_SERVICE_ALERT - Nagios Monitor XI Alert" for CRITICAL alerts - It works if select both "c" and "r" options but subject line is showing same for both critical and recover alerts.

I have tried with a custom command as below and added in manage service command as "notify-service-by-email_IWR_P1_alerts_recovery_template" and selected "r" option in service notification options. (Did not check "c" option" ) - BUT no luck the manage service notification command is not trigger alerts.

Custom command for P1_RECOVERY_SERVICE_ALERT :

/usr/bin/printf "%b" "** P1_RECOVERY_SERVICE_ALERT - Nagios Monitor XI Alert - SL Washington DC And Toronto**\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTNAME$ \nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info: $SERVICEOUTPUT$\n\nThis monitor has been $SERVICESTATE$ for: $SERVICEDURATION$\n\nResponse Documentation URL: $SERVICENOTESURL$\n\nRecipients of this alert: $NOTIFICATIONRECIPIENTS$\n\nComments: $NOTIFICATIONCOMMENT$\n\nNotes: $SERVICENOTES$" | /bin/mail -s "** P1 RECOVERY Service Alert: $HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$ **" -r [email protected] $CONTACTEMAIL$


Customized command for P1_PROBLEM_SERVICE_ALERT :

/usr/bin/printf "%b" "** P1_PROBLEM_SERVICE_ALERT - Nagios Monitor XI Alert - SL Washington DC And Toronto**\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTNAME$ \nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info: $SERVICEOUTPUT$\n\nThis monitor has been $SERVICESTATE$ for: $SERVICEDURATION$\n\nResponse Documentation URL: $SERVICENOTESURL$\n\nRecipients of this alert: $NOTIFICATIONRECIPIENTS$\n\nComments: $NOTIFICATIONCOMMENT$\n\nNotes: $SERVICENOTES$" | /bin/mail -s "** P1 PROBLEM Service Alert: $HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$ **" -r [email protected] $CONTACTEMAIL$
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: custom manage service commands

Post by benjaminsmith »

Hi @ibmkenexa,

I have included a few links below on custom variables and how to configure notifications in Nagios XI. Please refer to those documents to help configure your notification templates and commands.

I see you have two subject lines: "P1_RECOVERY_SERVICE_ALERT - Nagios Monitor XI Alert for recovery alerts" and "P1_PROBLEM_SERVICE_ALERT - Nagios Monitor XI Alert". Under what conditions are your trying to change the notification subject?

References
Understanding Notification Variables

How to Configure Email And Text Notifications
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked