Zabbix – modify last value column width

A minor annoyance of Zabbix is that the Last Value column is limited to 20 characters wide in the dashboard.

You see this a lot when you are capturing interface names from network devices because they tend to be quite long.

Here’s a shot of the default column width and some interface names.  Hard to read aren’t they?


last value column width – before

Modifying the width of this column has to be done in the source of the dashboard.  This sounds more difficult that it is.  In fact, you only have to modify 2 lines of code and save the changes.  No service restarts, no recompiling.

From your Zabbix server, use your favorite editor to open /var/www/html/zabbix/include/  Change the path to point to wherever your frontend files are if they are not in the same place as mine.

If you are running version 1.8.12, you should jump down to lines 1410 and 1411 in the above file and change the 20 to a 50.  If you are running version 2.0.0, the values to change are on lines 898 and 899.  Save the file after you make your changes and then refresh your dashboard screen to see the change.

Here’s what the lines look like after I made my change from 20 to 50.

                 if (zbx_strlen($lastvalue) > 50) {
                         $lastvalue = zbx_substr($lastvalue, 0, 50).' ...';

You could go higher than 50 but, to me, that seems to be a good balance of showing enough of the value without taking up the entire screen.

Here is the result of the change


There it is.  Let me know if this helped you out.

One Comment on “Zabbix – modify last value column width”

  1. Rocky Raccoon says:

    Thank you! it’s just what I need!

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s