At first, I need to let the Zabbix user execute that kind of sensitive commands for the Raspbian operating system. One way how to do it is to add Zabbix user to group video:
usermod -a -G video zabbix
Now I move to Zabbix user cause I need to test if this command is allowed to run by this user:
sudo su
su - zabbix
The magic command for temperature measure is:
vcgencmd measure_temp | sed "s/^.*=\|..$//g"
Now I exit zabbix user:
exit
The magic command for zabbix server item is:
system.run[vcgencmd measure_temp | sed "s/^.*=\|..$//g"]
I decided to put this item under classic zabbix agent template:


Shouldn't you also include the enableremotecommands=1 in zabbix_agent.conf?
ReplyDeleteYes! You are right. I almost feel it is like default setup :D
DeleteNot very secure. I Know.
Got it working here fine now, thanks for the howto
Delete