How-to configure custom notification attributes

How-to configure custom notification attributes

Custom attributes let you store host/service values in the configuration GUI.

LAST TESTED ON CHECKMK 2.4.0P1

Table of Contents

Getting Started

Background information regarding this subject is available on our:

Step-by-step guide

Custom Service attributes

 

  1. SetupGlobal SettingsUser InterfaceCustom Service attributesAdd new element

    ID: NOTIFY_CUSTOM

    Title: Notify Service

  2. Setup →  ServicesService Monitoring RulesCustom service attributesAdd RuleAdd new element

    Screenshot of custom service attributes. Custom service attributes for Notify Service set to test test

     

  3.  Your attribute is now available for 3rd Party notification tools. Now you can write your own Notification script and use your attribute.

 

Custom Host attributes

 

  1. SetupHostCustom Host Attributes Add Host Attribute



  2. Setup → Hosts → Edit properties of HostCustom Attributes



  3. Your attribute is now available for 3rd Party notification tools. Now you can write your own Notification script and use your attribute.

Custom User Attributes

  1. SetupUsersCustom user attributesAdd User Attribute

    Screenshot of adding user attributes. Name is and title is Team1 Pikett.



  2. SetupUsersEdit User Properties

    Set the values for the newly defined custom attributes.

    Screenshot of editing user cmkadmin. Notifications set for team 1 to Y and team 2 to n.



  3. SetupEventsNotificationsEdit Notification rule

    Restrict the contact selection by using the defined custom attributes:

    Screenshot of notification rule 0. Restrict by custom macros enabled. Name of macro is team1 pikett and required match is Y.



  4. In the notify.log, it will then look like this:

    2021-06-18 16:39:37,129 [20] [cmk.base.notify] Global rule ''... 2021-06-18 16:39:37,129 [20] [cmk.base.notify] -> matches! 2021-06-18 16:39:37,129 [20] [cmk.base.notify] - skipping contact User2: value '' for macro 'Team1_Pikett' does not match 'y$'. His macros are: 2021-06-18 16:39:37,129 [20] [cmk.base.notify] - skipping contact testuser: value '' for macro 'Team1_Pikett' does not match 'y$'. His macros are: 2021-06-18 16:39:37,129 [20] [cmk.base.notify] - skipping contact snapintest: value '' for macro 'Team1_Pikett' does not match 'y$'. His macros are: 2021-06-18 16:39:37,129 [20] [cmk.base.notify] - skipping contact User1: value '' for macro 'Team1_Pikett' does not match 'y$'. His macros are: 2021-06-18 16:39:37,130 [20] [cmk.base.notify] - skipping contact automation: value '' for macro 'Team1_Pikett' does not match 'y$'. His macros are: 2021-06-18 16:39:37,130 [20] [cmk.base.notify] - adding notification of cmkadmin via mail 2021-06-18 16:39:37,131 [20] [cmk.base.notify] Executing 1 notifications: 2021-06-18 16:39:37,131 [20] [cmk.base.notify] * notifying cmkadmin via mail, parameters: elements, graphs_per_notification, notifications_with_graphs, bulk: no

Related articles