Upgrade Zabbix from 1.8 to 2.0

If you are not running the new version of Zabbix I highly recommend you upgrade.  I was holding out on the upgrade so I could get a handle on the new features of 2.0 such as low level discovery.

I came across some folks who were having trouble, specifically, with the database patches and I think this made me hesitant to complete the upgrade on the production server that has become integral to our monitoring environment.

I’m happy to say that with some planning the upgrade from Zabbix 1.8 to Zabbix 2.0 is as smooth as upgrading to any one of their minor releases.

The biggest hurdle with this upgrade is based on whether or not you have large database tables.  The database upgrade scripts adds new columns and changes data types on a bunch of the largest Zabbix database tables.  This process involves creating a temporary table with the data from your source table and then copying it back to the modified schema.  If you have a 10G history table, that’s 10G of data being copied twice.  Taking steps before the upgrade will minimize the pain of these changes.

In my opinion, the easiest way to handle these large tables is to not have them.  What I mean by that is to partition the tables so that you can drop old data to keep your table sizes manageable.  If you haven’t already seen my post about partitioning your Zabbix MySQL tables, check it out.

With the old history and history_uint partitions dropped, the database upgrade script still took about 1.5hrs to complete, YMMV.  This is completely related to the size of your existing Zabbix database.  I have a 2G history table and a 3G history_uint table.

You did make a backup of your database before starting this upgrade, right?…

I make it a point to enable maintenance mode on the Zabbix UI before I start any upgrades/DB maintenance.  It makes sure no users are messing around in the system.

Shut down the server process and you are ready to begin.

The documented upgrade procedure from Zabbix provides a good step by step process.

Again, the biggest issue I had was the time it took to upgrade the DB.  Once that was complete the rest of the upgrade was a piece of cake.


2 Comments on “Upgrade Zabbix from 1.8 to 2.0”

  1. Mohan says:


    Your article are so good and thanks for that.
    Can you please write a article about automate zabbix agent installation?


    • Chris says:

      Sorry for the late response Mohan, I’ve changed jobs and haven’t been able to spend much time posting lately.

      I’ll write up in more detail in the future, but for quick help, take a look at this site.


      This guy uses NSIS to create a Windows package for Zabbix agent. I used it quite a bit to easily deploy to 200 or so Windows machines at a time. You may have to modify the NSIS script a bit for your environment but it’s not hard.

      Once the NSIS package was created, I used winexe from the Zabbix server to push out the package to all the Windows clients with a very basic FOR loop.

      Something like this:

      for i in $(seq 1 254); do winexe -U administrator% //192.168.1.${i} ‘\\\zabbix\zabbix_agent-2.0.0_installer.exe /server= /rmtcmd=1 /S /D=”c:\Program Files (x86)\Zabbix”‘; done

      Deploying to Linux machines similar. I usually will compile a package for the hardware types and then deploy with a Bash script in a loop. I’m starting to switch over to RPM packages though now.

      Hope this gets you started. I’ll write more when I have some extra time.

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 )

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