| Server IP : 198.38.94.67 / Your IP : 216.73.217.178 Web Server : LiteSpeed System : Linux d6054.dxb1.stableserver.net 5.14.0-570.25.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 9 04:57:09 EDT 2025 x86_64 User : azfilmst ( 1070) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/lib64/nagios/plugins/ |
Upload File : |
#!/usr/bin/python3
import os
import subprocess
import socket
# Check if the hostname contains "vplatform" - BFENG-1670
hostname = socket.gethostname()
if "vplatform" in hostname:
print("check not applicable this is vplatform server - OK")
exit(0)
# allow our agents to whitelist SEL events
if os.path.isfile('/opt/hwflags/event.whitelist'):
with open('/opt/hwflags/event.whitelist','r') as f:
whitelist = f.read().split('\n')
else:
whitelist = []
try:
# Start off assumning no issues
problem = False
# Parse ipmitool output
o = subprocess.check_output(['/bin/ipmitool','sel','elist'])
s = str(o,encoding='utf-8',errors='replace')
lines = s.split('\n')
# Go through each line of output.
for l in lines:
f = l.split('|')
# look only for lines which mention processor throttling
if len(f) >= 5 and 'Processor' in f[3] and 'Throttled' in f[4]:
eid = f[0].strip()
if 'Asserted' in f[5] and not eid in whitelist:
# Asserted means thottling has started. We might have a problem.
problem = True
elif 'Deasserted' in f[5]:
# Deasserted means throttling has stopped. We no longer have a problem.
problem = False
if problem:
# An assertion not followed by deassertion is found, CPU is probably throttled.
print ("throttling detected!")
exit(2)
else:
# No assertions in SEL or all are followed by deassertion.
print ("no throttling detected.")
exit(0)
except FileNotFoundError:
# ipmitool returned a file not found error.
print ("ipmitool binary missing.")
exit(3)
except subprocess.CalledProcessError:
# ipmitool returned a different error.
print ("error running ipmitool.")
exit(3)