W
W
whatisit12017-11-01 15:50:37
Monitoring
whatisit1, 2017-11-01 15:50:37

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]

Type "Zabbix agent", Data type "Decimal".
How to create a trigger?
It turned out something like this, but I'm not sure if it's true ...
{Server-name:perf_counter[\Process(sqlservr)\% Processor Time].max(#100)}>50

59f9c2f51a264933818810.pngps for the smartest, who have nothing to answer - already read and googled. I'm setting it up for the first time and now I need to resolve the issue. As soon as I become a Zabix guru, I will definitely let you know.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
whatisit1, 2017-12-15
@whatisit1

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

S
sflyer, 2017-11-21
@sflyer

I would not call myself about zabbix, but for me the option looks better
Those. if the last value is greater than 50

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question