Nagios reports CLI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jonasdlm
Posts: 1
Joined: Tue Jan 15, 2019 8:48 am

Nagios reports CLI

Post by jonasdlm »

Hello,

Every year we have to generate reports for the management team. There are 5 hostgroups whe should generate a report from for each quarter, so 20 reports. Now we do this manuel through the webinterface, but every report takes about 1,5 hour to generate. So we would like to automate this proces.
I tried to figure this out trough the CLI. But when I tried ussing wget I always got 'Your session has timed out.' in the file. This is the command I tried:

Code: Select all

wget --user 'user' --password 'password' -O /tmp/report.csv 'https://nagiosserver/nagiosxi/reports/availability.php?reportperiod=custom&startdate=2018-01-01%2000%3A00%3A00&enddate=2018-12-31%2023%3A59%3A59&host=&service=&hostgroup=hg_ind_exchange&servicegroup=&advanced=1&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringdowntime=yes&includesoftstates=no&assumedhoststate=3&assumedservicestate=6&timeperiod=xi_timeperiod_24x7&dont_count_downtime=on&dont_count_warning=on&mode=getreport&mode=csv&csvtype=combined'
We would like to trigger this command remotely and change variables (hostgroup, timeperiod, ...), but first I need to know how to generate reports trough the CLI.

Can you guys help me out?

Thanks in advance!

Greetings,
Jonas De la Marche
Last edited by jonasdlm on Tue Feb 19, 2019 7:53 am, edited 1 time in total.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Nagios reports CLI

Post by npolovenko »

Hello, @jonasdlm. You need to enable backend token authentication by going to the Admin menu, then system settings in the left column and then clicking on the Backward Compatibility tab and checking the box that says "Allow Insecure Logins".

After that click on the username at the top right corner of the screen next to the Logout button.
Scroll down to the section "Insecure Login Settings" and check the box ->
Allow using the insecure login ticket to authenticate this user. Use by passing the username and ticket in the URL parameters.
Copy the Insecure login ticket and replace it in my command below as well as the XI IP address.
This command should generate a csv report in the /tmp/ folder.
/tmp/report.csv
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked