Ad Widget

Collapse

MySQL +Not supported by ZABBIX agent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stelios
    Junior Member
    • Oct 2007
    • 13

    #1

    MySQL +Not supported by ZABBIX agent

    Even though I can run the commands from a terminal I'm getting a 'Not supported by ZABBIX agent' under my hosts. Any help is much appreciated.

    ####### USER-DEFINED MONITORED PARAMETERS #######
    # Format: UserParameter=<key>,<shell command>
    # Note that shell command must not return empty string or EOL only
    #UserParameter=system.test,who|wc -l
    ### Set of parameter for monitoring MySQL server (v3.23.42 and later)
    ### Change -u<username> and add -p<password> if required
    UserParameter=mysql.ping,mysqladmin -uroot ping|grep alive|wc -l
    UserParameter=mysql.uptime,mysqladmin -uroot status|cut -f2 -d":"|cut -f1 -d"T"
    UserParameter=mysql.threads,mysqladmin -uroot status|cut -f3 -d":"|cut -f1 -d"Q"
    UserParameter=mysql.questions,mysqladmin -uroot status|cut -f4 -d":"|cut -f1 -d"S"
    UserParameter=mysql.slowqueries,mysqladmin -uroot status|cut -f5 -d":"|cut -f1 -d"O"
    UserParameter=mysql.qps,mysqladmin -uroot status|cut -f9 -d":"
    UserParameter=mysql.version,mysql -V

    root@dionysos [~]# mysqladmin -uroot ping|grep alive|wc -l
    1
    root@dionysos [~]# mysqladmin -uroot status|cut -f2 -d":"|cut -f1 -d"T"
    5150616
    root@dionysos [~]# mysqladmin -uroot status|cut -f3 -d":"|cut -f1 -d"Q"
    2
    root@dionysos [~]# mysqladmin -uroot status|cut -f4 -d":"|cut -f1 -d"S"
    576932385
    root@dionysos [~]# mysqladmin -uroot status|cut -f5 -d":"|cut -f1 -d"O"
    299
    root@dionysos [~]# mysqladmin -uroot status|cut -f9 -d":"
    112.012
    root@dionysos [~]# mysql -V
    mysql Ver 14.12 Distrib 5.0.45, for unknown-linux-gnu (x86_64) using readline 5.0
    root@dionysos [~]#
  • stelios
    Junior Member
    • Oct 2007
    • 13

    #2
    Just an update.
    I managed to make work the uptime and version but not the rest.
    What I did was to edit the item and remove the [] and place a dot insteed of [].
    mysql.slowqueries and the rest are not working via the web interface even though via shell seems to work ok. See below:

    root@dionysos [/etc/zabbix]# /usr/local/zabbix/sbin/zabbix_agentd -t mysql.slowqueries
    mysql.slowqueries [t| 303 ]
    root@dionysos [/etc/zabbix]#

    Under the web I'm always getting a Not supported by ZABBIX agent.

    Any help is much appreciated.

    Thanks

    Comment

    • stelios
      Junior Member
      • Oct 2007
      • 13

      #3
      Anyone with a suggestion?

      Comment

      • johnnguyen
        Junior Member
        • May 2008
        • 18

        #4
        this problem is not the same between command line in zabbix_agentd and items in Template_App_MySQL

        you go to Template_App_MySQL and change items in this

        example: key mysql[ping] change to mysql.ping and perform for other items

        have fun!

        Comment

        • vhm3
          Junior Member
          • Jun 2008
          • 13

          #5
          Here's mine:
          Code:
          UserParameter=mysql.ping,mysqladmin -u root --password=XXXXXX ping | grep alive | wc -l | tr -d " "
          UserParameter=mysql.uptime,mysqladmin -u root --password=XXXXXX status | cut -f2 -d ":" | cut -f1 -d "T" | tr -d " "
          UserParameter=mysql.threads,mysqladmin -u root --password=XXXXXX status | cut -f3 -d ":" | cut -f1 -d "Q" | tr -d " "
          UserParameter=mysql.questions,mysqladmin -u root --password=XXXXXX status | cut -f4 -d ":"|cut -f1 -d "S" | tr -d " "
          UserParameter=mysql.slowqueries,mysqladmin -u root --password=XXXXXX status | cut -f5 -d ":" | cut -f1 -d "O" | tr -d " "
          UserParameter=mysql.qps,mysqladmin -u root --password=XXXXXX status | cut -f9 -d ":" | tr -d " "
          UserParameter=mysql.version,mysql -V
          This is working both in the CLI as well as the agent status. Please note, that I had to add in the code at the end of each line "tr -d " "" to strip the whitespace from the result returned. Once doing that, everything is fine.

          Chip

          Comment

          Working...