Changes of Revision 7
[-] | Changed | nagios-plugins-plesk.changes |
1
2 ------------------------------------------------------------------- 3 +Wed Dec 2 17:39:33 UTC 2015 - cs@linux-administrator.com 4 + 5 +- added check_stale_lock2 plugin and definition in lock.cfg 6 + 7 +------------------------------------------------------------------- 8 Fri Aug 2 18:41:15 UTC 2013 - cs@linux-administrator.com 9 10 - added check_qmail_queue definition to config 11 |
||
[-] | Changed | nagios-plugins-plesk.spec ^ |
38 1
2 Name: nagios-plugins-plesk 3 -Version: 0.2 4 +Version: 0.3 5 Release: 1 6 Url: http://www.linux-administrator.com 7 Group: System/Monitoring 8 Summary: Plugins and aliases for plesk servers. 9 License: GPL 10 Source0: check_mysql_plesk 11 +Source1: check_stale_lock2 12 Source10: plesk.cfg 13 +Source11: lock.cfg 14 BuildArch: noarch 15 BuildRoot: %{_tmppath}/%{name}-%{version}-root 16 AutoReqProv: off 17
18 %__install -d %{buildroot}%{_prefix}/lib/nagios/plugins 19 %__install -d %{buildroot}%{_sysconfdir}/nagios/nrpe.d 20 %__install -m755 %{S:0} %{buildroot}%{_prefix}/lib/nagios/plugins/check_mysql_plesk 21 +%__install -m755 %{S:1} %{buildroot}%{_prefix}/lib/nagios/plugins/check_stale_lock2 22 %__install -m644 %{S:10} %{buildroot}%{_sysconfdir}/nagios/nrpe.d/plesk.cfg 23 +%__install -m644 %{S:11} %{buildroot}%{_sysconfdir}/nagios/nrpe.d/lock.cfg 24 25 %clean 26 rm -rf %{buldroot} 27
28 %dir %{_sysconfdir}/nagios 29 %dir %{_sysconfdir}/nagios/nrpe.d 30 %config %{_sysconfdir}/nagios/nrpe.d/plesk.cfg 31 +%config %{_sysconfdir}/nagios/nrpe.d/lock.cfg 32 %dir %{_prefix}/lib/nagios 33 %dir %{_prefix}/lib/nagios/plugins 34 %{_prefix}/lib/nagios/plugins/check_mysql_plesk 35 +%{_prefix}/lib/nagios/plugins/check_stale_lock2 36 37 %changelog 38 |
||
[+] | 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 |