Hello forum,
In low level discovery I have created a http agent rule to return data from a REST API.
It connects and returns data successfully however without a "data" tag on the front.
If I create an item directly I have the option to "convert to JSON" which works as expect, however this option is not available when creating a lld.
It is documented in api/reference/discoveryrule/object as output_format with a value of 0 or 1
Troubleshooting:
Versions:
I have tried on both 4.05 and 4.2-1.el7 (latest).
Export/Import:
I have tried exporting the template adding the "output_format" and importing it back in however that errors with a message about the unknown tag "output_format".
API:
I have tried using the api to get the discovery rule - success but no output_format tag,
Using the api to get the item with the convert to json ticked returns the item with the output_format tag
updating the discovery rule with output_format
{
"jsonrpc": "2.0",
"method": "discoveryrule.update",
"params": {
"itemid": "237182",
"output_format": "1"
},
"id": 1,
"auth": "xxxxxx"
}
success:
{
"jsonrpc": "2.0",
"result": {
"itemids": [
"237182"
]
},
"id": 1
}
however the discovery rule does not convert to json as expected.
Is this by design or a bug that low level discovery using http_agent does not allow convert to json?
In low level discovery I have created a http agent rule to return data from a REST API.
It connects and returns data successfully however without a "data" tag on the front.
If I create an item directly I have the option to "convert to JSON" which works as expect, however this option is not available when creating a lld.
It is documented in api/reference/discoveryrule/object as output_format with a value of 0 or 1
Troubleshooting:
Versions:
I have tried on both 4.05 and 4.2-1.el7 (latest).
Export/Import:
I have tried exporting the template adding the "output_format" and importing it back in however that errors with a message about the unknown tag "output_format".
API:
I have tried using the api to get the discovery rule - success but no output_format tag,
Using the api to get the item with the convert to json ticked returns the item with the output_format tag
updating the discovery rule with output_format
{
"jsonrpc": "2.0",
"method": "discoveryrule.update",
"params": {
"itemid": "237182",
"output_format": "1"
},
"id": 1,
"auth": "xxxxxx"
}
success:
{
"jsonrpc": "2.0",
"result": {
"itemids": [
"237182"
]
},
"id": 1
}
however the discovery rule does not convert to json as expected.
Is this by design or a bug that low level discovery using http_agent does not allow convert to json?
Comment