Build precise queries to find exactly what you need
Press ESC to close
Nagios World Conference 2026: Sept. 14-17 in St. Paul, MN | Learn More
First of all, thanks your work!
As I see if you use –cmdpattern, the script counts only the first process’ mem usage. So if you run httpd or other services with fork/child calculate with it.
I prefer to send back the warning and critical in perform data. So I modified the script a bit.
if [ “$memVmRSS” -ge “$4” ]; then echo “Memory: CRITICAL VIRT: $memVmSize MB – RES: $memVmRSS MB used!|RES=$(($memVmRSS*1024*1024));$(($2*1024*1024));$(($4*1024*1024));;” $(exit 2) elif [ “$memVmRSS” -ge “$2” ]; then echo “Memory: WARNING VIRT: $memVmSize MB – RES: $memVmRSS MB used!|RES=$(($memVmRSS*1024*1024));$(($2*1024*1024));$(($4*1024*1024));;” $(exit 1) else echo “Memory: OK VIRT: $memVmSize MB – RES: $memVmRSS MB used!|RES=$(($memVmRSS*1024*1024));$(($2*1024*1024));$(($4*1024*1024));;” $(exit 0) fi