| 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 : |
#!/bin/bash
# Ref - SYSENG-27573 - Simplified dimm check on SRTs
#
# If not physical server, exit
if ! [[ $(systemd-detect-virt) == "none" ]]; then
exit
fi
# min max values for SRTs (64|128|256) GBs and other things
_mem_min_64GB=64000000
_mem_max_64GB=66000000
_mem_min_128GB=130000000
_mem_max_128GB=135000000
_mem_min_256GB=260000000
_mem_max_256GB=270000000
_mem_total=$(grep MemTotal /proc/meminfo | awk '{print $2}')
_mem_total_in_gb=$(grep MemTotal /proc/meminfo | awk '{print $2/1024/1024}')
_mem_total_in_gb_round=$(printf "%.0f" ${_mem_total_in_gb})
_mem_error=$(ipmitool sel elist | grep "Memory*.*DIMM")
# we will check if an SRT is one of 64|128|256 GB server, else alert
if [[ "${_mem_total}" -gt "${_mem_min_64GB}" && "${_mem_total}" -lt "${_mem_max_64GB}" ]]; then
echo "server has ${_mem_total_in_gb_round}GB DIMMs"
exit 0
elif [[ "${_mem_total}" -gt "${_mem_min_128GB}" && "${_mem_total}" -lt "${_mem_max_128GB}" ]]; then
echo "server has ${_mem_total_in_gb_round}GB DIMMs"
exit 0
elif [[ "${_mem_total}" -gt "${_mem_min_256GB}" && "${_mem_total}" -lt "${_mem_max_256GB}" ]]; then
echo "server has ${_mem_total_in_gb_round}GB DIMMs"
exit 0
else
echo "server has ${_mem_total_in_gb_round}GB, server might be missing one or more dimms"
exit 2
fi
# collect DIMM errors as warning, this will not alert for now
if [[ -n "${_mem_error}" ]]; then
echo "found DIMM error event(s), clear if its old using command: ipmitool sel clear"
exit 1
else
echo "no DIMM errors found"
exit 0
fi