-
Incident report
-
Resolution: Fixed
-
Minor
-
2.0.5, 2.0.7rc1
The API documentation states the following allowed values for sortfield: "Possible values are: triggerid, description, status, priority, lastchange and hostname."
Using hostname fails until you set the output to extended:
$options = array(
'nodeids' => get_current_nodeid(),
'monitored' => true,
'sortfield' => 'hostname'
);
$triggers = API::Trigger()->get($options);
pg_query(): Query failed: ERROR: column t.hostname does not exist LINE 1: SELECT DISTINCT t.triggerid,t.lastchange,t.hostname FROM t... ^ [include/db.inc.php:440]
Error in query [SELECT DISTINCT t.triggerid,t.lastchange,t.hostname FROM triggers t,functions f,items i,hosts h WHERE NOT EXISTS (SELECT NULL FROM functions f,items i,hosts h WHERE t.triggerid=f.triggerid AND f.itemid=i.itemid AND i.hostid=h.hostid AND (i.status<>0 OR h.status<>0)) AND t.status=0 AND t.flags IN ('0','4') AND ((t.value=1) OR ((t.value=0) AND (t.lastchange>1368307636))) AND t.triggerid = f.triggerid AND f.itemid = i.itemid AND i.hostid = h.hostid AND t.triggerid BETWEEN 000000000000000 AND 099999999999999 ORDER BY h.name ,t.lastchange DESC LIMIT 2402 OFFSET 0] [ERROR: column t.hostname does not exist LINE 1: SELECT DISTINCT t.triggerid,t.lastchange,t.hostname FROM t... ^]
pg_fetch_assoc() expects parameter 1 to be resource, boolean given [include/db.inc.php:577]
pg_free_result() expects parameter 1 to be resource, boolean given [include/db.inc.php:578]
pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [include/db.inc.php:440]
Error in query [SELECT d.triggerid_down,d.triggerid_up,t.value FROM trigger_depends d,triggers t WHERE 1=0 AND d.triggerid_up=t.triggerid] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
pg_fetch_assoc() expects parameter 1 to be resource, boolean given [include/db.inc.php:577]
pg_free_result() expects parameter 1 to be resource, boolean given [include/db.inc.php:578]