API or CLI host list

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
dariusz.nalazek
Posts: 39
Joined: Thu Nov 16, 2017 6:46 am

API or CLI host list

Post by dariusz.nalazek »

Hello.

How to list servers or even better server’s group (host lists) using API?
Or save https://nagios_logsever_server/nagioslogserver/reports/hosts to csv report file from CLI (bash script)…

I can't find it in online documentation :(

DarekN.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: API or CLI host list

Post by benjaminsmith »

HI DarekN,

That's a good question, and I can double-check this as well, but the best option is to use hosts report as CSV to retrieve this information.

Benjamin

As a future reference and to supplement what's in the gui documentation, the following page as some handy API examples for Log Server.
https://support.nagios.com/kb/article/n ... s-596.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
dariusz.nalazek
Posts: 39
Joined: Thu Nov 16, 2017 6:46 am

Re: API or CLI host list

Post by dariusz.nalazek »

Yes please, check it out.
I wish to get some automation to receive these data.
Manual download is good only from time to time, not for daily monitoring of amount of hosts registered or/and sending data.

DarekN.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: API or CLI host list

Post by benjaminsmith »

Hi DarekN,

I looked into this and right now it's possible to pull reports from the API.

Let me know if you have any other questions.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
dariusz.nalazek
Posts: 39
Joined: Thu Nov 16, 2017 6:46 am

Re: API or CLI host list

Post by dariusz.nalazek »

Great,

but where I can find full API command references for Nagios LS? …or at last the part with listing servers (or pulling report, as u mentioned).
On the examples web page there is no info about listing servers... and I can’t find API documentation on website.

DarekN.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: API or CLI host list

Post by benjaminsmith »

Hi DarekN,

You'll find the API reference in the user interface, just go to Help > References > API Reference.

Let me know if you have any more questions.

Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
dariusz.nalazek
Posts: 39
Joined: Thu Nov 16, 2017 6:46 am

Re: API or CLI host list

Post by dariusz.nalazek »

I was hoping more straightforward answer then riddles :D ..since you checked it out and posted it's there.

Help > References > API Reference, It's usefull information, there is description how to access alarm history, logstash log, dashboards, ...but I can't see any clue how to get host raport or json dictionary with host list.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: API or CLI host list

Post by benjaminsmith »

HI,

Apologies for any confusion. As mentioned, it's not possible to generate that type of report from the API. The best workaround would be to download the unique hosts report as a CSV file.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
dariusz.nalazek
Posts: 39
Joined: Thu Nov 16, 2017 6:46 am

Re: API or CLI host list

Post by dariusz.nalazek »

benjaminsmith wrote:(...)
I looked into this and right now it's possible to pull reports from the API.
(...)
OK, I see, so it's not possible after all.

It would be nice feature for monitoring purposes, maybe you could post it to LS road map as customer request/idea/vote.

Thank you for help, and information.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: API or CLI host list

Post by benjaminsmith »

Hi,

No problem. I put in an internal feature request on your behalf for this capability.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked