Ad Widget

Collapse

Monitor dead tuples in all tables on postgresql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • roke22
    Junior Member
    • Jan 2020
    • 3

    #1

    Monitor dead tuples in all tables on postgresql

    Hello,

    I want to monitor the dead tuples on all tables on the postgresql server, i have to do it with the client because the zabbix server don't have the vpn connection.

    My question is how to store the name of the table and the number of the dead tuples. At now i can get the data with the SQL:

    SELECT relname, n_dead_tup
    FROM pg_stat_user_tables

    So i can read the 2 columns and send the values to the zabbix server but how to store that two values? I know how to store one value but not how to store a pair of values.

    Thank you.
  • mosakura
    Junior Member
    • Jan 2020
    • 1

    #2
    Hello.
    What is Zabbix version?

    If it is 4.4 or later, "db.odbc.get" can return multiple rows / columns in JSON format.
    I think you should combine "db.odbc.get" and dependent items.

    Comment

    • roke22
      Junior Member
      • Jan 2020
      • 3

      #3
      Hello,

      Thank you very much, i am going to do these steps:

      1. Create master item with text item information to store the table name.
      2. Create dependent item with numeric item information to store the live tuples in the table.
      3. Create dependent item with numeric item information to store the dead tuples in the table.
      4. Send the value with the zabbix sender

      Now i got it the values and the trigger is working like a charm !!

      But last question, how to show the name of the table in the trigger?? The values are stored in db.table_name, db.live and db.dead and i try to do it like this:

      Error dead tuples in {HOST.NAME} on the table {ITEM.db.dead}

      But is not working, can you help me?

      Thank you very much.
      Last edited by roke22; 27-01-2020, 12:23.

      Comment

      • roke22
        Junior Member
        • Jan 2020
        • 3

        #4
        I post the solution that i applyed, you can find the template and the manual in https://git.zabbix.com/projects/ZBX/.../db/postgresql

        Comment

        Working...