[ZBXNEXT-559] Add proc.cpu item for monitor per-process cpu usage Created: 2010 Nov 13  Updated: 2010 Nov 13  Resolved: 2010 Nov 13

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Agent (G)
Affects Version/s: None
Fix Version/s: 1.8.4

Type: New Feature Request Priority: Major
Reporter: Alexey Korepov Assignee: Alexei Vladishev
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates ZBXNEXT-494 new item key: per-process cpu consump... Closed

 Description   

Very often users need to check some main process on server, that can eats too much CPU. But at now Zabbix can check only total CPU usage. Will be good to have item to get cpu usage per process.
In linux you can get this info via command:
$ pidstat -p <pid>

  1. pidstat -p 31228
    Linux 2.6.32-bpo.5-amd64 (host) 11/13/2010 x86_64

11:46:03 AM PID %user %system %CPU CPU Command
11:46:03 AM 31228 1.53 0.36 1.89 1 mysqld

And will be good to have items for monitor per process cpu usage history, values - utime and stime:

utime - Amount of time that this process has been scheduled in user mode, measured in clock ticks
stime - Amount of time that this process has been scheduled in kernel mode, measured in clock ticks

for get them, you can use the comands
$ cat /proc/<pid>/stat | cut -d' ' -f 14 #utime
$ cat /proc/<pid>/stat | cut -d' ' -f 15 #stime

Can you add thouse values to zabbix items?


Generated at Thu Mar 28 16:14:46 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.