-
Incident report
-
Resolution: Unresolved
-
Trivial
-
6.0.5
My configuration is:
Name: Oracle: Get jobs status
Type: Zabbix agent
Key: oracle.custom.query["\{$ORACLE.CONNSTRING}","\{$ORACLE.USER}","\{$ORACLE.PASSWORD}","\{$ORACLE.SERVICE}",jobs]
Type of intformation: Text
I want to use this item in Item Prototype of Discovery rule as a master item.
My jobs.sql is:
SELECT JSON_ARRAYAGG(JSON_OBJECT(to_char(JOB) VALUE JSON_OBJECT('broken' VALUE BROKEN)) RETURNING CLOB) JOBS FROM DBA_JOBS
From PL/SQL Developer I've got this output (column name is JOBS):
[{"84":{"broken":"N"}},{"41":{"broken":"N"}},{"1":{"broken":"N"}},{"21":{"broken":"N"}}]
But oracle plugin returns incorrect JSON object:
$ zabbix_get -s db.corp -k 'oracle.custom.query["tcp://192.168.1.4:1521","zabbix_mon","******","TEST",jobs]' [{"JOBS":"[{\"84\":{\"broken\":\"N\"}},{\"41\":{\"broken\":\"N\"}},{\"1\":{\"broken\":\"N\"}},{\"21\":{\"broken\":\"N\"}}]"}]
Here is the `JOBS` have a string, not array. I thnk it's because of json.Marshal(), there's HTMLEscape by default. Any solutions?