X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=inline;f=modules%2Fprofile%2Fmanifests%2Fmonitoring%2Fcommands.pp;h=1c8d0b46997a53edd05bd39fda1b49a57c8c1750;hb=0cdf494080b285e81b531a38dbbac7f7d8e9c990;hp=a25f7b3e6af655e42da1523e7c1252a53c9ee2ab;hpb=6962463657db999c33f1aabe60e0567be218918d;p=perso%2FImmae%2FProjets%2FPuppet.git diff --git a/modules/profile/manifests/monitoring/commands.pp b/modules/profile/manifests/monitoring/commands.pp index a25f7b3..1c8d0b4 100644 --- a/modules/profile/manifests/monitoring/commands.pp +++ b/modules/profile/manifests/monitoring/commands.pp @@ -1,34 +1,33 @@ class profile::monitoring::commands inherits profile::monitoring { ensure_packages(["monitoring-plugins"]) - file { "/etc/naemon/monitoring-plugins": + file { $plugins: ensure => "directory", - owner => "naemon", - group => "naemon", - mode => "0700", - } - - file { "/etc/naemon/monitoring-plugins/check_command": - ensure => "present", - owner => "naemon", + owner => "root", group => "naemon", - mode => "0700", - source => "puppet:///modules/profile/monitoring/check_command", + mode => "0755", } - file { "/etc/naemon/monitoring-plugins/check_md_raid": - ensure => "present", - owner => "naemon", - group => "naemon", - mode => "0700", - source => "puppet:///modules/profile/monitoring/check_md_raid", + [ + "check_command", + "check_md_raid", + "check_postgres_replication", + "check_last_file_date", + ].each |$file| { + file { "$plugins/$file": + ensure => "present", + owner => "root", + group => "naemon", + mode => "0755", + source => "puppet:///modules/profile/monitoring/$file", + } } Nagios_command { ensure => "present", owner => "naemon", group => "naemon", - target => "/etc/naemon/objects.cfg", + target => $objects, notify => Service["naemon"], before => Service["naemon"], require => File["/etc/naemon"], @@ -48,10 +47,17 @@ class profile::monitoring::commands inherits profile::monitoring { "check_ntp": command_line => '$USER1$/check_ntp_time -H 0.arch.pool.ntp.org'; "check_md_raid": - command_line => '$USER2$/check_md_raid'; + command_line => '$USER2$/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["$plugins/check_postgres_replication"]; + "check_last_file_date": + command_line => '$USER2$/check_last_file_date "$ARG1$" "$ARG2$" "$ARG3$"', + require => File["$plugins/check_last_file_date"], } unless empty($naemon_url) {