Nagiosxi availability from command line

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mejokj
Posts: 353
Joined: Mon Jul 22, 2013 10:31 pm

Nagiosxi availability from command line

Post by mejokj »

Hello,

We need to get availability of the hosts from command line. Kindly help us to get the same.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Nagiosxi availability from command line

Post 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
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!
mejokj
Posts: 353
Joined: Mon Jul 22, 2013 10:31 pm

Re: Nagiosxi availability from command line

Post 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.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Nagiosxi availability from command line

Post 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
Locked