Zabbix 2.2.x Web Monitoring

Update6: Zabbix 2.4 has been released, here the steps to do the upgrade without loosing data.
Update5: Patches for versions 2.2.5 and 2.2.6
Update4: This feature has been implemented and will be released in the next upcoming version (2.4). You can test the alpha prerelease from I will give instructions to migrate to new version keeping web scenarios configured with this patch, stay tuned!

Update3: Fixed incorrect behaviour. Previous headers were kept between http steps.

Update2: Added patches for version 2.2.3 and added template support.

Update1: I have updated both patches because an obvious memory leak, sorry but I am not an experienced C programmer :-(.Thanks to Alexei Vladishev for reporting it.


We use zabbix monitoring system at work and we love it. However it lacks some basic functionality in its web monitoring implementation that makes this feature almost useless for us. For example, you can’t modify HTTP Headers like “Content-Type”, needed if you want to use JSON or monitor SOAP web services.

Some people are requesting this feature (ZBXNEXT-282) but, as you can see, there is no plan to implement it for now because it is not part of the roadmap.

This weekend I tried to implement this feature because I thougth it shouldn’t be very difficult and I must admit that it was easier than I expected. I felt very comfortable with the code and I also added some additional HTTPS features we need at work.

This patch applies to version 2.2.0,2.2.1, 2.2.2, 2.2.3,,2.2.6, and provides the following features:

  • Use of custom HTTP Headers
  • Select a certificate and key in outgoing HTTPS connections and set the key password if needed.
  • Verify if the server certificate is signed by a trusted CA and/or the server certificate matches the server name.
  • Select a custom directory that contains our trusted CAs (you must run c_rehash dir to work properly).
  • Template support.
  • Macro support for all new features.
  • Automatic database upgrade if you upgrade from zabbix 2.0.
  • Database changes included in schema if you install it from scratch.


You will need libcurl compiled with openssl support, in debian:

apt-get build-dep zabbix-server-mysql
apt-get install libcurl4-openssl-dev

General Instructions

Build and install the patched source code

svn co svn://
cd 2.2.6
cat zabbix-web-patch-2.2.6.txt | patch -p0
./configure --enable-server --with-mysql --with-libcurl ...
make dbschema
sudo make install

Now you have 3 choices

  • If you are upgrading zabbix from 2.0 you don’t have to worry because the zabbix server will perform the database upgrade.
  • If you are installing from scratch, create your database and import sql files as usual:
    cat database/mysql/{schema,images,data}.sql | mysql -u zabbix -p zabbix
  • If you already have Zabbix 2.2 you will need to execute the following SQL in your zabbix database:
    ALTER TABLE zabbix.httpstep ADD headers TEXT NOT NULL;
    ALTER TABLE zabbix.httptest ADD (
            `certfile`               VARCHAR(255)    DEFAULT ''                NOT NULL,
            `keyfile`                VARCHAR(255)    DEFAULT ''                NOT NULL,
            `keypass`                VARCHAR(64)     DEFAULT ''                NOT NULL,
            `capath`                 VARCHAR(255)    DEFAULT ''                NOT NULL,
            `verifypeer`             INTEGER         DEFAULT '0'               NOT NULL,
            `verifyhost`             INTEGER         DEFAULT '0'               NOT NULL

As final step don’t forget to install/update zabbix frontend with the modified version.


23 thoughts to “Zabbix 2.2.x Web Monitoring”

  1. I have patched up my version of Zabbix and the Header section is appearing. I just want to know how you would specify the headers options.
    With Curl is like so -H “Content-Type: application/json”

    1. Hi Tola, sorry for the late response, I was on vacation last week. You can write your custom headers one per line:

      Content-Type: application/json
      Accept-Charset: utf-8

  2. Thank you,i will try that.
    And,can i write header like:
    Host: xxx

  3. Hi Miguel Martín,
    help me, after all install step.
    I cant find ‘web’ in confiuration.

  4. if i use url like http://……./httpmon.php, it’s ok.
    but i can’t see ‘web’ in confiuration.

    I upgrad zabbix from 2.0 to 2.2.3

  5. in zabbix 2.2

    there is no Web in Confiuration banner?

    we should Confiuration->Host->Web?

    o my god,is true?

  6. Hi Guys,

    I did patch and i`m facing with a problem, it seems that the field post has a limit character, when I add a big xml post, after I add and save, and I re open the step scenario the caracteres didn`t appear in the field. Does happen with you?

    1. Hi Rogerio,

      posts field type is t_shorttext as you can see in create/src/schema.tmpl, and t_shorttext is defined in create/bin/ this way:

      "t_shorttext" => "ZBX_TYPE_SHORTTEXT",
      #if defined(HAVE_IBM_DB2) || defined(HAVE_ORACLE)
      # define ZBX_TYPE_SHORTTEXT_LEN 2048
      # define ZBX_TYPE_SHORTTEXT_LEN 65535

      So I guess you are limited to 2048 bytes if you use DB2 or Oracle database and to 65535 if you don’t.

  7. Hi Miguel, I tried to do what you said but i`m still having the same issue, I did increase the ZBX_TYPE_SHORTTEXT_LEN, but it didn`t work, can you test this post in this URL and check if you have the same trouble with the post field.

    1. Once you have modified the I guess you have to generate the schema again and compile the code with make dbschema && ./configure && make && make install

      And I guess that maybe, depending on the database, you have to extend ‘posts’ column on ‘httpstep’ table.

      Anyway, ‘posts’ is a supported field for ‘httpstep’, have you tried asking in official forums or users mail list?

  8. Hi,

    Thanks for the feedback, I forgot to say which my database is a PostgreSQL, I did the instructions that you said but it didn`t work.

    I`ll go on vacations next week, and I will wait the official release of zabbix 2.4 and try to setup again, by the way, congratulations for your patch will be included in the next release.


  9. I’m having difficulty getting this to work. I’ve rebuilt my entire source but from svn but i dont see the http headers option. I’m on zabbix 2.2.3 aswell.

  10. HI, 2.2.4 version was release,could you provider the patch for that?Thinks you very much..

  11. I was able to start seeing the header option in webchecks in 2.2.4. However when i try to replace the header http://XX.XX.XX.XX/check.aspx with host: The webstep fails.

    In addition, tcpdump -n host XX.XX.XX.XX -vvv -X shows that the header is not being replaced.

    Any ideas why this might be happening?

    1. Setting up Host: works for me. I can see host header in apache2 logs. Actually I can see a warning in apache logs saying that my default hostname is not the same provided in host header:
      Hostname xxxxxxxxxxx provided via SNI and hostname provided via HTTP are different

Comments are closed.