Service Availability report not generating any data

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
pavan509
Posts: 72
Joined: Fri Apr 30, 2021 7:07 am

Service Availability report not generating any data

Post by pavan509 »

Hello Team,

When I run the reports and download it, getting the required information without any issues. For the scheduled reports, getting the host level availability report without any issues, but seeing the error "Availability data is not available when monitoring engine is not running." in the service availability reports. Attached is the snippet of the error for reference.

Please advise on this issue.
You do not have the required permissions to view the files attached to this post.
Thanks, Pavan
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Service Availability report not generating any data

Post by pbroste »

Hello @pavan509

Thanks for reaching out and providing the details. Appears that the nagios monitoring service is not running.

We want to run through this and please pay close attention to see if any errors *(for example, cfg issues) that could be causing issues. Run the following:

Code: Select all

service nagios stop

Code: Select all

killall -9 nagios       or           pkill nagios

Code: Select all

service nagios start

Code: Select all

/usr/local/nagiosxi/scripts/reconfigure_nagios.sh
Then:

Code: Select all

service nagios start
Please check to verify that the nagios service is running by:

Code: Select all

systemctl status nagios
If you see that the service is not running please send along the Nagios System Profile:
To send us your system profile.
  • Login to the Nagios XI GUI using a web browser.
  • Click the "Admin" > "System Profile" Menu
  • Click the "Download Profile" button
  • Save the profile.zip file and share
Thanks,
Perry
pavan509
Posts: 72
Joined: Fri Apr 30, 2021 7:07 am

Re: Service Availability report not generating any data

Post by pavan509 »

Hello Perry,

I have followed your instructions and restarted the Nagios service. Getting the reports as attachments via email but the reports seem to be blank. I have sent the system profile via PM to you. Kindly review it and advise on how to proceed further.
Thanks, Pavan
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Service Availability report not generating any data

Post by pbroste »

Hello @pavan509

Thanks for taking the time to send over the System Profile. As you know the Service Availability report is generated from Nagios logs report pulling from the date on the file name. We are wondering if logrotation is not working or possibly other reasons. Would like to get the following system information from this one-liner (copy/paste command)

Code: Select all

ls -alR /usr/local/nagios/var/ > results.txt && ls -al /usr/local/nagios/var/ >> results.txt && cat /usr/local/nagios/etc/nagios.cfg | grep log_archive_path >> results.txt && grep '' /etc/logrotate.d/* >> results.txt && cat /etc/logrotate.conf >> results.txt && /usr/local/nagios/bin/nagios -V >> results.txt && /usr/sbin/logrotate -v /etc/logrotate.d/nagiosxi >> results.txt
Please send us the results.txt when you get a chance.

Thanks,
Perry
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Service Availability report not generating any data

Post by ssax »

I think you are hitting a bug that was fixed in XI 5.8.5:
5.8.5 - 07/15/2021

Fixed issue when generating PDFs (and auth tokens in general) on usernames with uppercase letters in them [TPS#15542] -JO
Taken from here:

https://www.nagios.com/downloads/nagios-xi/change-log/

You can upgrade to XI 5.8.5 OR to fix your version you can edit this file:

Code: Select all

/usr/local/nagiosxi/html/includes/auth.inc.php
Change this (around line 231):

Code: Select all

        $_SESSION["username"] = strtolower($username);
To this:

Code: Select all

        $_SESSION["username"] = $username;
pavan509
Posts: 72
Joined: Fri Apr 30, 2021 7:07 am

Re: Service Availability report not generating any data

Post by pavan509 »

Hello Perry,

Please find the logs result file as attached from the one-liner command which you have provided.

@ssax,

The solution provided for you worked for one-time scheduled reports but not working for the weekly/monthly scheduled reports.
You do not have the required permissions to view the files attached to this post.
Thanks, Pavan
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Service Availability report not generating any data

Post by ssax »

Try creating a new scheduled report and see if that works.

Run this command as root and leave it running:

Code: Select all

tail -Fn0 /var/log/httpd/error_log /var/log/httpd/ssl_error_log /usr/local/nagiosxi/var/wkhtmltox.log
Then send one of the failing scheduled reports and send the full output of the still running tail command after it has failed.
pavan509
Posts: 72
Joined: Fri Apr 30, 2021 7:07 am

Re: Service Availability report not generating any data

Post by pavan509 »

Hello @ssax,

I have scheduled a new report and let it run, no issues observed so far. However, when I try to run the old scheduled reports, getting the same error as mentioned at the starting of this thread. Below is the output of the command which you have provided when I ran the old scheduled report.

Code: Select all

--2021-09-06 07:39:21--  https://socavailmonitor2.schneider-electric.com/nagiosxi//reports/availability.php?reportperiod=lastweek&startdate=&enddate=&host=&service=&hostgroup=&servicegroup=&advanced=1&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringdowntime=yes&includesoftstates=no&assumedhoststate=3&assumedservicestate=6&timeperiod=&locale=en_US&mode=csv&csvtype=host&token=058a6244f90c725b8ff14b6d652b81887e813735
Resolving socavailmonitor2.schneider-electric.com (socavailmonitor2.schneider-electric.com)... 10.236.177.248
Connecting to socavailmonitor2.schneider-electric.com (socavailmonitor2.schneider-electric.com)|10.236.177.248|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/octet-stream]
Saving to: '/usr/local/nagiosxi/tmp/scheduledreport-ADM615438-MSVhAbuNSjoh-1630939161-Host_Availability.csv'

     0K .......... .                                            915K=0.01s

2021-09-06 07:39:22 (915 KB/s) - '/usr/local/nagiosxi/tmp/scheduledreport-ADM615438-MSVhAbuNSjoh-1630939161-Host_Availability.csv' saved [12251]

--2021-09-06 07:39:22--  https://socavailmonitor2.schneider-electric.com/nagiosxi//reports/availability.php?reportperiod=lastweek&startdate=&enddate=&host=&service=&hostgroup=&servicegroup=&advanced=1&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringdowntime=yes&includesoftstates=no&assumedhoststate=3&assumedservicestate=6&timeperiod=&locale=en_US&mode=csv&csvtype=service&token=39bb311938c574b9ab91391b09303fc1e2e3fd04
Resolving socavailmonitor2.schneider-electric.com (socavailmonitor2.schneider-electric.com)... 10.236.177.248
Connecting to socavailmonitor2.schneider-electric.com (socavailmonitor2.schneider-electric.com)|10.236.177.248|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/octet-stream]
Saving to: '/usr/local/nagiosxi/tmp/scheduledreport-ADM615438-MSVhAbuNSjoh-1630939162-Service_Availability.csv'

     0K .......... .......... .......... .......... .......... 22.8M
    50K .......... .......... .......... .......... .......... 18.7M
   100K .......... .......... .......... .......... .......... 19.1M
   150K .......... .......... .......... .......... .......... 19.0M
   200K .......... .......... .......... .......... .......... 16.7M
   250K .......... .......... .......... .......... .......... 19.1M
   300K ..........                                              261K=0.05s

2021-09-06 07:39:28 (5.53 MB/s) - '/usr/local/nagiosxi/tmp/scheduledreport-ADM615438-MSVhAbuNSjoh-1630939162-Service_Availability.csv' saved [317739]
Kindly advise what went wrong and also let me know if I need to recreate all the scheduled reports.
Thanks, Pavan
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Service Availability report not generating any data

Post by ssax »

Please PM me this file:

Code: Select all

/var/spool/cron/apache
pavan509
Posts: 72
Joined: Fri Apr 30, 2021 7:07 am

Re: Service Availability report not generating any data

Post by pavan509 »

Hello ssax,

I have shared the file with you via PM. Kindly review it and advise.
Thanks, Pavan
Locked