Ok, so I figured out something. Requesting data without filters, grouping, columns, etc. gives an empty resultset. Talking to the API like this: http://test-icinga/icinga-web/web/api/service/columns[SERVICE_NAME|HOST_NAME|SERVICE_CURRENT_STATE|HOST_NAME|HOST_CURRENT_STATE|HOSTGROUP_NAME]/order(SERVICE_CURRENT_STATE;DESC)/countColumn=SERVICE_ID/authkey=dashboard/xml returns the correct results.
So the question is: shouldn't the API, if called without any filters, sorting, etc. return "target" with all its properties? Is there a "target" which lists all hosts with its services like the /status call in the Nagios-API? (I'm building my own dashboard based on Nagdash and would be very happy to be able to query the API like that) On Mon, Jan 20, 2014 at 11:55 AM, Ferenc Stelcz <ferenc.ste...@gmail.com>wrote: > Hi! > > I'm making myself familiar with the Icinga Web REST API, but I'm stuck and > can't figure out what the problem could be. > > I have a production Icinga (1.8.4) with icinga-web 1.8.1. > > auth.xml is configured to enable api key authentication. Have added a > "dashboard" user with api key "dashboard" and with the only privilege > appkit.api.access. > > If I query the api via GET I get the correct results as it should be. > (GET: http://prod-icinga/icinga-web/web/api/service/authkey=dashboard/json > ) > > Now, I have a testing Icinga from the opensuse build service (Icinga > 1.10.0, backend 1.10.0, icinga-web 1.10.0). If I add the "dashboard" user > with the exact same settings as above and try to query the API I get the > following (GET: > http://test-icinga/icinga-web/web/api/service/authkey=dashboard/json) > > {"result":[[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"success":"true"} > > (number of brackets is correct, as I only have 14 services defined in my > environment but no real data) > > I've seen the above output in one of the Wiki comments, but setting the same > api key as the username does not seem to work. As the Web REST API in my > opinion is pretty poorly documented (is it anywhere, but the sources?) I > would like to ask you for your help. Were there any non-documented changes in > authentication, authorization, api call syntax or whatever? > > > Thank you in advance, > > Ferenc STELCZ > >
_______________________________________________ icinga-users mailing list icinga-users@lists.icinga.org https://lists.icinga.org/mailman/listinfo/icinga-users