|
| 1 | +# Class: lysaker_sensu::checks::base |
| 2 | +#================================== |
| 3 | +# |
| 4 | +class monitoring::monitoring::sensu::base ( |
| 5 | + $plugins_location = $::monitoring::sensu_plugins_location, |
| 6 | + $disk_usage_magic_factor = $::monitoring::sensu_disk_usage_magic_factor,) { |
| 7 | + package { [ |
| 8 | + 'sensu-plugins-cpu-checks', |
| 9 | + 'sensu-plugins-memory-checks', |
| 10 | + 'sensu-plugins-disk-checks', |
| 11 | + 'sensu-plugins-load-checks', |
| 12 | + 'sensu-plugins-filesystem-checks', |
| 13 | + 'sensu-plugins-process-checks', |
| 14 | + 'sensu-plugins-network-checks', |
| 15 | + ]: |
| 16 | + provider => sensu_gem, |
| 17 | + } |
| 18 | + |
| 19 | + sensu::check { 'memory': command => "${plugins_location}check-memory.rb", } |
| 20 | + |
| 21 | + sensu::check { 'memory-percent': command => "${plugins_location}check-memory-percent.rb -w 85 -c 95", } |
| 22 | + |
| 23 | + sensu::check { 'swap-percent': command => "${plugins_location}check-swap-percent.rb", } |
| 24 | + |
| 25 | + $ignore_fs_types = 'nfs,nfs4,cifs,devtmpfs,tmpfs,aufs,proc' |
| 26 | + $ignore_mnt = '"^/run/|^/sys/|^/var/lib/docker/|^/snap/"' |
| 27 | + |
| 28 | + sensu::check { 'disk-usage': |
| 29 | + command => "${plugins_location}check-disk-usage.rb -x ${ignore_fs_types} -p ${ignore_mnt} -m ${disk_usage_magic_factor}", |
| 30 | + } |
| 31 | + |
| 32 | + sensu::check { 'load': command => "${plugins_location}check-load.rb --per-core --warn 4,8,12 --crit 8,12,16", } |
| 33 | + |
| 34 | + sensu::check { 'root-fs-writable': command => "${plugins_location}check-fs-writable.rb --directory /etc/sensu/", } |
| 35 | + |
| 36 | + sensu::check { 'process-zombie-state': |
| 37 | + command => "${plugins_location}check-process.rb --state Z --warn-over 20 --critical-over 40 --warn-under 0 --critical-under 0", |
| 38 | + } |
| 39 | + |
| 40 | +} |
0 commit comments