46 lines
1.5 KiB
Python
46 lines
1.5 KiB
Python
|
#!/usr/bin/env python3
|
||
|
# -*- coding: utf-8 -*-
|
||
|
|
||
|
# SPDX-FileCopyrightText: 2021 Stefan Gehn <stefan+cmk@srcbox.net>
|
||
|
# SPDX-FileCopyrightText: 2023 Mark-Tim Junghanns <mark@markjunghanns.de>
|
||
|
# SPDX-FileCopyrightText: 2024 DeltaLima (Marcus Hanisch) <dontsendmespam@deltalima.org>
|
||
|
#
|
||
|
# SPDX-License-Identifier: GPL-2.0-only
|
||
|
|
||
|
from cmk.gui.valuespec import Dictionary, TextAscii
|
||
|
from cmk.gui.plugins.wato import notification_parameter_registry, NotificationParameter
|
||
|
|
||
|
|
||
|
@notification_parameter_registry.register
|
||
|
class NotificationParameterRocketchat(NotificationParameter):
|
||
|
@property
|
||
|
def ident(self):
|
||
|
return "rocketchat"
|
||
|
|
||
|
@property
|
||
|
def spec(self):
|
||
|
return Dictionary(
|
||
|
title=_("Create notification with the following parameters"),
|
||
|
required_keys=["webhook_url", "rc_customtext"],
|
||
|
elements=[
|
||
|
(
|
||
|
"webhook_url",
|
||
|
TextAscii(
|
||
|
title=_("Webhook URL"),
|
||
|
help=_("Webhook URL des Monitoring Users"),
|
||
|
size=146,
|
||
|
allow_empty=False,
|
||
|
),
|
||
|
),
|
||
|
(
|
||
|
"rc_customtext",
|
||
|
TextAscii(
|
||
|
title=_("Custom text (e.g. for mention @someone)"),
|
||
|
help=_("Custom text to include to the notification message, like mention @someone"),
|
||
|
size=146,
|
||
|
allow_empty=True,
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
)
|