Windows Monitoring for Disk IO


I am trying to setup the baseline for all Windows Server.
I am using Director and I am using Windows Agent
I was able to setup the Service Checks for CPU Memory Disk using default scripts supplied by Icinga2 agent
‘C:\Program Files\ICINGA2/sbin/check_load.exe’
‘C:\Program Files\ICINGA2/sbin/check_disk.exe’
‘C:\Program Files\ICINGA2/sbin/check_memory.exe’

The rest of the monitoring I want to achieve is as below

  1. The percent of processor time used by a specific process. Something like below

%Avg_Processor_Time > 70% (Warning) %Avg_Processor_Time > 90% (Critical) & Process.Priority_Base != 0 & Process_Name != ‘_Total’

  1. An indication of high disk activity.

Physical_Disk.%_Disk_Time > 65 & Physical_Disk.Disk_Name != ‘_Total’

  1. Service Monitoring

Services.Current_State == Stopped & Services.Start_Type == Automatic

Should also provide a -X argument for excluding override of service on a particular server

  1. Disk Failure using Windows Event ID

Event_Log.Event_ID == 11 & Event_Log.Source_Unicode == ‘Disk’ & Event_Log.Description_Unicode == ‘.*cable error.*’

The first one of the requirement I want to execute something like this. And then if it breaches a threshold raise an Alarm

> $CpuCores = (Get-WmiObject -class Win32_processor | Measure-Object -Sum NumberOfLogicalProcessors).Sum

> (Get-Counter "\Process(*)\% Processor Time" -ErrorAction SilentlyContinue).CounterSamples | where {$_.Status -eq 0 -and $_.instancename -notin "_total", "idle"} | Select InstanceName, @{Name="CPU %";Expression={[Decimal]::Round(($_.CookedValue / $CpuCores), 2)}} | sort *CPU* -Descending | select -First 1

The one for Service Running but stopped and exited with code != 0

(Get-CimInstance win32_service -Filter “startmode = ‘auto’ and state != ‘running’ and exitcode != 0”).displayname

1 Like

you should be aware that when using performance counters, their names can be language sensitive. the best approach would be to get their numeric descriptors

Understood. Thanks @KevinHonka. I was not aware of that. Will keep that in mind.

But question here is How do I achieve all the above. Or do we have any plugin that is available and known and I am not finding it in google.