| Server IP : 170.10.162.208 / Your IP : 216.73.216.181 Web Server : LiteSpeed System : Linux altar19.supremepanel19.com 4.18.0-553.69.1.lve.el8.x86_64 #1 SMP Wed Aug 13 19:53:59 UTC 2025 x86_64 User : deltahospital ( 1806) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /lib64/nagios/plugins/ |
Upload File : |
#!/bin/bash
if [[ $(cat /etc/trueuserowners | wc -l) -le 2 ]]; then
echo "OK: no users."
exit 0
fi
MINSIZE=10
MAXSIZE=5000
EXIMSTATSDB='/var/cpanel/eximstats_db.sqlite3'
EXIMSTATSDBNAME='eximstats_db.sqlite3'
SLEEP_TIME=840 #14 min
suffix="";
jetbackup_pid="$(sudo /usr/bin/pgrep -cf jetbackup5d-backup)"
fstrim_pid="$(sudo /usr/bin/pgrep -x fstrim)"
if [ "$jetbackup_pid" -gt 1 ] || [ -n "$fstrim_pid" ]; then
cedi_pid="$(pgrep -f '&& sudo /root/amscripts/check_eximstats_db_integrity.sh')"
if [ -z "$cedi_pid" ]; then
nohup sh -c "sleep $SLEEP_TIME && sudo /root/amscripts/check_eximstats_db_integrity.sh" > /dev/null 2>&1 &
fi
suffix="[Preload Scheduled]";
fi
if [ ! -f "$EXIMSTATSDB" ]; then
echo "CRITICAL: $EXIMSTATSDB missing. $suffix"
exit 2
elif [ "$(sudo /root/amscripts/check_eximstats_db_integrity.sh)" != "ok" ]; then
echo "CRITICAL: $EXIMSTATSDB is corrupt. $suffix"
exit 2
elif [ "$(du -m $EXIMSTATSDB | cut -f 1)" -lt "$MINSIZE" ]; then
echo "WARNING: Size of $EXIMSTATSDBNAME is too small. Please check. $suffix"
exit 1
elif [ "$(du -m $EXIMSTATSDB | cut -f 1)" -gt "$MAXSIZE" ]; then
echo "WARNING: Size of $EXIMSTATSDBNAME is too large. Please check. $suffix"
exit 1
else
echo "OK: $EXIMSTATSDBNAME is operational. $suffix"
exit 0
fi