Measure Raspberry Pi temperature with zabbix agent

I have Zabbix server running on raspberry and I have a bunch of other pies with different heatsinks on the top of CPU. It is interesting to create some historical record of how the temperature changes for my pies.

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:
Float data type must be selected otherwise nothing will work:
After few hours I got some results:

3 comments:

  1. Shouldn't you also include the enableremotecommands=1 in zabbix_agent.conf?

    ReplyDelete
    Replies
    1. Yes! You are right. I almost feel it is like default setup :D
      Not very secure. I Know.

      Delete
    2. Got it working here fine now, thanks for the howto

      Delete