]> granicus.if.org Git - icinga2/commitdiff
Create temporary files for PerfdataWriter in a separate directory.
authorGunnar Beutner <gunnar@beutner.name>
Thu, 21 Nov 2013 06:17:34 +0000 (07:17 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Thu, 21 Nov 2013 06:17:34 +0000 (07:17 +0100)
Fixes #5105

components/perfdata/CMakeLists.txt
components/perfdata/perfdatawriter.cpp
components/perfdata/perfdatawriter.ti
doc/4.3-object-types.md
icinga2.spec

index a5bf05b103c769adfbf695d8ff4bdabef55fd5e2..6f71a170073eaee2bb2171e7190aaa1fbe5bb1e1 100644 (file)
@@ -37,3 +37,4 @@ install(
 )
 
 install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/spool/icinga2/perfdata\")")
+install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/spool/icinga2/tmp\")")
index ea7323e0d22fa9a9c18ea60ee9c95810f561e56d..b2cf76a70f435d2cf60eb4b2159fc6876a4e59e9 100644 (file)
@@ -74,7 +74,7 @@ void PerfdataWriter::RotateFile(void)
 {
        ObjectLock olock(this);
 
-       String tempFile = GetPerfdataPath();
+       String tempFile = GetTempPath();
 
        if (m_OutputFile.good()) {
                m_OutputFile.close();
index bb7dcd7192c6ec20d1b049a80b1a2bc49cb04735..cea802274f6d739924121d3e82f68777358ee728 100644 (file)
@@ -9,6 +9,9 @@ class PerfdataWriter : DynamicObject
        [config] String perfdata_path {
                default {{{ return Application::GetLocalStateDir() + "/spool/icinga2/perfdata/perfdata"; }}}
        };
+       [config] String temp_path {
+               default {{{ return Application::GetLocalStateDir() + "/spool/icinga2/tmp/perfdata"; }}}
+       };
        [config] String format_template {
                default {{{
                        return "DATATYPE::SERVICEPERFDATA\t"
index 1e03e9076097b4e99a0528ab6ab247afbe70efe1..e980de29acd92a397da8178a202eba4ca3ce502e 100644 (file)
@@ -473,6 +473,7 @@ Attributes:
   Name            |Description
   ----------------|----------------
   perfdata\_path  |**Optional.** Path to the service performance data file. Defaults to IcingaLocalStateDir + "/spool/icinga2/perfdata/perfdata".
+  temp\_path      |**Optional.** Path to the temporary file. Defaults to IcingaLocalStateDir + "/spool/icinga2/tmp/perfdata".
   format\_template|**Optional.** Format template for the performance data file. Defaults to a template that's suitable for use with PNP4Nagios.
   rotation\_interval|**Optional.** Rotation interval for the file specified in `perfdata\_path`. Defaults to 30 seconds.
 
index 14e113e7202768e34313f0890420ab7831677dac..b773a904642e0ff7fee97ea1c04cc7ae933d33e4 100644 (file)
@@ -332,6 +332,7 @@ fi
 %doc COPYING COPYING.Exceptions README NEWS AUTHORS ChangeLog
 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}
 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/perfdata
+%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_localstatedir}/spool/%{name}/tmp
 %attr(0750,%{icinga_user},%{icinga_group}) %dir %{_datadir}/%{name}/itl
 %{_datadir}/%{name}/itl