I was successful to monitor average CPU frequency on XenServer 6.5 by Zabbix 2.2 by followings, although "cpu MHz" in /proc/cpuinfo cannot monitor real-time CPU frequency unlike other Linux distributions..
○ Environment:
CPU : AMD FX-9590 (4.7 GHz)
Mother board : ASRock 990Fx Extream 9
Phisycal Memory : 8G x 2
HDD : Western Digital WD2002FAEX x 2 (RAID 1 by mdadm)
Hypervisor : Citrix XenServer 6.5
○xenpm command
1.xenpm start command starts measuring CPU frequency and status, when the CTLR-C is pressed the result of the term from command execution to CTLR-C will be shown on the console.
[root@servername ~]# xenpm start
Start sampling, waiting for CTRL-C or SIGINT or SIGALARM signal ...
(#Press CTRL-C.)
CPU0: Residency(ms) Avg Res(ms) C0 22078 (14.05%) 0.07 C1 103813 (66.08%) 0.37 C2 31201 (19.86%) 2.33 P0 1539 ( 7.72%) P1 216 ( 1.09%) P2 322 ( 1.62%) P3 872 ( 4.38%) P4 319 ( 1.60%) P5 16670 (83.60%) Avg freq 1739000 KHz CPU1: Residency(ms) Avg Res(ms) C0 22118 (14.08%) 0.07 C1 103991 (66.20%) 0.37 C2 30983 (19.72%) 2.36 P0 1668 ( 8.22%) P1 242 ( 1.19%) P2 253 ( 1.25%) P3 844 ( 4.16%) P4 329 ( 1.62%) P5 16951 (83.55%) Avg freq 1786000 KHz CPU2: Residency(ms) Avg Res(ms) C0 21972 (13.99%) 0.07 C1 105369 (67.07%) 0.36 C2 29752 (18.94%) 2.36 P0 1410 ( 7.03%) P1 238 ( 1.19%) P2 296 ( 1.48%) P3 824 ( 4.11%) P4 288 ( 1.44%) P5 17009 (84.76%) Avg freq 1739000 KHz CPU3: Residency(ms) Avg Res(ms) C0 22239 (14.16%) 0.07 C1 105942 (67.44%) 0.36 C2 28912 (18.40%) 2.38 P0 1459 ( 7.17%) P1 287 ( 1.41%) P2 293 ( 1.44%) P3 894 ( 4.40%) P4 298 ( 1.47%) P5 17122 (84.11%) Avg freq 1786000 KHz CPU4: Residency(ms) Avg Res(ms) C0 21750 (13.85%) 0.07 C1 102451 (65.22%) 0.37 C2 32891 (20.94%) 2.45 P0 1401 ( 7.03%) P1 207 ( 1.04%) P2 242 ( 1.22%) P3 965 ( 4.85%) P4 289 ( 1.45%) P5 16817 (84.41%) Avg freq 1739000 KHz CPU5: Residency(ms) Avg Res(ms) C0 21613 (13.76%) 0.07 C1 103763 (66.05%) 0.37 C2 31715 (20.19%) 2.38 P0 1391 ( 7.03%) P1 229 ( 1.16%) P2 287 ( 1.45%) P3 1013 ( 5.12%) P4 295 ( 1.49%) P5 16571 (83.74%) Avg freq 1786000 KHz CPU6: Residency(ms) Avg Res(ms) C0 22060 (14.04%) 0.07 C1 104338 (66.42%) 0.36 C2 30694 (19.54%) 2.43 P0 1426 ( 7.06%) P1 145 ( 0.72%) P2 302 ( 1.50%) P3 921 ( 4.56%) P4 307 ( 1.52%) P5 17094 (84.64%) Avg freq 1739000 KHz CPU7: Residency(ms) Avg Res(ms) C0 21691 (13.81%) 0.07 C1 105650 (67.25%) 0.37 C2 29751 (18.94%) 2.37 P0 1332 ( 6.71%) P1 217 ( 1.09%) P2 314 ( 1.58%) P3 999 ( 5.03%) P4 255 ( 1.29%) P5 16741 (84.30%) Avg freq 1786000 KHz Socket 0 Core 0 CPU 0 Core 1 CPU 1 Core 2 CPU 2 Core 3 CPU 3 Core 4 CPU 4 Core 5 CPU 5 Core 6 CPU 6 Core 7 CPU 7
If the argument for timeout(sec.) is given to xenpm command like the below, the user don't need to press CTRL-C to show the results.
[root@servername ~]# xenpm start 10
○ Setting Zabbix 2.2 Agent on XenServer 6.5
1. Set the sudo configuration on XenServer .5 so that zabbix user can execute xenpm command.Add the following to /etc/sudoers if zabbix user is added to wheel group on XenServer 6.5.%wheel ALL=(ALL) NOPASSWD: /usr/sbin/xenpm
2. Set Timeout parameter in /etc/zabbix/zabbix_server.conf on Zabbix Server. Add the following to conf file.(Default = 3).
Timeout=30
3. Set Timeout parameter in /etc/zabbix/zabbix_agentd.conf on XenServer 6.5. Add the following to conf file.(Default = 3)
Timeout=30
4. Add the followings to /etc/zabbix/zabbix-agentd.conf on XenServer 6.5 to report .
UserParameter=xenpm_start[*],sudo xenpm start 10|grep $2|sed -n -e $1"p"|awk '{print $$3}'5. Restart Zabbix server and agent on XenServer 6.5 in order to reflect configuration changes.
[root@servername ~]# /etc/init.d/zabbix-agent restart
[root@servername2 ~]# /etc/init.d/zabbix-server restart6. Add a new Item for average CPU frequency.of XenServer 6.5 on Zabbix Server
7. You can get the following result after creating the graph.