ssahani / rpms / freeradius

Forked from rpms/freeradius 5 years ago
Clone
Blob Blame History Raw
From 039f85dfe9a09478c9581b87113e73e2205abd53 Mon Sep 17 00:00:00 2001
From: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
Date: Thu, 16 Oct 2014 13:59:51 +0300
Subject: [PATCH 3/4] raddb: Use appropriate module names in traps

Specify appropriate module names for all module traps in trigger.conf,
instead of using "ldap" for all.
---
 raddb/trigger.conf | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/raddb/trigger.conf b/raddb/trigger.conf
index b80089c..44f9f36 100644
--- a/raddb/trigger.conf
+++ b/raddb/trigger.conf
@@ -194,12 +194,15 @@ trigger {
 	#  "trigger" subsection in the module configuration.
 	modules {
 		# Common arguments
-		args = "radiusdModuleName s ldap radiusdModuleInstance s ''"
+		args = "radiusdModuleInstance s ''"
 
 		# The files module
 		files {
+			# Common arguments
+			args = "radiusdModuleName s files ${..args}"
+
 			# The module has been HUP'd via radmin
-			hup = "${snmptrap}::serverModuleHup ${..args}"
+			hup = "${snmptrap}::serverModuleHup ${args}"
 
 			# Note that "hup" can be used for every module
 			# which can be HUP'd via radmin
@@ -210,32 +213,38 @@ trigger {
 		# an LDAP connection ofr every "bind as user".  Be aware that
 		# this will likely produce a lot of triggers.
 		ldap {
+			# Common arguments
+			args = "radiusdModuleName s ldap ${..args}"
+
 			# A new connection to the DB has been opened
-			open = "${snmptrap}::serverModuleConnectionUp ${..args}"
+			open = "${snmptrap}::serverModuleConnectionUp ${args}"
 
 			# A connection to the DB has been closed
-			close = "${snmptrap}::serverModuleConnectionDown ${..args}"
+			close = "${snmptrap}::serverModuleConnectionDown ${args}"
 
 			# Failed to open a new connection to the DB
-			fail = "${snmptrap}::serverModuleConnectionFail ${..args}"
+			fail = "${snmptrap}::serverModuleConnectionFail ${args}"
 
 			# There are no DB handles available.
-			none = "${snmptrap}::serverModuleConnectionNone ${..args}"
+			none = "${snmptrap}::serverModuleConnectionNone ${args}"
 		}
 
 		# The SQL module
 		sql {
+			# Common arguments
+			args = "radiusdModuleName s sql ${..args}"
+
 			# A new connection to the DB has been opened
-			open = "${snmptrap}::serverModuleConnectionUp ${..args}"
+			open = "${snmptrap}::serverModuleConnectionUp ${args}"
 
 			# A connection to the DB has been closed
-			close = "${snmptrap}::serverModuleConnectionDown ${..args}"
+			close = "${snmptrap}::serverModuleConnectionDown ${args}"
 
 			# Failed to open a new connection to the DB
-			fail = "${snmptrap}::serverModuleConnectionFail ${..args}"
+			fail = "${snmptrap}::serverModuleConnectionFail ${args}"
 
 			# There are no DB handles available.
-			none = "${snmptrap}::serverModuleConnectionNone ${..args}"
+			none = "${snmptrap}::serverModuleConnectionNone ${args}"
 		}
 
 		# You can use the same opn / close / fail / none triggers for
-- 
2.1.1