No announcement yet.

PostgreSQL Zabbix Template

  • Filter
  • Time
  • Show
Clear All
new posts

    PostgreSQL Zabbix Template

    Template to keep monitored PostgreSQL Enterprises Databases, some features monitored are: connection pool, buffers, locks, checkpoints, performance and availability, displays graphics statistics, this work is inspired in Postbix of SmartMarmot Tech.

    You just need to put the script: '' on the databases servers in a executable search path and add 'UserParamenter' in zabbix_agentd.conf:

    UserParameter=postgres.activeconn, --user postgres --database DATABASE --activeconn
    UserParameter=postgres.tupreturned, --user postgres --database DATABASE --tupreturned
    UserParameter=postgres.tupfetched, --user postgres --database DATABASE --tupfetched
    UserParameter=postgres.tupinserted, --user postgres --database DATABASE --tupinserted
    UserParameter=postgres.tupupdated, --user postgres --database DATABASE --tupupdated
    UserParameter=postgres.tupdeleted, --user postgres --database DATABASE --tupdeleted
    UserParameter=postgres.xactcommit, --user postgres --database DATABASE --xactcommit
    UserParameter=postgres.xactrollback, --user postgres --database DATABASE --xactrollback
    UserParameter=postgres.exclusivelock, --user postgres --database DATABASE --exclusivelock
    UserParameter=postgres.accessexclusivelock, --user postgres --database DATABASE --accessexclusivelock
    UserParameter=postgres.accesssharelock, --user postgres --database DATABASE --accesssharelock
    UserParameter=postgres.rowsharelock, --user postgres --database DATABASE --rowsharelock
    UserParameter=postgres.rowexclusivelock, --user postgres --database DATABASE --rowexclusivelock
    UserParameter=postgres.shareupdateexclusivelock, --user postgres --database DATABASE --shareupdateexclusivelock
    UserParameter=postgres.sharerowexclusivelock, --user postgres --database DATABASE --sharerowexclusivelock
    UserParameter=postgres.checkpoints_timed, --user postgres --database DATABASE --checkpoints_timed
    UserParameter=postgres.checkpoints_req, --user postgres --database DATABASE --checkpoints_req
    UserParameter=postgres.buffers_checkpoint, --user postgres --database DATABASE --buffers_checkpoint
    UserParameter=postgres.buffers_clean, --user postgres --database DATABASE --buffers_clean
    UserParameter=postgres.maxwritten_clean, --user postgres --database DATABASE --maxwritten_clean
    UserParameter=postgres.buffers_backend, --user postgres --database DATABASE --buffers_backend
    UserParameter=postgres.buffers_alloc, --user postgres --database DATABASE --buffers_alloc

    You can use --pass option for password database support. (not recommend)

    Finally this template and perl file was tested for Zabbix 1.8.10, postgreSQL 8.4+ and RHEL 5.5, this obviously is Open Source and you can report bugs to Wilmer Jaramillo M.
    Attached Files
    Last edited by k0k; 23-04-2012, 15:52. Reason: Fixed proc.mem parameter in template

    Somehow I'm missing the point how to make a item from it.


      I'm also having issues with this script values being returned as text and not unsigned integers. Zabbix server ignores most of the data because it is of the wrong type.


        Please try with next files:

        Remember, this template is not yet tested with Zabbix 2.0, sorry.


          This is great - thanks very much!


            You're welcome.


              Hi k0k

              Thanks for this nice temple I have just imported it and want to roll out to my servers but I don't see the script for the pgsql items (postgres items are working 100%), could you possibly publish it ?

              Thanks again


                Please ignore my last post, I made a mistake with my template import


                  Originally posted by viper233 View Post
                  I'm also having issues with this script values being returned as text and not unsigned integers. Zabbix server ignores most of the data because it is of the wrong type.
                  Hi k0k,

                  I second this. Am trying to get this running on zabbix 2.0.9, wheezy and perl 5.14.2 to query postgresql 9.2 and 9.3 instances.

                  I've tested all queries manually and the script itself is running great but as viper233 stated results are returned as text strings.

                  I'm no coder but maybe you can help me out there. I need to replace the "GetOptions()" statements
                  'size'          => sub { print query_database($querys{size}) },
                  so that they output unsigned decimals.

                  Any idea? Have tested numerous option with printf instead of print but really can't get it to roll.

                  Many thanks in advance,