Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
Displays the relative load for system with multi-core CPUs.
Current Version
1.0
Last Release Date
2015-05-10
Owner
Imran Ahmed
License
GPL
Compatible With
This scrips displays the relative load for system with multi core cpus.
# CONCEPTS # --------- # First of all we need to explain how cpu load works (for linux at least!) # For a single core cpu if the load is 1 that means its running on full capacity. # This means the percentage load is 100%. # Similarly if the load is 0.5 on a single core cpu then percentage load is 50%. # We can display the calculations for 1 , 8 and 16 core cpus as below: # =============================================================================== # ||# of CPUs || LOAD || ABSOLUTE PERCENT(ABS%)|| RELATIVE PERCENT (REL%) || # =============================================================================== # || 01 || 0.50 || = 100 X LOAD = 50.0% || ABS% /# of CPUs =50/01 =50% || # || 01 || 1.00 || = 100 X 1.0 = 100% || 100/01 = 100% || # || 01 || 2.00 || = 100 X 2.0 = 200% || 200/01 = 200% || # || 01 || 10.2 || = 100 X 10.2 = 1020% || 1020/01= 1020% || # || 08 || 0.50 || = 100 X 0.50 = 50.0% || 50/08 = 6.25% || # || 08 || 1.00 || = 100 X 1.0 = 100% || 100/08 = 12.5% || # || 08 || 2.00 || = 100 X 2.0 = 200% || 200/08 = 25.0% || # || 08 || 10.2 || = 100 X 10.2 = 1020% || 1020/08= 127.5% || # || 16 || 0.50 || = 100 X 0.50 = 50.0% || 50/16 = 3.125% || # || 16 || 1.00 || = 100 X 1.0 = 100% || 100/16 = 6.25% || # || 16 || 2.00 || = 100 X 2.0 = 200% || 200/16 = 12.5% || # || 16 || 10.2 || = 100 X 10.2 = 1020% || 1020/16= 63.75% || # =============================================================================== # As we can see from the above table that ABS% values do not reflect accurate results when # of CPUs is greater than 1. # This can be addressed in REL%.
I dont have any idea about python, but with this little modify, you can get perfdata if maxLoad >= critical: # If load is higher than warning threshold. print "CRITICAL - relative load is %s" %maxLoad + "%" + "|relativeload=%s;%d;%d" % (maxLoad, warning, critical) sys.exit(2) elif maxLoad >= warning: print "WARNING - relative load is %s" %maxLoad + "%" + "|relativeload=%s;%d;%d" % (maxLoad, warning, critical) sys.exit(1) elif maxLoad
Thanks for suggesting the improvements. Those have been incorporated into the script now.
You must be logged in to submit a review.
To:
From: