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_a2_mailqueue.mvps.mdedi
#!/bin/bash

# Tries manually restarting dbgov if not running, error after retries hit SYSENG-20225

nagios_cache_file="/var/tmp/$(basename $0)"
nagios_cache_age=900

# cacheage function
nagios_cacheage() {
  file=$1
  now=$(date +%s)
  mtime=$(stat -c %Y "$file")
  delta=$(( now - mtime ))
  echo $delta
}

nagios_generate_cache() {
  threshold=5000

  if [ -e /usr/local/cpanel/version ]; then
    count=`exim -bpc`
    if [ ${count} -gt ${threshold} ]; then
      /app/bin/exim_clean.sh >/dev/null
      count=`exim -bpc`
    fi
  elif [ -e /usr/local/psa/version ]; then
    count=`mailq | grep -c '^[A-F0-9]'`
  fi

  if [ ${count} -gt ${threshold} ]; then
    echo "mailqueue - ${count} messages in the queue"
    echo "exit_code = 2"
   else
    echo "mailqueue - OK"
    echo "exit_code = 0"
  fi
}

if [ ! -e "${nagios_cache_file}" ]; then
  touch ${nagios_cache_file}
  nagios_generate_cache > "${nagios_cache_file}"
else
  cache_age=$(nagios_cacheage ${nagios_cache_file})
  if [ "${cache_age}" -ge "${nagios_cache_age}" ]; then
    nagios_generate_cache > "${nagios_cache_file}"
  fi
fi

if [ -s "${nagios_cache_file}" ]; then
  cat "${nagios_cache_file}" | grep -v "exit_code = "
  if grep -q "exit_code = 0" "${nagios_cache_file}"; then
    exit 0
  else
    exit 2
  fi
fi

Youez - 2016 - github.com/yon3zu
LinuXploit