Farklı servisler içinde uyarlamanız mümkün.
pico uptime.sh
#!/bin/bash
#service monitoring
/bin/netstat -tulpn | awk '{print $4}' | awk -F: '{print $2}' | grep ^389$ > /dev/null 2>/dev/null
a=$(echo $?)
if test $a -ne 0
then
echo "slapd service down" | ssmtp mail-adresi /dev/null 2>/dev/null
else
sleep 0
fi
pico msg.txt
To: mail-adresi
From: gönderici-mail-adresi
Subject: Ldap Alert
Slapd servisi durmuş yeniden başlatılıyor!!
# Ldap temizlik
0 4 * * * /usr/bin/db4.8_archive -d -h /var/lib/ldap
# Ldap durursa start ver
*/1 * * * * /root/uptime.sh > /dev/null 2>/dev/null