[-]
[+]
|
Changed |
nagios-plugins-plesk.changes
|
|
[-]
[+]
|
Changed |
nagios-plugins-plesk.spec
^
|
|
[-]
[+]
|
Added |
check_stale_lock2
^
|
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+CNT=0
+if [ -z "$@" ] ; then
+ echo "ERROR: no lock files specified"
+ exit 2
+fi
+for ITEM in $@ ; do
+
+ if [ -z "`echo ${ITEM} | grep :`" ] ; then
+ echo "ERROR: invalid parameter, specify /path/to/lock:<time-in-minutes>"
+ echo "seperate multiple parameters with spaces"
+ exit 2
+ else
+ LOCK="`echo ${ITEM} | awk -F: '{print $1}'`"
+ MAXLOCKTIME="`echo ${ITEM} | awk -F: '{print $2}'`"
+ LOCKDIR="`dirname ${LOCK}`"
+ LOCKNAME="`basename ${LOCK}`"
+ fi
+ for ITEM in `find ${LOCKDIR} -maxdepth 1 -type f -name ${LOCKNAME} -cmin +${MAXLOCKTIME}` ; do
+ CNT=`expr ${CNT} + 1`
+ STALELOCKS="${STALELOCKS} ${LOCKDIR}/`basename ${ITEM}`"
+ done
+done
+if [ "${CNT}" -gt 0 ] ; then
+ echo "ERROR: ${STALELOCKS}"
+ exit 2
+else
+ echo "OK"
+ exit 0
+fi
|
[-]
[+]
|
Added |
lock.cfg
^
|
@@ -0,0 +1,2 @@
+# check for automysqlbackup lock, wait 1080 minutes (18 hours) before alert
+command[check_stale_lock]=/usr/lib/nagios/plugins/check_stale_lock2 /var/lock/localhost.lock:1080
|