class profile::monitoring::services { Nagios_service { ensure => "present", owner => "naemon", group => "naemon", notify => Service["naemon"], before => Service["naemon"], require => File["/etc/naemon"], } sudo::conf { default: sudo_file_name => "naemon"; 'naemon-fail2ban': content => "naemon ALL=(root) NOPASSWD: /usr/bin/fail2ban-client ping"; } profile::monitoring::local_service { "Size on root partition": local => { check_command => "check_local_disk!20%!10%!/", }; "Total number of process": local => { check_command => "check_local_procs!50!100!RSZDT", }; "Average load": local => { check_command => "check_local_load!8.0,8.0,8.0!10.0,10.0,10.0", }; "Swap usage": local => { check_command => "check_local_swap!20!10", }; "fail2ban is active": local => { check_command => "check_command_output!fail2ban-client ping!pong!-r root", require => Sudo::Conf["naemon-fail2ban"], }; "NTP is activated and working": local => { check_command => "check_ntp", }; "No mdadm array is degraded": common => { ensure => (find_file("/proc/mdstat") == undef) ? { true => "absent", default =>"present" }, }, local => { check_command => "check_md_raid", }; } }