#cmakedefine HAVE_VFORK
#define ICINGA_PREFIX "${CMAKE_INSTALL_PREFIX}"
+#define ICINGA_SYSCONFDIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}"
#define ICINGA_LOCALSTATEDIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}"
#define ICINGA_PKGDATADIR "${CMAKE_INSTALL_FULL_DATADIR}/icinga2"
-## <a id="global-variables"> Global Variables
+## <a id="global-variables"></a> Global Variables
Icinga 2 provides a number of special global variables:
Variable |Description
--------------------------|-------------------
IcingaPrefixDir |**Read-only.** Contains the installation prefix that was specified with cmake -DCMAKE_INSTALL_PREFIX. Defaults to /usr/local
+IcingaSysconfDir |**Read-only.** Contains the path of the sysconf directory. Defaults to IcingaPrefixDir + "/etc".
IcingaLocalStateDir |**Read-only.** Contains the path of the local state directory. Defaults to IcingaPrefixDir + "/var".
IcingaPkgDataDir |**Read-only.** Contains the path of the package data directory. Defaults to IcingaPrefixDir + "/share/icinga2".
IcingaStatePath |**Read-write.** Contains the path of the Icinga 2 state file. Defaults to IcingaLocalStateDir + "/lib/icinga2/icinga2.state".
Application::InstallExceptionHandlers();
Application::DeclarePrefixDir(ICINGA_PREFIX);
+ Application::DeclareSysconfDir(ICINGA_SYSCONFDIR);
Application::DeclareLocalStateDir(ICINGA_LOCALSTATEDIR);
Application::DeclarePkgDataDir(ICINGA_PKGDATADIR);
ScriptVariable::Declare("IcingaPrefixDir", path);
}
+/**
+ * Retrives the path of the sysconf dir.
+ *
+ * @returns The path.
+ */
+String Application::GetSysconfDir(void)
+{
+ return ScriptVariable::Get("IcingaSysconfDir");
+}
+
+/**
+ * Sets the path of the sysconf dir.
+ *
+ * @param path The new path.
+ */
+void Application::DeclareSysconfDir(const String& path)
+{
+ ScriptVariable::Declare("IcingaSysconfDir", path);
+}
+
/**
* Retrieves the path for the local state dir.
*
static String GetPrefixDir(void);
static void DeclarePrefixDir(const String& path);
+ static String GetSysconfDir(void);
+ static void DeclareSysconfDir(const String& path);
+
static String GetLocalStateDir(void);
static void DeclareLocalStateDir(const String& path);