Ad Widget

Collapse

Zabbix_get - Unsupported item key for odbc

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • registration_is_lame
    Senior Member
    • Nov 2007
    • 148

    #1

    Zabbix_get - Unsupported item key for odbc

    I get "Unsupported item key" when I run zabbix_get -s 10.10.10.10 -k db.odbc.discovery[xyz,DBS001/INSTANCE1]
    I want to see the json output of the discovery rule. Why is it reporting unsupported item key? It is working fine and discovering items but when I try zabbix_get I get the error.


    Key: db.odbc.discovery[xyz,DBS001/INSTANCE1]
    Type: Database Monitor
    Query: select * from mytable;


    zabbix_get -s 10.10.10.10 -k vfs.fs.discovery works fine. So db.odbc.discovery[xyz,DBS001/INSTANCE1] should also work. I tried escaping characters but still the same error.


  • Semiadmin
    Senior Member
    • Oct 2014
    • 1625

    #2
    It's normal.
    zabbix_get works with passive agent check only, not ODBC checks

    Comment

    • registration_is_lame
      Senior Member
      • Nov 2007
      • 148

      #3
      Thanks for the info. I found a way to see the JSON data of a discovery item.

      Create the discovery rule with key db.odbc.discovery[xyz,DBS001/INSTANCE1] and sql query select * from mytable; .
      Then create a item prototype with the same SQL (select * from mytable;) query that you used in discovery rule and change the key to ​​​​​​db.odbc.discovery[{#COLUMN_NAME}_XYZ,DBS001/INSTANCE1] where {#COLUMN_NAME} is one of the column that is returned by the SQL query. (Note: usually under key in item prototypes we use db.odbc.select but since we want to see discovery rule json, we're using db.odbc.discovery).
      Then change the type of information as Text and wait for the result in latest data. There will be multiple result (for each row of COLUMN_NAME) with the same result since we used {#COLUMN_NAME} macro but that's the only way to see the data.

      Comment

      Working...