Nagios API URL are not constructed properly

This support forum board is for questions relating to Nagios Fusion.
Locked
gzaloprgm
Posts: 33
Joined: Mon Aug 06, 2018 8:46 am
Contact:

Nagios API URL are not constructed properly

Post by gzaloprgm »

Hi.

We have detected that some URLs that fusion uses to poll XI servers are wrong
/nagiosxi/api/v1/objects/servicestatus?fusekey=...&outputtype=xml&user=nagiosadmin&records=1000:0?brevity=1
/nagiosxi/api/v1/objects/servicestatus?fusekey=...&outputtype=xml&user=nagiosadmin&records=1000:1000&brevity=1
/nagiosxi/api/v1/objects/servicestatus?fusekey=...&outputtype=xml&user=nagiosadmin&records=1000:2000&brevity=1

/nagiosxi/api/v1/objects/hoststatus?fusekey=...&outputtype=xml&user=nagiosadmin&records=1000:0?brevity=1
/nagiosxi/api/v1/objects/hoststatus?fusekey=...&outputtype=xml&user=nagiosadmin&records=1000:1000&brevity=1
/nagiosxi/api/v1/objects/hoststatus?fusekey=...&outputtype=xml&user=nagiosadmin&records=1000:2000&brevity=1

As it can be seen, what's marked in bold is probably wrong (it should be an ampersand instead of a question mark), so right now the brevity argument is ignored for the first 1000 host/servicestatus. The other requests (starting from the record 1000) are fine and don't have that bug.
Thanks, Gonzalo
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios API URL are not constructed properly

Post by scottwilkerson »

What version of Fusion are you running? I have not been able to reproduce this
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
gzaloprgm
Posts: 33
Joined: Mon Aug 06, 2018 8:46 am
Contact:

Re: Nagios API URL are not constructed properly

Post by gzaloprgm »

Hi. I'm using latest Nagios Fusion 4.1.7, running from the downloaded ova.

The easiest way to reproduce it is to just fuse a new XI server and check its access logs (check the full image, I've highlighted the issue with red):

Image

I know this bug is only minor and does not affect the data that's being shown in most views, but it is annoying and can lead to unusual bugs if you want to develop your own polling callbacks.

Thanks, Gonzalo
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios API URL are not constructed properly

Post by scottwilkerson »

I understood what you were mentioning but when trying to replicate this I get all &brevity=1 in the logs

Code: Select all

"GET /nagiosxi/api/v1/objects/hoststatus?fusekey=...&outputtype=xml&user=nagiosadmin&records=1000:0&brevity=1 HTTP/1.1" 200 129669
"GET /nagiosxi/api/v1/objects/hoststatus?fusekey=...&outputtype=xml&user=nagiosadmin&records=1000:1000&brevity=1 HTTP/1.1" 200 67
"GET /nagiosxi/api/v1/objects/servicestatus?fusekey=...&outputtype=xml&user=nagiosadmin&records=1000:0&brevity=1 HTTP/1.1" 200 1387730
"GET /nagiosxi/api/v1/objects/servicestatus?fusekey=...&outputtype=xml&user=nagiosadmin&records=1000:1000&brevity=1 HTTP/1.1" 200 73
"GET /nagiosxi/api/v1/objects/hoststatus?fusekey=...&outputtype=xml&user=nagiosadmin&records=1000:0&brevity=1 HTTP/1.1" 200 129660
"GET /nagiosxi/api/v1/objects/hoststatus?fusekey=...&outputtype=xml&user=nagiosadmin&records=1000:1000&brevity=1 HTTP/1.1" 200 67
"GET /nagiosxi/api/v1/objects/servicestatus?fusekey=...&outputtype=xml&user=nagiosadmin&records=1000:0&brevity=1 HTTP/1.1" 200 1387767
"GET /nagiosxi/api/v1/objects/servicestatus?fusekey=...&outputtype=xml&user=nagiosadmin&records=1000:1000&brevity=1 HTTP/1.1" 200 73
Did you add a custom polling callback that could be causing this?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
gzaloprgm
Posts: 33
Joined: Mon Aug 06, 2018 8:46 am
Contact:

Re: Nagios API URL are not constructed properly

Post by gzaloprgm »

scottwilkerson wrote: Did you add a custom polling callback that could be causing this?
No, I'm using the nagiosfusion-4.1.7-64.ova as-is. I've also tried installing it manually using an Centos 7 appliance (from osboxes.org) and the same thing happens.
I will try to record a screen capture video, so that you can check and see if I'm doing anything wrong.
Thanks, Gonzalo
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios API URL are not constructed properly

Post by scottwilkerson »

My initial testing was on a CentOS 6 system where I couldn't re-create the issue, but since your last post I spun up the OVA and can replicate the issue.

This has been send to our development team to look at to be fixed in a future release.

Thanks for working with us on this, I suspect it is a difference in how php handles some functions between versions.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked