HunnyPuns / nagios-windows-plugins

My Nagios Windows Plugins project
GNU General Public License v3.0
1 stars 1 forks source link

check_cpu.ps1 fails to take into account multiple CPU sockets #15

Closed HunnyPuns closed 1 year ago

HunnyPuns commented 1 year ago

check_cpu.ps1, line 59 (get-ciminstance -classname win32_processor -computername localhost).loadpercentage

This line works fine when there is only 1 CPU socket. Win32_Processor's LoadPercentage already averages the load across multiple cores on a single socket. But when you have multiple CPU sockets, it returns a number of lines equal to CPU sockets. This causes the rest of the plugin to fail.