Problem with api and power query

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
DonForigua
Posts: 94
Joined: Thu Oct 07, 2021 8:59 pm

Problem with api and power query

Post by DonForigua »

Hello

When i run a power quiery:

In excel or power bi

Data > Web origin

Code: Select all

= Json.Document(Web.Contents("https://XXXXXXX/nagiosxi/api/v1/objects/hostavailability?apikey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&starttime="&Number.ToText(starttimeDC)&"&endtime="&Number.ToText(endtimeDC)&""))
Where starttimeDC an endtimeDC are parameters

understanding that powerquery you do not provide any support, but when i do this query the operative system create many proccess called avail.cgi

Here part of my php.ini

Code: Select all

max_execution_time = 1920
max_input_time = 4800
max_input_vars = 20000000
memory_limit = 4096M
You do not have the required permissions to view the files attached to this post.
DonForigua
Posts: 94
Joined: Thu Oct 07, 2021 8:59 pm

Re: Problem with api and power query

Post by DonForigua »

Here a exit from apache log

Code: Select all

[10/Feb/2022:11:40:37 -0500] 186.29.20.47 TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 "GET /nagiosxi/api/v1/objects/hostavailability?apikey=XXXXXXXXXXXXXXXXXXXX&starttime=1640995200&endtime=1643673600 HTTP/1.1" 1370866
[10/Feb/2022:11:40:34 -0500] 186.29.20.47 TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 "GET /nagiosxi/api/v1/objects/hostavailability?apikey=XXXXXXXXXXXXXXXXXXXXg&starttime=1640995200&endtime=1643673600 HTTP/1.1" 1370866
[10/Feb/2022:11:42:19 -0500] 186.29.20.47 TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 "GET /nagiosxi/api/v1/objects/hostavailability?apikey=XXXXXXXXXXXXXXXXXXXX&starttime=1640995200&endtime=1643673600 HTTP/1.1" 1370866
[10/Feb/2022:11:42:16 -0500] 186.29.20.47 TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 "GET /nagiosxi/api/v1/objects/hostavailability?apikey=XXXXXXXXXXXXXXXXXXXX&starttime=1640995200&endtime=1643673600 HTTP/1.1" 1370866
it seems as made the result on an infinete loop, could it be a bug?
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Problem with api and power query

Post by gsmith »

HI,

The machine 186.29.20.47 is making the same request to the Nagios API over and over. Each time Nagios receives that
request it creates a process to provide that information.

Thanks
DonForigua
Posts: 94
Joined: Thu Oct 07, 2021 8:59 pm

Re: Problem with api and power query

Post by DonForigua »

Hello

It is my machine y and i only run the power query
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Problem with api and power query

Post by gsmith »

Hi

I am not sure how power query works, but it looks like "power query" is what is in a loop, as it keeps
sending requests to the Nagios api as shown by the Nagios logs. Does "power query" have some settings
like a timeout before sending another query? My guess is that the initial query is not responding fast enough
and so "power query" sends another request.

It looks like you are requesting a months worth of data based on those time stamps. Could you
try running your query via the curl command in a CLI and see how long it takes?


Thanks
Locked