From 0363f38e186b8c942a6db2de4974befbc373f618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Wed, 11 Jul 2018 07:45:22 +0200 Subject: Refactor a bit monitoring profile --- modules/profile/manifests/monitoring/commands.pp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'modules/profile/manifests/monitoring/commands.pp') diff --git a/modules/profile/manifests/monitoring/commands.pp b/modules/profile/manifests/monitoring/commands.pp index 4ccc816..1c8d0b4 100644 --- a/modules/profile/manifests/monitoring/commands.pp +++ b/modules/profile/manifests/monitoring/commands.pp @@ -1,7 +1,7 @@ class profile::monitoring::commands inherits profile::monitoring { ensure_packages(["monitoring-plugins"]) - file { "/etc/naemon/monitoring-plugins": + file { $plugins: ensure => "directory", owner => "root", group => "naemon", @@ -14,7 +14,7 @@ class profile::monitoring::commands inherits profile::monitoring { "check_postgres_replication", "check_last_file_date", ].each |$file| { - file { "/etc/naemon/monitoring-plugins/$file": + file { "$plugins/$file": ensure => "present", owner => "root", group => "naemon", @@ -27,7 +27,7 @@ class profile::monitoring::commands inherits profile::monitoring { ensure => "present", owner => "naemon", group => "naemon", - target => "/etc/naemon/objects.cfg", + target => $objects, notify => Service["naemon"], before => Service["naemon"], require => File["/etc/naemon"], @@ -48,16 +48,16 @@ class profile::monitoring::commands inherits profile::monitoring { command_line => '$USER1$/check_ntp_time -H 0.arch.pool.ntp.org'; "check_md_raid": command_line => '$USER2$/check_md_raid', - require => File["/etc/naemon/monitoring-plugins/check_md_raid"]; + require => File["$plugins/check_md_raid"]; "check_command_output": command_line => '$USER2$/check_command -c "$ARG1$" -o "$ARG2$" $ARG3$', - require => File["/etc/naemon/monitoring-plugins/check_command"]; + require => File["$plugins/check_command"]; "check_postgresql_replication": command_line => '/usr/bin/sudo -u postgres $USER2$/check_postgres_replication "$ARG1$" "$ARG2$" "$ARG3$"', - require => File["/etc/naemon/monitoring-plugins/check_postgres_replication"]; + require => File["$plugins/check_postgres_replication"]; "check_last_file_date": command_line => '$USER2$/check_last_file_date "$ARG1$" "$ARG2$" "$ARG3$"', - require => File["/etc/naemon/monitoring-plugins/check_last_file_date"], + require => File["$plugins/check_last_file_date"], } unless empty($naemon_url) { -- cgit v1.2.3