Re: Another patch that makes nagios send the messages with fedora-messaging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It helps when patches are attached ;-(


Am 09.11.19 um 01:43 schrieb Karsten Hopp:
Hi all,
Now that https://pagure.io/releng/pull-request/8940 got merged we can migrate nagios  from fedmsg to fedora-messaging.

The attached patches are for switching nagios to fedora-messaging, please review and merge if they look sane to you.


Thanks, Karsten

>From 61a8a48da9d223fdba703d9d58b94447e1a6b155 Mon Sep 17 00:00:00 2001
From: Karsten Hopp <karsten@xxxxxxxxxx>
Date: Tue, 29 Oct 2019 14:29:24 +0100
Subject: [PATCH 1/2] use fedora-messaging for nagios

Signed-off-by: Karsten Hopp <karsten@xxxxxxxxxx>
---
 roles/nagios_server/files/nagios/commands/notify.cfg | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/roles/nagios_server/files/nagios/commands/notify.cfg b/roles/nagios_server/files/nagios/commands/notify.cfg
index 0d07087d2..4700059e7 100644
--- a/roles/nagios_server/files/nagios/commands/notify.cfg
+++ b/roles/nagios_server/files/nagios/commands/notify.cfg
@@ -58,6 +58,18 @@ define command{
     command_line    /usr/bin/echo '{"type": "$NOTIFICATIONTYPE$", "host": "$HOSTNAME$", "state": "$SERVICESTATE$", "service": "$SERVICEDESC$", "output": "$SERVICEOUTPUT$", "host_ack_author": "$HOSTACKAUTHOR$", "service_ack_author": "$SERVICEACKAUTHOR$"}' | fedmsg-logger --cert-prefix nagios --modname nagios --topic service.state.change --json-input
 	}
 
+# 'host-notify-by-fedora-messaging' command definition
+define command{
+	command_name	host-notify-by-fedora-messaging
+    command_line    /usr/bin/echo '{"type": "$NOTIFICATIONTYPE$", "host": "$HOSTNAME$", "state": "$HOSTSTATE$", "output": "$HOSTOUTPUT$", "host_ack_author": "$HOSTACKAUTHOR$", "service_ack_author": "$SERVICEACKAUTHOR$"}' | fedora-messaging-logger --cert-prefix nagios --modname nagios --topic host.state.change --json-input
+	}
+
+# 'notify-by-fedora-messaging' command definition
+define command{
+	command_name	notify-by-fedora-messaging
+    command_line    /usr/bin/echo '{"type": "$NOTIFICATIONTYPE$", "host": "$HOSTNAME$", "state": "$SERVICESTATE$", "service": "$SERVICEDESC$", "output": "$SERVICEOUTPUT$", "host_ack_author": "$HOSTACKAUTHOR$", "service_ack_author": "$SERVICEACKAUTHOR$"}' | fedora-messaging-logger --cert-prefix nagios --modname nagios --topic service.state.change --json-input
+	}
+
 # 'notify-by-xmpp' command definition
 #define command{
 #	command_name	notify-by-xmpp
-- 
2.21.0

>From f5d333b8d9bca0cd7d9da3b5b76879e133f39342 Mon Sep 17 00:00:00 2001
From: Karsten Hopp <karsten@xxxxxxxxxx>
Date: Tue, 5 Nov 2019 13:53:20 +0100
Subject: [PATCH 2/2] more nagios changes

Signed-off-by: Karsten Hopp <karsten@xxxxxxxxxx>
---
 .../nagios/contacts/{fedmsg.cfg => fedora-messaging.cfg}      | 4 ++--
 roles/nagios_server/tasks/main.yml                            | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
 rename roles/nagios_server/files/nagios/contacts/{fedmsg.cfg => fedora-messaging.cfg} (64%)

diff --git a/roles/nagios_server/files/nagios/contacts/fedmsg.cfg b/roles/nagios_server/files/nagios/contacts/fedora-messaging.cfg
similarity index 64%
rename from roles/nagios_server/files/nagios/contacts/fedmsg.cfg
rename to roles/nagios_server/files/nagios/contacts/fedora-messaging.cfg
index cd577aa69..069fdfa9e 100644
--- a/roles/nagios_server/files/nagios/contacts/fedmsg.cfg
+++ b/roles/nagios_server/files/nagios/contacts/fedora-messaging.cfg
@@ -5,6 +5,6 @@ define contact{
     host_notification_period        24x7
     service_notification_options    w,u,c,r
     host_notification_options       d,u,r
-    service_notification_commands   notify-by-fedmsg
-    host_notification_commands      host-notify-by-fedmsg
+    service_notification_commands   notify-by-fedora-messaging
+    host_notification_commands      host-notify-by-fedora-messaging
 }
diff --git a/roles/nagios_server/tasks/main.yml b/roles/nagios_server/tasks/main.yml
index 13de18b0c..7c9aa42ef 100644
--- a/roles/nagios_server/tasks/main.yml
+++ b/roles/nagios_server/tasks/main.yml
@@ -191,7 +191,7 @@
     - db_backups.cfg
     - disk.cfg
     - dns.cfg
-    - fedmsg.cfg
+    - fedora-messaging.cfg
     - file_age.cfg
     - fmn.cfg
     - haproxy.cfg
-- 
2.21.0

_______________________________________________
infrastructure mailing list -- infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to infrastructure-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/infrastructure@xxxxxxxxxxxxxxxxxxxxxxx

[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux