Icinga / icinga-web

Icinga Web 1.x, the old new web interface (EOL 31.12.2018)
22 stars 11 forks source link

[dev.icinga.com #8873] REST API: Allow to add downtime attributes in host/service queries #1349

Closed icinga-migration closed 9 years ago

icinga-migration commented 9 years ago

This issue has been migrated from Redmine: https://dev.icinga.com/issues/8873

Created by mfriedrich on 2015-03-26 15:50:07 +00:00

Assignee: mfriedrich Status: Resolved (closed on 2015-03-26 15:51:10 +00:00) Target Version: 1.13 Last Update: 2015-03-26 15:51:10 +00:00 (in Redmine)

Icinga Version: Icinga2 2.3.3
Icinga Web Version: Icinga Web 1.13.0
IDO Version: 1.13.0
OS Version: Fedora 21 x64
DB Type: MySQL
DB Version: Ver 15.1 Distrib 10.0.15-MariaDB
Browser Version: Chrome 41.0.2272.101 (64-bit)

Description

Accessing the Icinga Web REST API and querying for downtime specific entries.

http://localhost/icinga-web/web/api/service/columns\[SERVICE\_NAME%7CHOST\_NAME%7CDOWNTIME\_ENTRY\_TIME%7CDOWNTIME\_SCHEDULED\_START\_TIME%7CDOWNTIME\_SCHEDULED\_END\_TIME\]/authkey=test1234/json

Problem

Uncaught Doctrine_Exception thrown:
Couldn't find class dt
Stacktrace:

#0 /usr/share/icinga-web/lib/doctrine/lib/Doctrine/Table.php(256): Doctrine_Table->initDefinition()
#1 /usr/share/icinga-web/lib/doctrine/lib/Doctrine/Connection.php(1134): Doctrine_Table->__construct('dt', Object(Doctrine_Connection_Mysql), true)
#2 /usr/share/icinga-web/lib/doctrine/lib/Doctrine/Query.php(1951): Doctrine_Connection->getTable('dt')
#3 /usr/share/icinga-web/lib/doctrine/lib/Doctrine/Query.php(1747): Doctrine_Query->loadRoot('dt', 'dt')
#4 /usr/share/icinga-web/lib/doctrine/lib/Doctrine/Query.php(721): Doctrine_Query->load('dt')
#5 /usr/share/icinga-web/lib/doctrine/lib/Doctrine/Query.php(638): Doctrine_Query->parseClause('dt.entry_time')
#6 /usr/share/icinga-web/lib/doctrine/lib/Doctrine/Query/Select.php(37): Doctrine_Query->parseSelect('dt.entry_time A...')
#7 /usr/share/icinga-web/lib/doctrine/lib/Doctrine/Query/Abstract.php(2077): Doctrine_Query_Select->parse('dt.entry_time A...')
#8 /usr/share/icinga-web/lib/doctrine/lib/Doctrine/Query.php(1174): Doctrine_Query_Abstract->_processDqlQueryPart('select', Array)
#9 /usr/share/icinga-web/lib/doctrine/lib/Doctrine/Query.php(1138): Doctrine_Query->buildSqlQuery(true)
#10 /usr/share/icinga-web/lib/doctrine/lib/Doctrine/Query/Abstract.php(958): Doctrine_Query->getSqlQuery(NULL)
#11 /usr/share/icinga-web/app/modules/Api/lib/database/IcingaDoctrine_Query.class.php(116): Doctrine_Query_Abstract->_execute(NULL)
#12 /usr/share/icinga-web/lib/doctrine/lib/Doctrine/Query/Abstract.php(1026): IcingaDoctrine_Query->_execute(NULL)
#13 /usr/share/icinga-web/app/modules/Api/models/Store/LegacyLayer/IcingaApiModel.class.php(130): Doctrine_Query_Abstract->execute(NULL, 5)
#14 /usr/share/icinga-web/app/modules/Api/models/Store/LegacyLayer/IcingaApiModel.class.php(149): Api_Store_LegacyLayer_IcingaApiModel->execRead()
#15 /usr/share/icinga-web/app/modules/Api/actions/ApiSearchAction.class.php(127): Api_Store_LegacyLayer_IcingaApiModel->fetch()
#16 /var/cache/icinga-web/config/compile.xml_production__d41bc4e7416d79a2859fb497054ab4f5308e2df1.php(949): Api_ApiSearchAction->executeRead(Object(AgaviWebRequestDataHolder))
#17 /var/cache/icinga-web/config/compile.xml_production__d41bc4e7416d79a2859fb497054ab4f5308e2df1.php(1463): AgaviExecutionContainer->runAction()
#18 /var/cache/icinga-web/config/compile.xml_production__d41bc4e7416d79a2859fb497054ab4f5308e2df1.php(1255): AgaviExecutionFilter->execute(Object(AgaviFilterChain), Object(AgaviExecutionContainer))
#19 /var/cache/icinga-web/config/compile.xml_production__d41bc4e7416d79a2859fb497054ab4f5308e2df1.php(1700): AgaviFilter->executeOnce(Object(AgaviFilterChain), Object(AgaviExecutionContainer))
#20 /usr/share/icinga-web/app/modules/Api/lib/auth/IcingaApiAuthentificationLogoutFilter.class.php(33): AgaviFilterChain->execute(Object(AgaviExecutionContainer))
#21 /var/cache/icinga-web/config/compile.xml_production__d41bc4e7416d79a2859fb497054ab4f5308e2df1.php(1255): IcingaApiAuthentificationLogoutFilter->execute(Object(AgaviFilterChain), Object(AgaviExecutionContainer))
#22 /var/cache/icinga-web/config/compile.xml_production__d41bc4e7416d79a2859fb497054ab4f5308e2df1.php(1700): AgaviFilter->executeOnce(Object(AgaviFilterChain), Object(AgaviExecutionContainer))
#23 /usr/share/icinga-web/lib/agavi/src/filter/AgaviSecurityFilter.class.php(61): AgaviFilterChain->execute(Object(AgaviExecutionContainer))
#24 /var/cache/icinga-web/config/compile.xml_production__d41bc4e7416d79a2859fb497054ab4f5308e2df1.php(1255): AgaviSecurityFilter->execute(Object(AgaviFilterChain), Object(AgaviExecutionContainer))
#25 /var/cache/icinga-web/config/compile.xml_production__d41bc4e7416d79a2859fb497054ab4f5308e2df1.php(1700): AgaviFilter->executeOnce(Object(AgaviFilterChain), Object(AgaviExecutionContainer))
#26 /var/cache/icinga-web/config/compile.xml_production__d41bc4e7416d79a2859fb497054ab4f5308e2df1.php(870): AgaviFilterChain->execute(Object(AgaviExecutionContainer))
#27 /var/cache/icinga-web/config/compile.xml_production__d41bc4e7416d79a2859fb497054ab4f5308e2df1.php(1266): AgaviExecutionContainer->execute()
#28 /var/cache/icinga-web/config/compile.xml_production__d41bc4e7416d79a2859fb497054ab4f5308e2df1.php(1255): AgaviDispatchFilter->execute(Object(AgaviFilterChain), Object(AgaviExecutionContainer))
#29 /var/cache/icinga-web/config/compile.xml_production__d41bc4e7416d79a2859fb497054ab4f5308e2df1.php(1700): AgaviFilter->executeOnce(Object(AgaviFilterChain), Object(AgaviExecutionContainer))
#30 /usr/share/icinga-web/lib/agavi/src/filter/AgaviFormPopulationFilter.class.php(78): AgaviFilterChain->execute(Object(AgaviExecutionContainer))
#31 /var/cache/icinga-web/config/compile.xml_production__d41bc4e7416d79a2859fb497054ab4f5308e2df1.php(1700): AgaviFormPopulationFilter->executeOnce(Object(AgaviFilterChain), Object(AgaviExecutionContainer))
#32 /var/cache/icinga-web/config/compile.xml_production__d41bc4e7416d79a2859fb497054ab4f5308e2df1.php(579): AgaviFilterChain->execute(Object(AgaviExecutionContainer))
#33 /usr/share/icinga-web/pub/index.php(49): AgaviController->dispatch()
#34 {main}

Expected result

{"result":[{"SERVICE_NAME":"disk","HOST_NAME":"nbmif.int.netways.de","DOWNTIME_ENTRY_TIME":"2015-03-26 16:35:36","DOWNTIME_SCHEDULED_START_TIME":"2015-03-26 16:35:07","DOWNTIME_SCHEDULED_END_TIME":"2015-03-26 18:35:07"},{"SERVICE_NAME":"disk \/","HOST_NAME":"nbmif.int.netways.de","DOWNTIME_ENTRY_TIME":"2015-03-26 16:35:36","DOWNTIME_SCHEDULED_START_TIME":"2015-03-26 16:35:07","DOWNTIME_SCHEDULED_END_TIME":"2015-03-26 18:35:07"},{"SERVICE_NAME":"disk","HOST_NAME":"nbmif.int.netways.de","DOWNTIME_ENTRY_TIME":"2015-03-26 16:35:58","DOWNTIME_SCHEDULED_START_TIME":"2015-03-26 16:35:56","DOWNTIME_SCHEDULED_END_TIME":"2015-03-26 18:35:56"},{"SERVICE_NAME":"disk \/","HOST_NAME":"nbmif.int.netways.de","DOWNTIME_ENTRY_TIME":"2015-03-26 16:35:58","DOWNTIME_SCHEDULED_START_TIME":"2015-03-26 16:35:56","DOWNTIME_SCHEDULED_END_TIME":"2015-03-26 18:35:56"},{"SERVICE_NAME":"1228ORACLESTANDBY","HOST_NAME":"1228localhost-flexible"},{"SERVICE_NAME":"DISE\u00c3\u2018OS","HOST_NAME":"1300localhost"},{"SERVICE_NAME":"dep1","HOST_NAME":"1300localhost"},{"SERVICE_NAME":"dep2","HOST_NAME":"1300localhost"},{"SERVICE_NAME":"dep3","HOST_NAME":"1300localhost"},{"SERVICE_NAME":"1367_ok_01","HOST_NAME":"1367_host_001"},{"SERVICE_NAME":"1367_ok_02","HOST_NAME":"1367_host_001"},{"SERVICE_NAME":"Testping","HOST_NAME":"1782localhost"},{"SERVICE_NAME":"2291Macro Test","HOST_NAME":"2291localhost"},{"SERVICE_NAME":"2291UserMacro Test","HOST_NAME":"2291localhost"},{"SERVICE_NAME":"2534service","HOST_NAME":"2534localhost"},{"SERVICE_NAME":"2546 forker test","HOST_NAME":"2546localhost_forker"},{"SERVICE_NAME":"2616ido2db Process","HOST_NAME":"2616localhost"},{"SERVICE_NAME":"2743dep_svc01","HOST_NAME":"2743dep_hostsvc01"},{"SERVICE_NAME":"2743dep_svc02","HOST_NAME":"2743dep_hostsvc01"},{"SERVICE_NAME":"2743dep_svc02","HOST_NAME":"2743dep_hostsvc02"},{"SERVICE_NAME":"2743dep_svc01","HOST_NAME":"2743dep_hostsvc03"},{"SERVICE_NAME":"2743dep_svc03","HOST_NAME":"2743dep_hostsvc03"},{"SERVICE_NAME":"2743service_sg01","HOST_NAME":"2743dep_hostsvc03"},{"SERVICE_NAME":"2743dep_svc01","HOST_NAME":"2743dep_hostsvc04"},{"SERVICE_NAME":"2743dep_svc01","HOST_NAME":"2743dep_hostsvc05"},{"SERVICE_NAME":"2743servicewithhostgroup01","HOST_NAME":"2743hghost01"},{"SERVICE_NAME":"2743servicewithhostgroup02","HOST_NAME":"2743hghost01"},{"SERVICE_NAME":"2743servicewithhostgroup01","HOST_NAME":"2743hghost02"},{"SERVICE_NAME":"2743servicewithhostgroup02","HOST_NAME":"2743hghost02"},{"SERVICE_NAME":"2743servicewithhostgroups03","HOST_NAME":"2743hghost02"},{"SERVICE_NAME":"2743servicewithhostgroup01","HOST_NAME":"2743hghost03"},{"SERVICE_NAME":"2743servicewithhostgroup02","HOST_NAME":"2743hghost03"},{"SERVICE_NAME":"2743servicewithhostgroups03","HOST_NAME":"2743hghost03"},{"SERVICE_NAME":"2743service1","HOST_NAME":"2743localhost1"},{"SERVICE_NAME":"2743service2","HOST_NAME":"2743localhost1"},{"SERVICE_NAME":"2743service3","HOST_NAME":"2743localhost1"},{"SERVICE_NAME":"2743service4","HOST_NAME":"2743localhost1"},{"SERVICE_NAME":"2743service5","HOST_NAME":"2743localhost1"},{"SERVICE_NAME":"2743service6","HOST_NAME":"2743localhost1"},{"SERVICE_NAME":"2743service_custom_attr","HOST_NAME":"2743localhost1"},{"SERVICE_NAME":"2743service_notification_options_all","HOST_NAME":"2743localhost1"},{"SERVICE_NAME":"2743service_notification_options_none","HOST_NAME":"2743localhost1"},{"SERVICE_NAME":"2743service_notification_options_some","HOST_NAME":"2743localhost1"},{"SERVICE_NAME":"2743service_nulled_contacts","HOST_NAME":"2743localhost1"},{"SERVICE_NAME":"2743servicecontactsadditive","HOST_NAME":"2743localhost1"},{"SERVICE_NAME":"2743servicewithexcludes","HOST_NAME":"2743localhost1"},{"SERVICE_NAME":"2743servicewithhostnameintemplate","HOST_NAME":"2743localhost1"},{"SERVICE_NAME":"2743servicewithmultipletemplates","HOST_NAME":"2743localhost1"},{"SERVICE_NAME":"2743service1","HOST_NAME":"2743localhost2"},{"SERVICE_NAME":"2743service2","HOST_NAME":"2743localhost2"},{"SERVICE_NAME":"2743service3","HOST_NAME":"2743localhost2"},{"SERVICE_NAME":"2743service4","HOST_NAME":"2743localhost2"},{"SERVICE_NAME":"2743service5","HOST_NAME":"2743localhost2"},{"SERVICE_NAME":"2743service6","HOST_NAME":"2743localhost2"},{"SERVICE_NAME":"2743servicewithexcludes","HOST_NAME":"2743localhost3"},{"SERVICE_NAME":"2913service","HOST_NAME":"2913localhost"},{"SERVICE_NAME":"3064noperfdataservice","HOST_NAME":"3064localhost-test"},{"SERVICE_NAME":"3088service1","HOST_NAME":"3088localhost1"},{"SERVICE_NAME":"3088service2","HOST_NAME":"3088localhost1"},{"SERVICE_NAME":"3088service1","HOST_NAME":"3088localhost2"},{"SERVICE_NAME":"3088service2","HOST_NAME":"3088localhost2"},{"SERVICE_NAME":"3183testcustomvarfilter","HOST_NAME":"3183localhost-test"},{"SERVICE_NAME":"dep1","HOST_NAME":"3295localhost1"},{"SERVICE_NAME":"dep2","HOST_NAME":"3295localhost2"},{"SERVICE_NAME":"3322ENVCHECK","HOST_NAME":"3322localhost"},{"SERVICE_NAME":"3324ORACLE_LONG_OUTPUT","HOST_NAME":"3324localhost"},{"SERVICE_NAME":"3397 macro clean","HOST_NAME":"3397localhost"},{"SERVICE_NAME":"3441Service Name","HOST_NAME":"3441localhost"},{"SERVICE_NAME":"3715dummy01","HOST_NAME":"3715localhost01"},{"SERVICE_NAME":"3715dummy02","HOST_NAME":"3715localhost01"},{"SERVICE_NAME":"3715dummy03","HOST_NAME":"3715localhost01"},{"SERVICE_NAME":"3715dummy04","HOST_NAME":"3715localhost01"},{"SERVICE_NAME":"3715dummy05","HOST_NAME":"3715localhost01"},{"SERVICE_NAME":"3715dummy06","HOST_NAME":"3715localhost01"},{"SERVICE_NAME":"3715dummy07","HOST_NAME":"3715localhost01"},{"SERVICE_NAME":"3715dummy01","HOST_NAME":"3715localhost02"},{"SERVICE_NAME":"3715dummy02","HOST_NAME":"3715localhost02"},{"SERVICE_NAME":"3715dummy03","HOST_NAME":"3715localhost02"},{"SERVICE_NAME":"3715dummy04","HOST_NAME":"3715localhost02"},{"SERVICE_NAME":"3715dummy05","HOST_NAME":"3715localhost02"},{"SERVICE_NAME":"3715dummy06","HOST_NAME":"3715localhost02"},{"SERVICE_NAME":"3715dummy07","HOST_NAME":"3715localhost02"},{"SERVICE_NAME":"3715dummy01","HOST_NAME":"3715localhost03"},{"SERVICE_NAME":"3715dummy02","HOST_NAME":"3715localhost03"},{"SERVICE_NAME":"3715dummy03","HOST_NAME":"3715localhost03"},{"SERVICE_NAME":"3715dummy04","HOST_NAME":"3715localhost03"},{"SERVICE_NAME":"3715dummy05","HOST_NAME":"3715localhost03"},{"SERVICE_NAME":"3715dummy06","HOST_NAME":"3715localhost03"},{"SERVICE_NAME":"3715dummy07","HOST_NAME":"3715localhost03"},{"SERVICE_NAME":"3715dummy01","HOST_NAME":"3715localhost04"},{"SERVICE_NAME":"3715dummy02","HOST_NAME":"3715localhost04"},{"SERVICE_NAME":"3715dummy03","HOST_NAME":"3715localhost04"},{"SERVICE_NAME":"3715dummy04","HOST_NAME":"3715localhost04"},{"SERVICE_NAME":"3715dummy05","HOST_NAME":"3715localhost04"},{"SERVICE_NAME":"3715dummy06","HOST_NAME":"3715localhost04"},{"SERVICE_NAME":"3715dummy07","HOST_NAME":"3715localhost04"},{"SERVICE_NAME":"3715dummy01","HOST_NAME":"3715localhost05"},{"SERVICE_NAME":"3715dummy02","HOST_NAME":"3715localhost05"},{"SERVICE_NAME":"3715dummy03","HOST_NAME":"3715localhost05"},{"SERVICE_NAME":"3715dummy04","HOST_NAME":"3715localhost05"},{"SERVICE_NAME":"3715dummy05","HOST_NAME":"3715localhost05"},{"SERVICE_NAME":"3715dummy06","HOST_NAME":"3715localhost05"},{"SERVICE_NAME":"3715dummy07","HOST_NAME":"3715localhost05"},{"SERVICE_NAME":"4390service","HOST_NAME":"4390localhost"},{"SERVICE_NAME":"StartupDelay","HOST_NAME":"_startup_localhost"},{"SERVICE_NAME":"ping4","HOST_NAME":"google-dns"},{"SERVICE_NAME":"escalate1","HOST_NAME":"localhostescal"},{"SERVICE_NAME":"testservice123","HOST_NAME":"testhost123"},{"SERVICE_NAME":"ping6","HOST_NAME":"nbmif.int.netways.de"},{"SERVICE_NAME":"ping4","HOST_NAME":"nbmif.int.netways.de"},{"SERVICE_NAME":"http","HOST_NAME":"nbmif.int.netways.de"},{"SERVICE_NAME":"procs","HOST_NAME":"nbmif.int.netways.de"},{"SERVICE_NAME":"icinga","HOST_NAME":"nbmif.int.netways.de"},{"SERVICE_NAME":"load","HOST_NAME":"nbmif.int.netways.de"},{"SERVICE_NAME":"users","HOST_NAME":"nbmif.int.netways.de"},{"SERVICE_NAME":"swap","HOST_NAME":"nbmif.int.netways.de"},{"SERVICE_NAME":"ssh","HOST_NAME":"nbmif.int.netways.de"},{"SERVICE_NAME":"test","HOST_NAME":"nbmif.int.netways.de"},{"SERVICE_NAME":"if01","HOST_NAME":"router-01"},{"SERVICE_NAME":"temp","HOST_NAME":"router-01"},{"SERVICE_NAME":"ping6","HOST_NAME":"router-01"},{"SERVICE_NAME":"conditional-ping","HOST_NAME":"cond-01"},{"SERVICE_NAME":"conditional-ping","HOST_NAME":"cond-02"},{"SERVICE_NAME":"ping6","HOST_NAME":"cond-01"},{"SERVICE_NAME":"webserver-backup-load","HOST_NAME":"webserver-with-backup"},{"SERVICE_NAME":"ping4","HOST_NAME":"webserver-with-backup"}],"success":"true"}

Changesets

2015-03-26 15:50:32 +00:00 by (unknown) edfc745684ae64aeae60ee84c7f0c7dcc78df6da

REST API: Allow to add downtime attributes in host/service queries

fixes #8873
icinga-migration commented 9 years ago

Updated by Anonymous on 2015-03-26 15:51:10 +00:00

Applied in changeset edfc745684ae64aeae60ee84c7f0c7dcc78df6da.