-
Incident report
-
Resolution: Unresolved
-
Trivial
-
None
-
3.4.0alpha1
-
tried also with 2.4, same problem
have a host linked to a template with one usermacro with the same usermacro name in both.
perform an api request :
{
"auth" : "cdb57c2c8ec88bfd1818a1c57175a460",
"params" : {
"selectHosts" : [
"host"
],
"filter" : {
"macro" : "{$CPU_LOAD_THRESHOLD}"
},
"output" : [
"value"
]
},
"id" : "9094709340",
"jsonrpc" : "2.0",
"method" : "usermacro.get"
}
the response :
{
"id" : "9094709340",
"result" : [
{
"value" : "1",
"hosts" : [],
"hostmacroid" : "1"
},
{
"value" : "0.9",
"hostmacroid" : "2",
"hosts" : [
{
"hostid" : "10105",
"host" : "A test host"
}
]
}
],
"jsonrpc" : "2.0"
}
notice how the host info for the first macro is empty. that's because it is a macro from the template.
item.get offers at least some way to limit to templates/hosts with 'templated' and 'monitored' parameters. the empty structure is very confusing and it would be great to have a way to limit this api call to hosts/templates.