icinga2/lib/perfdata/perfdatawriter.ti
Yonas Habteab 91c7e60df8 Replace all existing copyright headers with SPDX headers
I've used the following command to replace the original copyright header
lines in a C-style comment block:

```
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f -exec perl -pi -e 's{/\*[^*]*\(\s*c\s*\)\s*(\d{4})\s*Icinga\s+GmbH[^*]*\*/}{// SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n// SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
```

For files that use shell-style comments (#) like CMakeLists.txt, I've
used this command:

```
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f -exec perl -pi -e 's{#.*\(\s*c\s*\)\s(\d{4})\sIcinga\s+GmbH.*}{# SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n# SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
```

And for SQL files:

```
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f \( -name '*.sql' \) -exec perl -pi -e 's{--.*\(c\)\s(\d{4})\sIcinga\sGmbH.*}{-- SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n-- SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f \( -name '*.sql' \) -exec perl -pi -e 's{-- Copyright \(c\)\s(\d{4})\sIcinga\s+Development\sTeam.*}{-- SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n-- SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
```
2026-02-04 14:00:05 +01:00

62 lines
1.6 KiB
Text

// SPDX-FileCopyrightText: 2012 Icinga GmbH <https://icinga.com>
// SPDX-License-Identifier: GPL-2.0-or-later
#include "base/configobject.hpp"
#include "base/application.hpp"
library perfdata;
namespace icinga
{
class PerfdataWriter : ConfigObject
{
activation_priority 100;
[config] String host_perfdata_path {
default {{{ return Configuration::SpoolDir + "/perfdata/host-perfdata"; }}}
};
[config] String service_perfdata_path {
default {{{ return Configuration::SpoolDir + "/perfdata/service-perfdata"; }}}
};
[config] String host_temp_path {
default {{{ return Configuration::SpoolDir + "/tmp/host-perfdata"; }}}
};
[config] String service_temp_path {
default {{{ return Configuration::SpoolDir + "/tmp/service-perfdata"; }}}
};
[config] String host_format_template {
default {{{
return "DATATYPE::HOSTPERFDATA\t"
"TIMET::$host.last_check$\t"
"HOSTNAME::$host.name$\t"
"HOSTPERFDATA::$host.perfdata$\t"
"HOSTCHECKCOMMAND::$host.check_command$\t"
"HOSTSTATE::$host.state$\t"
"HOSTSTATETYPE::$host.state_type$";
}}}
};
[config] String service_format_template {
default {{{
return "DATATYPE::SERVICEPERFDATA\t"
"TIMET::$service.last_check$\t"
"HOSTNAME::$host.name$\t"
"SERVICEDESC::$service.name$\t"
"SERVICEPERFDATA::$service.perfdata$\t"
"SERVICECHECKCOMMAND::$service.check_command$\t"
"HOSTSTATE::$host.state$\t"
"HOSTSTATETYPE::$host.state_type$\t"
"SERVICESTATE::$service.state$\t"
"SERVICESTATETYPE::$service.state_type$";
}}}
};
[config] double rotation_interval {
default {{{ return 30; }}}
};
[config] bool enable_ha {
default {{{ return false; }}}
};
};
}