Discussion:
[Check_mk (english)] Notifications for service in certain contact group
(too old to reply)
m3rlinux
2017-12-12 09:15:14 UTC
Permalink
Hi,

check_mk version is: 1.4.0p19

by rule I have added some services to contact group then I have created
a notification rule as:

{'comment': u'', 'match_hosttags': ['cst_regbas'], 'description': u'mail
GMED REGBAS', 'contact_groups': ['GMED'], 'disabled': False,
'notify_plugin': (u'mail', {'host_subject': u'GROUPS $HOSTGROUPNAMES$:
SERVER $HOSTNAME$ - $EVENT_TXT$', 'from':
'***@some_domain.ext', 'service_subject': u'GROUPS
$HOSTGROUPNAMES$: SERVER $HOSTNAME$/$SERVICEDESC$ $EVENT_TXT$'}),
'contact_all_with_email': False, 'contact_all': False, 'contact_object':
False, 'allow_disable': True, 'match_contactgroups': ['GMED'],
'docu_url': ''}

The goal of this rule should be to sent notifications to contact group
"GMED" whom is defined only for some services of hosts with TAG
"cst_regbas".

The problem is that I receive notifications for _*ALL*_ services of
hosts with TAG "cst_regbas".

Can someone help to undestand where I am wrong?

Many thanks!
--
Think open live free!
HINC
Paul
2017-12-14 06:02:42 UTC
Permalink
Without knowing more details around your service -> contact group configuration, a way to work around this would be to create a service group with only the services that should go to GMED. (“GMED-Services”)Then in the notification rule explicitly call out this service group and must have GMED as a contact/ contact group.
Post by m3rlinux
Hi,
check_mk version is: 1.4.0p19
The goal of this rule should be to sent notifications to contact group "GMED" whom is defined only for some services of hosts with TAG "cst_regbas".
The problem is that I receive notifications for ALL services of hosts with TAG "cst_regbas".
Can someone help to undestand where I am wrong?
Many thanks!
--
Think open live free!
HINC
_______________________________________________
checkmk-en mailing list
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
m3rlinux
2017-12-14 08:01:08 UTC
Permalink
Thanks for reply.
To solve this issue temporarily I added the services i notification rule:

{'comment': u'', 'match_hosttags': ['cst_regbas'], 'allow_disable':
True, 'description': u'mail GMED REGBAS', 'contact_object': False,
'contact_groups': ['GMED'], 'disabled': False, 'notify_plugin':
(u'mail', {'host_subject': u'GROUPS $HOSTGROUPNAMES$: SERVER $HOSTNAME$
- $EVENT_TXT$', 'from': '***@yyyy.ext', 'service_subject': u'GROUPS
$HOSTGROUPNAMES$: SERVER $HOSTNAME$/$SERVICEDESC$ $EVENT_TXT$'}),
'contact_all_with_email': False, 'match_contactgroups': ['GMED'],
'docu_url': '', 'contact_all': False, 'match_services': [u'*Filesystem*']}

Anyway I'd like if it should work by adding contactgroups for some
services. I did it by this rule:

service_contactgroups = [
  ( 'GMED', ['/' + FOLDER_PATH + '/+'], ['Host01', 'Host02', 'Host03',
'Host04'], [u'Filesystem'], {'comment': u'service contact groups',
'description': u'Assign Service to Contact Group'} ),
] + service_contactgroups

I think there is a problem with notifications system, seems that it not
recognise contact group in services.

Think open live free!
HINC
Post by Paul
Without knowing more details around your service -> contact group
configuration, a way to work around this would be to create a service
group with only the services that should go to GMED.
(“GMED-Services”)Then in the notification rule explicitly call out
this service group and must have GMED as a contact/ contact group.
Post by m3rlinux
Hi,
check_mk version is: 1.4.0p19
by rule I have added some services to contact group then I have
u'mail GMED REGBAS', 'contact_groups': ['GMED'], 'disabled': False,
'notify_plugin': (u'mail', {'host_subject': u'GROUPS
$HOSTGROUPNAMES$: SERVER $HOSTNAME$/$SERVICEDESC$ $EVENT_TXT$'}),
'contact_all_with_email': False, 'contact_all': False,
'contact_object': False, 'allow_disable': True,
'match_contactgroups': ['GMED'], 'docu_url': ''}
The goal of this rule should be to sent notifications to contact
group "GMED" whom is defined only for some services of hosts with TAG
"cst_regbas".
The problem is that I receive notifications for _*ALL*_ services of
hosts with TAG "cst_regbas".
Can someone help to undestand where I am wrong?
Many thanks!
--
Think open live free!
HINC
_______________________________________________
checkmk-en mailing list
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
Andreas Döhler
2017-12-14 21:27:56 UTC
Permalink
It depends on the right assignment of your contact groups. If the contact
group is only assigned to the service object then only this service object
will notify the contact.
If the contactgroup is assigned to the host object all the services inherit
the contactgroup assignments.

There is no problem with the notification system.
One problem is that it is not possible inside RuleBasedNotification to
filter for contact groups with Nagios as core.
Help text from inside WATO for "Match Contact Groups"
"The host/service must be in one of the selected contact groups. This only
works with Check_MK Micro Core. If you don't use the CMC that filter will
not apply"

I think it is now clear why they get all the events from the host not only
the "Filesystem" one.

To solve this problem i would build a rule with the following setting.

Your hosttag selection + contact groups as receiver + regular expression
for your wanted services
That way is easier then assign groups to services - as it is not needed for
such a notification.

br
Andreas
Post by m3rlinux
Thanks for reply.
{'comment': u'', 'match_hosttags': ['cst_regbas'], 'allow_disable': True,
'description': u'mail GMED REGBAS', 'contact_object': False,
'contact_groups': ['GMED'], 'disabled': False, 'notify_plugin': (u'mail',
{'host_subject': u'GROUPS $HOSTGROUPNAMES$: SERVER $HOSTNAME$ -
$HOSTGROUPNAMES$: SERVER $HOSTNAME$/$SERVICEDESC$ $EVENT_TXT$'}),
'contact_all_with_email': False, 'match_contactgroups': ['GMED'],
'docu_url': '', 'contact_all': False, 'match_services': [u'*Filesystem*']}
Anyway I'd like if it should work by adding contactgroups for some
service_contactgroups = [
( 'GMED', ['/' + FOLDER_PATH + '/+'], ['Host01', 'Host02', 'Host03',
'Host04'], [u'Filesystem'], {'comment': u'service contact groups',
'description': u'Assign Service to Contact Group'} ),
] + service_contactgroups
I think there is a problem with notifications system, seems that it not
recognise contact group in services.
Think open live free!
HINC
Without knowing more details around your service -> contact group
configuration, a way to work around this would be to create a service group
with only the services that should go to GMED. (“GMED-Services”)Then in the
notification rule explicitly call out this service group and must have GMED
as a contact/ contact group.
Hi,
check_mk version is: 1.4.0p19
by rule I have added some services to contact group then I have created a
{'comment': u'', 'match_hosttags': ['cst_regbas'], 'description': u'mail
GMED REGBAS', 'contact_groups': ['GMED'], 'disabled': False,
'service_subject': u'GROUPS $HOSTGROUPNAMES$: SERVER
$HOSTNAME$/$SERVICEDESC$ $EVENT_TXT$'}), 'contact_all_with_email': False,
'contact_all': False, 'contact_object': False, 'allow_disable': True,
'match_contactgroups': ['GMED'], 'docu_url': ''}
The goal of this rule should be to sent notifications to contact group
"GMED" whom is defined only for some services of hosts with TAG
"cst_regbas".
The problem is that I receive notifications for *ALL* services of hosts
with TAG "cst_regbas".
Can someone help to undestand where I am wrong?
Many thanks!
--
Think open live free!
HINC
_______________________________________________
checkmk-en mailing list
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
_______________________________________________
checkmk-en mailing list
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
m3rlinux
2017-12-19 07:57:40 UTC
Permalink
Hi Andreas,
thanks for reply, at the end I had done like you sed, that is to put
Services in notifications.

Think open live free!
HINC
Post by Andreas Döhler
It depends on the right assignment of your contact groups. If the
contact group is only assigned to the service object then only this
service object will notify the contact.
If the contactgroup is assigned to the host object all the services
inherit the contactgroup assignments.
There is no problem with the notification system.
One problem is that it is not possible inside RuleBasedNotification to
filter for contact groups with Nagios as core. 
Help text from inside WATO for "Match Contact Groups"
"The host/service must be in one of the selected contact groups. This
only works with Check_MK Micro Core. If you don't use the CMC that
filter will not apply"
I think it is now clear why they get all the events from the host not
only the "Filesystem" one.
To solve this problem i would build a rule with the following setting.
Your hosttag selection + contact groups as receiver + regular
expression for your wanted services
That way is easier then assign groups to services - as it is not
needed for such a notification.
br
Andreas
Thanks for reply.
To solve this issue temporarily I added the services i
{'comment': u'', 'match_hosttags': ['cst_regbas'],
'allow_disable': True, 'description': u'mail GMED REGBAS',
False, 'notify_plugin': (u'mail', {'host_subject': u'GROUPS
u'GROUPS $HOSTGROUPNAMES$: SERVER $HOSTNAME$/$SERVICEDESC$
$EVENT_TXT$'}), 'contact_all_with_email': False,
False, 'match_services': [u'*Filesystem*']}
Anyway I'd like if it should work by adding contactgroups for some
service_contactgroups = [
  ( 'GMED', ['/' + FOLDER_PATH + '/+'], ['Host01', 'Host02',
'Host03', 'Host04'], [u'Filesystem'], {'comment': u'service
contact groups', 'description': u'Assign Service to Contact Group'} ),
] + service_contactgroups
I think there is a problem with notifications system, seems that
it not recognise contact group in services.
Think open live free!
HINC
Post by Paul
Without knowing more details around your service -> contact group
configuration, a way to work around this would be to create a
service group with only the services that should go to GMED.
(“GMED-Services”)Then in the notification rule explicitly call
out this service group and must have GMED as a contact/ contact
group.
Post by m3rlinux
Hi,
check_mk version is: 1.4.0p19
by rule I have added some services to contact group then I have
{'comment': u'', 'match_hosttags': ['cst_regbas'],
'description': u'mail GMED REGBAS', 'contact_groups': ['GMED'],
u'GROUPS $HOSTGROUPNAMES$: SERVER $HOSTNAME$ - $EVENT_TXT$',
u'GROUPS $HOSTGROUPNAMES$: SERVER $HOSTNAME$/$SERVICEDESC$
False, 'contact_object': False, 'allow_disable': True,
'match_contactgroups': ['GMED'], 'docu_url': ''}
The goal of this rule should be to sent notifications to contact
group "GMED" whom is defined only for some services of hosts
with TAG "cst_regbas".
The problem is that I receive notifications for _*ALL*_ services
of hosts with TAG "cst_regbas".
Can someone help to undestand where I am wrong?
Many thanks!
--
Think open live free!
HINC
_______________________________________________
checkmk-en mailing list
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
_______________________________________________
checkmk-en mailing list
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
Loading...