Page 1 of 1

Nagiosxi availability from command line

Posted: Sun Jul 18, 2021 8:20 am
by mejokj
Hello,

We need to get availability of the hosts from command line. Kindly help us to get the same.

Re: Nagiosxi availability from command line

Posted: Mon Jul 19, 2021 10:09 am
by benjaminsmith
Hi @mejokj,

A couple of questions to help narrow this down some more.

1. Are you looking to get the Availability report using the command line instead of the GUI?

2. Or, are you wanting to pull status information on the state of a host using the command line? If this is the case, then the REST API can handle this task. Navigate to Help > API Docs > Objects Reference and take a look at GET GET objects/hoststatus

Regards,
Benjamin

Re: Nagiosxi availability from command line

Posted: Sun Jul 25, 2021 12:11 am
by mejokj
Hello

Yes Iam trying to get availability report from command line instead of GUI for a specific time period like last 24 hours like that.

Re: Nagiosxi availability from command line

Posted: Mon Jul 26, 2021 11:19 am
by vtrac
Hi,
How are you doing?
I followed the example from the below URL (Nagios Exchange) page:
https://exchange.nagios.org/directory/A ... df/details

Here's the command I came up with, getting the availability report for "localhost":
NOTE: please replace "XXXX" with your nagiosadmin's password and "x.x.x.x" is your Nagios IP address.
PDF output file is in "/tmp"

Code: Select all

/usr/bin/wkhtmltopdf --username nagiosadmin --password XXXX "https://x.x.x.x/nagios/cgi-bin/avail.cgi?show_log_entries=&host=localhost&timeperiod=last24hours" /tmp/last24.pdf

Best Regards,
Vinh