Answer the question
In order to leave comments, you need to log in
How to create a trigger in Zabbix 3.2 when % CPU is exceeded for sqlservr.exe process?
Task: create a trigger that will report a failure when the sqlservr.exe process exceeds 50% of the total CPU usage. Those. 50% or more.
Created item, with key
perf_counter[\Process(sqlservr)\% Processor Time]
{Server-name:perf_counter[\Process(sqlservr)\% Processor Time].max(#100)}>50
Answer the question
In order to leave comments, you need to log in
The solution is not mine, a colleague helped
# Obtaining the percentage of CPU utilization for a Windows service (for English localization)
$ServiceName = "MSSQLSERVER";
$ServicePID = (get-wmiobject win32_service | where { $_.name -eq $ServiceName}).processID;
$cpu_cores = (Get-WMIObject Win32_ComputerSystem).NumberOfLogicalProcessors;
$proc_path = ((Get-Counter "\Process(*)\ID Process" -ErrorAction SilentlyContinue).CounterSamples | ?{$_.RawValue -eq $ServicePID}).Path;
$prod_percentage_cpu = [Math]::Round(((Get-Counter ($proc_path -replace "\\id process$","\% Processor Time")).CounterSamples.CookedValue) / $cpu_cores)
$prod_percentage_cpu
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question