V1rus Private
User / IP
:
216.73.217.108
Host / Server
:
190.92.174.125 / aerosofthealthcare.com
System
:
Linux s3739.bom1.stableserver.net 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64
Cmd
|
Upload
|
Mass Deface
|
Create
|
Sym
:
/
lib64
/
nagios
/
plugins
/
Viewing: check_smartermail_queue
#!/bin/bash usage() { echo "check_smartermail_queue - Icinga SmarterMail queue check" echo "" echo "Usage: check_smartermail_queue -w <warning queue size> -c <critical queue size> [ -h ]" echo "" echo " -w Queue size at which a warning is triggered" echo " -c Queue size at which a critical is triggered" echo " -h Show this page" echo "" } cmdopts() { if [ $# -gt 0 ]; then while getopts w:c:h myarg; do case $myarg in h|\?) usage exit 0;; w) WARNING=$OPTARG;; c) CRITICAL=$OPTARG;; *) # Default usage exit 1;; esac done else usage exit 1 fi } cmdopts "$@" if [ -z "$WARNING" ] || [ -z "$CRITICAL" ]; then echo "Error: Both -w (warning) and -c (critical) thresholds must be provided." usage exit 1 fi SPOOL_DIR="/var/lib/smartermail/Spool" EMAIL_COUNT=$(find "$SPOOL_DIR" -type f -name "*.eml" 2>/dev/null | wc -l) if [ "$EMAIL_COUNT" -ge "$CRITICAL" ]; then echo "CRITICAL: $EMAIL_COUNT mail(s) in queue (Threshold: $CRITICAL)" exit 2 # Critical status elif [ "$EMAIL_COUNT" -ge "$WARNING" ]; then echo "WARNING: $EMAIL_COUNT mail(s) in queue (Threshold: $WARNING)" exit 1 # Warning status else echo "OK: $EMAIL_COUNT mail(s) in queue (Threshold is below $WARNING)" exit 0 # OK status fi
Coded With 💗 by
HanzOFC