Ad Widget

Collapse

Monitoring a database table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Eithco
    Junior Member
    • Jul 2015
    • 21

    #1

    Monitoring a database table

    I need to monitor a certain field in a database.

    For example if my table name is 'action' and I have a field called 'response_time' I want to monitor it whenever a new row is created.

    Here's what I tried:

    I created Item of Type Database monitor, and added a query: select RESPONSE_TIME from dbname.action order by action_timestamp desc limit 1;

    I selected "none" in the application dropbox, left the default interval on 50, and saved the item.

    The database I'm hoping to monitor is in mysql on the same server machine zabbix is running on.

    Would this work? Where in the GUI do I look to see the results on the monitoring?

    I'm new to this so step by step instructions would be great.

    Thanks for your help!
    Last edited by Eithco; 12-07-2015, 12:57.
  • Eithco
    Junior Member
    • Jul 2015
    • 21

    #2
    UPDATE: The item in the host's list of items now have "Not Supported" listed next to it.

    Comment

    • Colttt
      Senior Member
      Zabbix Certified Specialist
      • Mar 2009
      • 878

      #3
      hello you can query you database with unixodbc, and then you can use count and make a trigger with diff()
      Debian-User

      Sorry for my bad english

      Comment

      • kloczek
        Senior Member
        • Jun 2006
        • 1771

        #4
        Originally posted by Eithco
        I need to monitor a certain field in a database.

        For example if my table name is 'action' and I have a field called 'response_time' I want to monitor it whenever a new row is created.

        Here's what I tried:

        I created Item of Type Database monitor, and added a query: select RESPONSE_TIME from dbname.action order by action_timestamp desc limit 1;
        You can use key:
        Code:
        system.run[/usr/bin/mysql -sN -e "select RESPONSE_TIME from dbname.action order by action_timestamp desc limit 1;",]
        To use system.run[] you need to enable on agent setup EnableRemoteCommands=1.
        As well you need to provide read access without pwd from localhost for zabbix user or if it is mysql >= 5.6 you can create on mysql engine side allowing access to such data (using mysql_config_editor command)
        http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
        https://kloczek.wordpress.com/
        zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
        My zabbix templates https://github.com/kloczek/zabbix-templates

        Comment

        Working...