CPU temperature monitoring with Zabbix

zabbix-monitoring

With contemporary monitoring systems you can monitor whatever you wish. All you need – understand technology of data gathering and visualizing. 2016 year serves thousands of ways to perform it. At this post I’ll show up one of the most popular ways to do it – monitoring customization with Zabbix.

CPU temperature metric is one of the most important for every kind of IT infrastructure. You can analyze your hardware healthcare, check server refrigeration at your datacenter. If this value is around critical – your project looks so close to crash. But here is just an example about how to track anything your OS has. You can go through the list of instructions I’ll point below with every data metric. All we need now – Zabbix-agent on host with installed lm-sensors utility and Zabbix-server. You can find lm_sensors utility in every default repository for your Linux distribution.

Filter sensors command to see average CPU temperature


Just run this command:

sensors | tail -n 5 | head -n 4 | awk -F'[:+°]' '{avg+=$3}END{print avg/NR}'

You should see just one figure. That’s an average temperature of processor cores.

You can monitor temperature of each core running few commands and add each of this metrics as a special user parameter. You can gather this temperature metrics at the one graph easily. That’s just my opinion of look at it, average picture for one physical CPU will be enough.

Add user parameter to Zabbix agent


1. Edit Zabbix agent config file (/etc/zabbix/zabbix_agentd.conf). At first ensure that user parameters option is on

UnsafeUserParameters=1

2. Add new parameter at the bottom of file.

UserParameter=cluster1.cpuTemperature,sensors | tail -n 5 | head -n 4 | awk -F'[:+°]' '{avg+=$3}END{print avg/NR}'

3. Restart Zabbix agent on the Wowza server to enable your changes at last. Now you have a streaming metric which is going to be shipped to connected Zabbix server.

Configure Zabbix web-panel


1. Add new item to your host (Configuration -> Hosts -> Items of desired host). Configure stored time, choose subject application, data type and so on.

fl4zsmlavqy

2. Add new trigger for your item (Configuration -> Hosts -> Triggers of desired host). Your trigger has to contain the comparison between your item and critical value. Set up your own value, I picked 70 degrees. Later you can receive from Zabbix alerts if your metric is getting higher than the trigger value.

flmgv4-dqxs

3. Add new graph to your host (Configuration -> Hosts -> Graphs of desired host). Point there name of created item and customize properties of visualization.

wty8qy2-fpi

4. Check your new graph.

atkrdxwhgv4

My CPU temperature was too high. But with monitoring I’ve got an opportunity to fix cooling problem in time.

That’s all. Change the metric and command – principles will stay as they are.

Advertisements

One thought on “CPU temperature monitoring with Zabbix

  1. Hi. I got this in server log : “”Zabbix server:cluster1.cpuTemperature” became not supported: Received value [39.75] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]”

    As one can see, there is a value. Maybe the “.” in value ? How can it be replace by “,” as it’s a german system.
    Agent on client has been restartet and the value in the item is set to numeric (float) befotre !

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s