[Pkg-nagios-changes] [SCM] UNNAMED PROJECT branch, debian/master, updated. 810edbdd3feedbfe37f4a65bee50b57b2f60fa2a
Naparuba
naparuba at gmail.com
Tue Feb 28 22:16:40 UTC 2012
The following commit has been merged in the debian/master branch:
commit 4724a3d242213a5db60e0ef5d3e5ab6f93b48665
Author: Naparuba <naparuba at gmail.com>
Date: Fri Jan 27 16:44:29 2012 +0100
Fix : issue #86
diff --git a/shinken/modules/host_perfdata_broker/host_perfdata_broker.py b/shinken/modules/host_perfdata_broker/host_perfdata_broker.py
index 815f649..892a2a6 100644
--- a/shinken/modules/host_perfdata_broker/host_perfdata_broker.py
+++ b/shinken/modules/host_perfdata_broker/host_perfdata_broker.py
@@ -41,6 +41,10 @@ class Host_perfdata_broker(BaseModule):
self.template = self.template.replace(r'\t', '\t')
self.template = self.template.replace(r'\n', '\n')
+ # In Nagios it's said to force a return in line
+ if not self.template.endswith('\n'):
+ self.template += '\n'
+
#Called by Broker so we can do init stuff
#TODO : add conf param to get pass with init
@@ -72,6 +76,7 @@ class Host_perfdata_broker(BaseModule):
'$HOSTOUTPUT$' : data['output'],
'$HOSTSTATE$' : current_state,
'$HOSTPERFDATA$' : data['perf_data'],
+ '$LASTHOSTSTATE$' : data['last_state'],
}
s = self.template
for m in macros:
diff --git a/shinken/modules/service_perfdata_broker/service_perfdata_broker.py b/shinken/modules/service_perfdata_broker/service_perfdata_broker.py
index 03e8b11..e28b84f 100644
--- a/shinken/modules/service_perfdata_broker/service_perfdata_broker.py
+++ b/shinken/modules/service_perfdata_broker/service_perfdata_broker.py
@@ -38,10 +38,14 @@ class Service_perfdata_broker(BaseModule):
self.mode = mode
self.template = template
- #Make some raw change
+ # Make some raw change
self.template = self.template.replace(r'\t', '\t')
self.template = self.template.replace(r'\n', '\n')
+ # In Nagios it's said to force a return in line
+ if not self.template.endswith('\n'):
+ self.template += '\n'
+
self.buffer = []
@@ -77,7 +81,7 @@ class Service_perfdata_broker(BaseModule):
'$SERVICEOUTPUT$' : data['output'],
'$SERVICESTATE$' : current_state,
'$SERVICEPERFDATA$' : data['perf_data'],
- '$LASTSERVICESTATE$' : data['last_state']
+ '$LASTSERVICESTATE$' : data['last_state'],
}
s = self.template
for m in macros:
--
UNNAMED PROJECT
More information about the Pkg-nagios-changes
mailing list