summaryrefslogtreecommitdiff
path: root/services/applications/nrpe.cf
blob: c5ed6f843f87c41ac83d6030310e4f4d92dcfcbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
bundle agent nrpe
{
    vars:
        freebsd.nrpe::
            "packages" slist => {
                "nrpe",
                "nagios-plugins",
            };
    methods:
        freebsd.nrpe::
            "nrpe"  usebundle => install_package("$(this.bundle)", "$(nrpe.packages)");
            "nrpe"  usebundle => add_rc_conf_line("$(this.bundle)", "nrpe2_enable=\"YES\"");
    files:
        freebsd.nrpe::
            "/usr/local/etc/nrpe.cfg"
                create => "true",
                edit_defaults => empty,
                perms => system_owned("444"),
                copy_from => local_dcp("$(sys.inputdir)/templates/nrpe/nrpe.cfg"),
                classes => if_repaired("nrpe_nrpe_cfg_file_repaired");
    classes:
        freebsd.nrpe::
            "nrpe2_service_running" expression => returnszero("/usr/sbin/service nrpe2 status", "noshell");
    commands:
        freebsd.nrpe.!nrpe2_service_running::
            "/usr/sbin/service nrpe2 start" classes => if_repaired("nrpe2_service_repaired");
        freebsd.nrpe.nrpe_nrpe_cfg_file_repaired::
            "/usr/sbin/service nrpe2 restart" classes => if_repaired("nrpe2_service_restarted");
    reports:
        any::
            "$(this.bundle): /usr/local/etc/nrpe.cfg file repaired" ifvarclass => "nrpe_nrpe_cfg_file_repaired";
            "$(this.bundle): nrpe2 service repaired" ifvarclass => "nrpe2_service_repaired";
            "$(this.bundle): nrpe2 service restarted" ifvarclass => "nrpe2_service_restarted";
}