Add Custom Service Url into Mail Notification


#1

Check_mk Raw 1.5.0p5

Hi all,
I have a new “main Quest” (not in RPG :wink: ) in OMD/Check_mk:
To monitor a special Windows Service on 2 Hosts. When this service is stoped or closed omd have to send a mail to a special contact group and for this service I want to add an URL with the solution of this problem.
So I make arule in manual check, add the Windows Service no problem at this time, but if I stop the service I get the mail with nothing in the custom Service Notes URL. So I add a URL in the “manual check-rule”, but same problem.
I add a rule in “Monitoring Configuration” / “Notes URL for Services” with a different URL, but same problem.
I think there must be a simple solution, but I cannot find it.
Made the config that if the problem is, omd send me the complete variable list, that I can find the urls I add, but no one of the urls I added is listed.

I will build a Business Intelligence for a “Working Process”: Some Windows Services of different hosts, some statues of different hosts. All of this is needed that a “Work Process” is fine. Is one of this is broken, check_mk should send a notification to a group and send a URL with the explicit solution for this problem. Hope you understand what I mean.


(Philipp Näther) #2

Assuming you are using rule based notifications, you have to set an option for adding the custom URL in the notification method of the notification rule that matches for your given contacts:


#3

I configured this rule, after the first tests: I get the messages without the URL.
Then I add the parameter "Complete variable list (for testing) to take a view, if the url is in another parameter. But I can’t find the URL I added in any parameter.


#4

I found the Custom Note that I added before. I go to the service, click on the “action menue” “Service State” and then there is the “Custom Notes” linked. But I don’t get it in the mail notification.
ServiceIcon


(Philipp Näther) #5

I tested a little bit and found out, that the notification variable is missing in the notification template, that is used by the RAW versions (note urls on CEE work out of the box).
That means you have to edit the following file:

~/etc/nagios(or icinga, depending on the core you are using)/conf.d/check_mk_templates.cfg

In the commands section of the file you find the notification command template. Between all thos lines add this:

NOTIFY_SERVICENOTESURL='$SERVICENOTESURL$' \

After you added that, restart your site or do a cmk -R and send a test notification for your service with a note url.


#6

That’s it. Problem solved.
I added this line and I get the URL in the notification. Thank you.


(Philipp Näther) #7

Be aware that this is not save on upgrade. You probably have to add this line again after doing a cmk update on your server.