Announcement

Collapse
No announcement yet.

PostgreSQL Zabbix Template

Collapse
X
  • 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: 'db-pgstat.pl' on the databases servers in a executable search path and add 'UserParamenter' in zabbix_agentd.conf:

    UserParameter=postgres.activeconn,db-pgstat.pl --user postgres --database DATABASE --activeconn
    UserParameter=postgres.tupreturned,db-pgstat.pl --user postgres --database DATABASE --tupreturned
    UserParameter=postgres.tupfetched,db-pgstat.pl --user postgres --database DATABASE --tupfetched
    UserParameter=postgres.tupinserted,db-pgstat.pl --user postgres --database DATABASE --tupinserted
    UserParameter=postgres.tupupdated,db-pgstat.pl --user postgres --database DATABASE --tupupdated
    UserParameter=postgres.tupdeleted,db-pgstat.pl --user postgres --database DATABASE --tupdeleted
    UserParameter=postgres.xactcommit,db-pgstat.pl --user postgres --database DATABASE --xactcommit
    UserParameter=postgres.xactrollback,db-pgstat.pl --user postgres --database DATABASE --xactrollback
    UserParameter=postgres.exclusivelock,db-pgstat.pl --user postgres --database DATABASE --exclusivelock
    UserParameter=postgres.accessexclusivelock,db-pgstat.pl --user postgres --database DATABASE --accessexclusivelock
    UserParameter=postgres.accesssharelock,db-pgstat.pl --user postgres --database DATABASE --accesssharelock
    UserParameter=postgres.rowsharelock,db-pgstat.pl --user postgres --database DATABASE --rowsharelock
    UserParameter=postgres.rowexclusivelock,db-pgstat.pl --user postgres --database DATABASE --rowexclusivelock
    UserParameter=postgres.shareupdateexclusivelock,db-pgstat.pl --user postgres --database DATABASE --shareupdateexclusivelock
    UserParameter=postgres.sharerowexclusivelock,db-pgstat.pl --user postgres --database DATABASE --sharerowexclusivelock
    UserParameter=postgres.checkpoints_timed,db-pgstat.pl --user postgres --database DATABASE --checkpoints_timed
    UserParameter=postgres.checkpoints_req,db-pgstat.pl --user postgres --database DATABASE --checkpoints_req
    UserParameter=postgres.buffers_checkpoint,db-pgstat.pl --user postgres --database DATABASE --buffers_checkpoint
    UserParameter=postgres.buffers_clean,db-pgstat.pl --user postgres --database DATABASE --buffers_clean
    UserParameter=postgres.maxwritten_clean,db-pgstat.pl --user postgres --database DATABASE --maxwritten_clean
    UserParameter=postgres.buffers_backend,db-pgstat.pl --user postgres --database DATABASE --buffers_backend
    UserParameter=postgres.buffers_alloc,db-pgstat.pl --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. wilmer_at_fedoraproject.org.
    Attached Files
    Last edited by k0k; 23-04-2012, 15:52. Reason: Fixed proc.mem parameter in template

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

    Comment


      #3
      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.

      Comment


        #4
        Please try with next files: https://github.com/k0k/Zabbix/blob/m...PostgreSQL.xml
        https://github.com/k0k/Zabbix/blob/master/db-pgstat.pl

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

        Comment


          #5
          This is great - thanks very much!

          Comment


            #6
            You're welcome.

            Comment


              #7
              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
              Thys

              Comment


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

                Comment


                  #9
                  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
                  Code:
                  '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,
                  JS

                  Comment

                  Working...
                  X