diff options
author | varac <varacanero@zeromail.org> | 2014-02-28 21:53:12 +0100 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2014-03-03 17:36:39 +0100 |
commit | c7af5055fd9f255357a8dcd6e318c7a15a3b709c (patch) | |
tree | 5f46e6c31c80fb6f0a35264111fd1f22fd0f5265 /puppet/modules/site_check_mk | |
parent | f802fcdc7396d8a3b804be6480adb8611638f2c0 (diff) |
check leap_mx queue
Diffstat (limited to 'puppet/modules/site_check_mk')
-rwxr-xr-x | puppet/modules/site_check_mk/files/agent/local_checks/mx/check_leap_mx.sh | 33 | ||||
-rw-r--r-- | puppet/modules/site_check_mk/manifests/agent/mx.pp | 8 |
2 files changed, 41 insertions, 0 deletions
diff --git a/puppet/modules/site_check_mk/files/agent/local_checks/mx/check_leap_mx.sh b/puppet/modules/site_check_mk/files/agent/local_checks/mx/check_leap_mx.sh new file mode 100755 index 00000000..2958d2ed --- /dev/null +++ b/puppet/modules/site_check_mk/files/agent/local_checks/mx/check_leap_mx.sh @@ -0,0 +1,33 @@ +#!/bin/bash + + +WARN=1 +CRIT=5 + +# in minutes +MAXAGE=10 + +STATUS[0]='OK' +STATUS[1]='Warning' +STATUS[2]='Critical' +CHECKNAME='Leap_MX_Queue' + +WATCHDIR='/var/mail/vmail/Maildir/new/' + + +total=`find $WATCHDIR -type f -mmin +$MAXAGE | wc -l` + +if [ $total -lt $WARN ] +then + exitcode=0 +else + if [ $total -le $CRIT ] + then + exitcode=1 + else + exitcode=2 + fi +fi + +echo "$exitcode $CHECKNAME stale_files=$total ${STATUS[exitcode]}: $total stale files (>=$MAXAGE min) in $WATCHDIR." + diff --git a/puppet/modules/site_check_mk/manifests/agent/mx.pp b/puppet/modules/site_check_mk/manifests/agent/mx.pp new file mode 100644 index 00000000..c4d3ea13 --- /dev/null +++ b/puppet/modules/site_check_mk/manifests/agent/mx.pp @@ -0,0 +1,8 @@ +class site_check_mk::agent::mx { + + file { '/usr/lib/check_mk_agent/local/check_leap_mx.sh': + source => 'puppet:///modules/site_check_mk/agent/local_checks/mx/check_leap_mx.sh', + mode => '0755' + } + +} |