diff options
author | Julien Dessaux | 2017-08-24 13:15:56 +0000 |
---|---|---|
committer | Julien Dessaux | 2017-08-24 15:21:00 +0200 |
commit | cab089deb4dc10d4f9d784a22d5d0005288fcb61 (patch) | |
tree | 01a907deebf0becbf1b73f0a1f328397bf934fe6 /services/bareos_fd.cf | |
parent | Fixed check_mk policy misbehavior (diff) | |
download | masterfiles-cab089deb4dc10d4f9d784a22d5d0005288fcb61.tar.gz masterfiles-cab089deb4dc10d4f9d784a22d5d0005288fcb61.tar.bz2 masterfiles-cab089deb4dc10d4f9d784a22d5d0005288fcb61.zip |
Added bareos-fd policy
Diffstat (limited to '')
-rw-r--r-- | services/bareos_fd.cf | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/services/bareos_fd.cf b/services/bareos_fd.cf new file mode 100644 index 0000000..457655d --- /dev/null +++ b/services/bareos_fd.cf @@ -0,0 +1,34 @@ +bundle agent bareos_fd +{ + vars: + freebsd:: + "packages" slist => { + "bareos-client", + }; + "rc_conf_lines" slist => { + "bareos_fd_enable=\"YES\"", + "bareos_fd_config=\"/usr/local/etc/bareos/\"", + }; + !freebsd:: + "packages" slist => {}; + classes: + freebsd:: + "bareos_fd_service_running" expression => returnszero("/usr/sbin/service bareos-fd status", "noshell"); + files: + freebsd:: + "/usr/local/etc/bareos/bareos-fd.d/client/myself.conf" + edit_defaults => std_defs, + perms => system_owned("444"), + edit_line => replace_line_end("Name =", "$(sys.host)-fd"), + classes => if_repaired("bareos_client_file_repaired"); + commands: + freebsd.!bareos_fd_service_running:: + "/usr/sbin/service bareos-fd start" classes => if_repaired("bareos_fd_service_repaired"); + freebsd.bareos_client_file_repaired:: + "/usr/sbin/service bareos-fd restart" classes => if_repaired("bareos_fd_service_restarted"); + reports: + any:: + "$(this.bundle): /usr/local/etc/bareos/bareos-fd.d/client/myself.conf repaired" ifvarclass => "bareos_client_file_repaired"; + "$(this.bundle): bareos-fd service repaired" ifvarclass => "bareos_fd_service_repaired"; + "$(this.bundle): bareos-fd service restarted" ifvarclass => "bareos_fd_service_restarted"; +} |