I am trying to figure out if this is possible in Zabbix. I have an external MySQL DB I would like to query, I have ODBC setup and I can query the DB, using a general query just to make sure the connection is working for example "SELECT * FROM db1.table1" this query works I get a value back. I was using db.odbc.select for this query, so I only expected one value back. when I use the same query with db.odbc.get, I get a good amount of JSON back, again this is good and expected.
I have a SNMP item where the key is named site.id, I would like to use the value of this key in the db query for example "SELECT * FROM db1.table1 WHERE col1=site.id" However I don't know how to properly format site.id in this query so that it is replaced by the value at the time the query is run. Is there a way to do this?
I think my other option is to run an external script where I pass the value site.id and return the JSON after doing the MySQL query in python.
I have a SNMP item where the key is named site.id, I would like to use the value of this key in the db query for example "SELECT * FROM db1.table1 WHERE col1=site.id" However I don't know how to properly format site.id in this query so that it is replaced by the value at the time the query is run. Is there a way to do this?
I think my other option is to run an external script where I pass the value site.id and return the JSON after doing the MySQL query in python.

Comment