You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Intel N150 Ubuntu 25.10 Zabbix 7.2.2 zabbix_agent2 example

script

vi /etc/zabbix/scripts/get_cpu-freq.sh
chmod +x /etc/zabbix/scripts/get_cpu-freq.sh
#!/bin/bash
CPU="$1"
CORES=4
cat /proc/cpuinfo |grep 'cpu MHz'|tail -n $[$CORES - $CPU]|head -n1 |cut -d\: -f2

test script

root@server5:~# /etc/zabbix/scripts/get_cpu-freq.sh 0;/etc/zabbix/scripts/get_cpu-freq.sh 1;/etc/zabbix/scripts/get_cpu-freq.sh 2; /etc/zabbix/scripts/get_cpu-freq.sh 3; cat /proc/cpuinfo |grep 'cpu MHz'
 700.031
 1357.157
 1373.022
 1399.930
cpu MHz         : 1397.000
cpu MHz         : 1400.030
cpu MHz         : 1399.983
cpu MHz         : 1399.439


config

vi /etc/zabbix/zabbix_agent2.d/plugins.d/cpu-mhz.conf
### Zabbix Agent2 config to monitor CPU Frequency

UserParameter=cpu.freq[*],/etc/zabbix/scripts/get_cpu-freq.sh "$1"

test config

root@server5:~# zabbix_agent2 -t 'cpu.freq[3]'
cpu.freq[3]                                   [s| 1208.600]


reload zabbix agent

systemctl restart zabbix-agent2.service

ad items to Zabbix server

Zabbix → Monitoring → Hosts → (the host) Items in dropdown menu. → Create Item → 



CPU Core 0 Frequencycpu.freq[0]
CPU Core 1 Frequencycpu.freq[1]
CPU Core 2 Frequencycpu.freq[2]
CPU Core 3 Frequencycpu.freq[3]


  • No labels