Page 1 of 1

Scheduled reports not being sent

Posted: Mon Aug 05, 2019 10:01 am
by gwakem
RHEL 7.6
XI 5.6.5

Hey all, I have an issue with scheduled reports not running. I can invoke a scheduled report and tell it to run manually with no issues, but if I schedule it in advance, it doesn't run and doesn't show up as even attempting in maillog.

Permissions on the folder and files look ok as far as I would expect:

Code: Select all

10:48:13 [root@xi var]# ll /usr/local/nagiosxi/html/includes/components/ |grep scheduledreporting
drwxr-xr-x  2 nagios nagios  136 Feb  7 08:57 scheduledreporting
10:48:19 [root@xi var]# ll /usr/local/nagiosxi/html/includes/components/scheduledreporting
total 612K
drwxr-xr-x  2 nagios nagios  136 Feb  7 08:57 .
drwxr-xr-x 71 nagios nagios 4.0K Jul 18 10:11 ..
-rw-r--r--  1 nagios nagios 2.4K Jul 29 08:17 CHANGES.txt
-rw-r--r--  1 nagios nagios 159K Jul 29 08:17 manage.php
-rw-r--r--  1 nagios nagios  774 Jun 21  2016 sanity.sh
-rw-r--r--  1 nagios nagios  24K Jul 29 08:17 scheduledreporting.inc.php
-rw-r--r--  1 nagios nagios 317K Jul 29 08:17 schedulereport.php
-rw-r--r--  1 nagios nagios  95K Jul 29 08:17 sendreport.php
Any ideas of what I can check?

Re: Scheduled reports not being sent

Posted: Mon Aug 05, 2019 10:17 am
by scottwilkerson
It should show in here

Code: Select all

tail -50 /usr/local/nagiosxi/var/scheduledreporting.log

Re: Scheduled reports not being sent

Posted: Mon Aug 05, 2019 11:45 am
by gwakem
Odd:

Code: Select all

-rw-r--r--  1 nagios nagios 1.6K Jul  1 12:09 scheduledreporting.log.1.gz
It looks like the first entry in that rolled log is from June 21st, and the last is July 1st (obvs.) No regular log has been written to.

I have been testing the scheduled reports since before August 1st, so I would expect to see failures at least, but no log at all. I've checked /etc/crontab and such, based on the info I found in the rolled logs, and that all looks fine. I created the scheduledreporting.log, assigned the permissions, scheduled a report for two minutes in the future, let it run and... nothing. I selected the "send now" action, and still no output to the log. I did get the email with attached report however.

Re: Scheduled reports not being sent

Posted: Mon Aug 05, 2019 12:01 pm
by scottwilkerson
It doesn't seem like the actual file even exists.

Lets do this:

Code: Select all

touch /usr/local/nagiosxi/var/scheduledreporting.log
chown nagios.nagios /usr/local/nagiosxi/var/scheduledreporting.log
chmod ug+rw /usr/local/nagiosxi/var/scheduledreporting.log

Re: Scheduled reports not being sent

Posted: Mon Aug 05, 2019 1:02 pm
by gwakem
Sorry, it may have gotten lost in the text above, but I did that in my last post, and then tested another scheduled run a few minutes out, as well as forcing it to run from the scheduled report screen after the time passed. Nothing was written to the log. Here is the log I created, which is exactly in line with what you asked:

Code: Select all

# ll /usr/local/nagiosxi/var/scheduledreporting.log
-rw-rw-r-- 1 nagios nagios 0 Aug  5 12:33 /usr/local/nagiosxi/var/scheduledreporting.log

Re: Scheduled reports not being sent

Posted: Mon Aug 05, 2019 1:08 pm
by scottwilkerson
Hmm, these cron jobs are usually kicked off by the apache cron located at

Code: Select all

/var/spool/cron/apache
Are there any errors in the cron log?

Code: Select all

grep apache /var/log/cron
Did the apache user somehow get added to the cron.deny ?

Re: Scheduled reports not being sent

Posted: Tue Aug 06, 2019 8:17 am
by gwakem
There is no /etc/cron.deny on the system, but I did find these errors in the cron log:

Code: Select all

Aug  6 09:02:37 xi crontab[10445]: (apache) AUTH (crontab command not allowed)
This information led me down the path to the fix. after some testing on various things, I found I had to put apache in cron.allow, and that corrected the issue. Thank you for your help.. this can be closed up.

Re: Scheduled reports not being sent

Posted: Tue Aug 06, 2019 9:04 am
by scottwilkerson
gwakem wrote:There is no /etc/cron.deny on the system, but I did find these errors in the cron log:

Code: Select all

Aug  6 09:02:37 xi crontab[10445]: (apache) AUTH (crontab command not allowed)
This information led me down the path to the fix. after some testing on various things, I found I had to put apache in cron.allow, and that corrected the issue. Thank you for your help.. this can be closed up.
Great!

Locking