summaryrefslogtreecommitdiff
path: root/services/applications/check_mk.cf
blob: 8a1ce82d3a03351e4d2eca3e41891bc3d0643317 (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
35
36
37
38
39
40
41
42
43
bundle agent check_mk
{
    vars:
        freebsd::
            "rc_conf_lines" slist => {
                "inetd_enable=\"YES\"",
                "inetd_flags=\"-wW\"",
            };
    files:
        freebsd::
            "/etc/services"
                edit_defaults => std_defs,
                perms => system_owned("444"),
                edit_line => append_if_no_line("check_mk_agent  6556/tcp"),
                classes => if_repaired("check_mk_services_file_repaired");
            "/etc/inetd.conf"
                edit_defaults => std_defs,
                perms => system_owned("444"),
                edit_line => append_if_no_line("check_mk_agent  stream  tcp nowait  root  /usr/local/bin/check_mk_agent check_mk_agent"),
                classes => if_repaired("check_mk_inetd_conf_file_repaired");
            "/usr/local/bin/check_mk_agent"
                perms => system_owned("555"),
                copy_from => local_cp("$(sys.inputdir)/templates/check_mk/check_mk_agent.freebsd"),
                classes => if_repaired("check_mk_agent_repaired");
    classes:
        freebsd::
            "inetd_service_running" expression => returnszero("/usr/sbin/service inetd status", "noshell");
    methods:
        freebsd::
            "freebsd"  usebundle => add_rc_conf_line("$(this.bundle)", "$(check_mk.rc_conf_lines)");
    commands:
        freebsd.!inetd_service_running::
            "/usr/sbin/service inetd start" classes => if_repaired("inet_service_repaired");
        freebsd.check_mk_inetd_conf_file_repaired::
            "/usr/sbin/service inetd restart" classes => if_repaired("inetd_service_restarted");
    reports:
        any::
            "$(this.bundle): /etc/services repaired" ifvarclass => "check_mk_services_file_repaired";
            "$(this.bundle): /etc/inetd.conf repaired" ifvarclass => "check_mk_inetd_conf_file_repaired";
            "$(this.bundle): /usr/local/bin/check_mk_agent repaired" ifvarclass => "check_mk_agent_repaired";
            "$(this.bundle): inetd service repaired" ifvarclass => "inetd_service_repaired";
            "$(this.bundle): inetd service restarted" ifvarclass => "inetd_service_restarted";
}