Open thibaults-centreon opened 5 years ago
You right the sources say:
$tabOrder = array();
$tabOrder["criticality_id"] = " ORDER BY criticality $q, h.name, s.description ";
$tabOrder["host_name"] = " ORDER BY h.name $q, s.description ";
$tabOrder["service_description"] = " ORDER BY s.description $q, h.name";
$tabOrder["current_state"] = " ORDER BY s.state $q, h.name, s.description";
$tabOrder["last_state_change"] = " ORDER BY s.last_state_change $q, h.name, s.description";
$tabOrder["last_hard_state_change"] = " ORDER by s.last_hard_state_change $q, h.name, s.description";
$tabOrder["last_check"] = " ORDER BY s.last_check $q, h.name, s.description";
$tabOrder["current_attempt"] = " ORDER BY s.check_attempt $q, h.name, s.description";
$tabOrder["output"] = " ORDER BY s.output $q, h.name, s.description";
$tabOrder["default"] = " ORDER BY s.description $q, h.name";
You must use current_state instead of state
BUG REPORT INFORMATION
Prerequisites
Versions
centreon-release-19.04-1.el7.centos.noarch centreon-web-19.04.3-1564057808.b9e6802b1.el7.centos.noarch
Operating System
CentOS7*
Browser used
Description
using sortType parameter with state field on centreon_realtime_services doesn't work, services are actually returned but not sorted by state. "current_state" has to be used instead of "state" as sortType parameter to get the services properly sorted.
Steps to Reproduce
http://127.0.0.1/centreon/api/index.php?object=centreon_realtime_services&action=list&sortType=state&fields=host_name,description,state => results sorted by service name
http://127.0.0.1/centreon/api/index.php?object=centreon_realtime_services&action=list&sortType=current_state&fields=host_name,description,state => results correctly sorted by status code
Additional relevant information (e.g. frequency, ...)