Page 1 of 1
how to turn off automatically delete file in temp folder
Posted: Sun Jun 13, 2021 10:51 pm
by sacom01
hi,
i have two questions :
1. i found /usr/local/nagiosxi/tmp is a temp folder for Schedule Report.
Everytime send a report email, it will create a .pdf file inside /usr/local/nagiosxi/tmp folder, after send the email, files automatically will be deleted.
I want to ask : how can i turn off automatically delele file inside this folder and change it to manually delete. Where i can find this config? i want keep these file more than 1 day then manually remove.
2. when i schedule the performance graphs report, and see the Schedule report history, it usually have Error in Status column(sometime success), but mail success sent, pdf file open ok. Dont know why it happen.
thank you.
Re: how to turn off automatically delete file on temp file
Posted: Mon Jun 14, 2021 5:08 pm
by benjaminsmith
Hi
@sacom01,
On the first question, I'm pretty sure that option is set in the code, but I'll follow up with the developer to see if there are any changes to the configuration files that would change that behavior.
On your second question, I believe it's taking longer to generate and send the report, and that's why the status is not being returned as expected but it's still sending the report successfully.
Have you optimized the PHP settings on this server yet. If not, please go ahead and increase the memory, input variable, and execution time as directed in the article below, and let me know if you notice an improvement. Thanks, Benjamin
Nagios XI - Optimizing The PHP Settings File
Re: how to turn off automatically delete file in temp folder
Posted: Mon Jun 14, 2021 8:54 pm
by sacom01
hi,
"Have you optimized the PHP settings on this server yet. If not, please go ahead and increase the memory, input variable, and execution time"
--> already increased like below but still facing error status when report schedule execute.
[root@dc-nagiosxi01 ~]# cat /etc/php.ini | grep max_input_vars
max_input_vars = 100000
[root@dc-nagiosxi01 ~]# cat /etc/php.ini | grep memory_limit
memory_limit = 10240M
[root@dc-nagiosxi01 ~]# cat /etc/php.ini | grep max_execution_time
max_execution_time = 1200
"On the first question, I'm pretty sure that option is set in the code, but I'll follow up with the developer to see if there are any changes to the configuration files that would change that behavior."
--> yes pls, we need file just for daily report asap.
If unable to do that, is there anyway for get all hosts report in ONE email only, and minimize file size (pdf file)?
Now we have about 60 hosts and we need receive Performance graphs report for daily, but now nagios only support send report on everyhost, and file size about upto 4MB per host. So that's why i need get temp file in /usr/local/nagiosxi/tmp for compress and send email using crontab.
Any suggest for us in this case?
thank you.
Re: how to turn off automatically delete file in temp folder
Posted: Tue Jun 15, 2021 1:54 pm
by benjaminsmith
Hi,
Regarding the status error, what version of Nagios XI are you currently using, and what operating system (vendor and version)? We're testing this right now and have not been able to replicate the error consistently.
Also, please post the output to the log below?
Code: Select all
cat /usr/local/nagiosxi/var/wkhtmltox.log
Regarding the other question, it's not currently possible to edit the reporting scripts since they are protected by source guardian. One option would be to stagger the schedule reports to minimize the performance impact. It's also possible to export the performance graph data itself using the REST API.
We are planning to re-work the report engine in the next major release (coming soon!) for more flexibility.
Re: how to turn off automatically delete file in temp folder
Posted: Tue Jun 15, 2021 2:02 pm
by benjaminsmith
Hi,
Can you post the output to the following log as well?
Code: Select all
/usr/local/nagiosxi/var/scheduledreporting.log
Thanks,
Benjamin
Re: how to turn off automatically delete file in temp folder
Posted: Tue Jun 15, 2021 10:31 pm
by sacom01
[root@dc-nagiosxi01 ~]# cat /usr/local/nagiosxi/var/wkhtmltox.log
/usr/bin/wkhtmltopdf --javascript-delay 1000 --no-stop-slow-scripts --lowquality --no-outline --footer-spacing 3 --margin-bottom 15mm --footer-font-size 9 --footer-right "Page [page] of [toPage]" --footer-left "2021-03-04 16:17:06" -O landscape 'http://localhost/nagiosxi/includes/comp ... r_compat=1' '/usr/local/nagiosxi/tmp/exportreport-hangltt-6040a59269dbc'
Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done
[root@dc-nagiosxi01 ~]#
Attach file is tail -500 rows of schedule report log.
"Regarding the other question, it's not currently possible to edit the reporting scripts since they are protected by source guardian. One option would be to stagger the schedule reports to minimize the performance impact. It's also possible to export the performance graph data itself using the REST API."
--> can you explain more? or any document?
Re: how to turn off automatically delete file in temp folder
Posted: Wed Jun 16, 2021 10:35 am
by benjaminsmith
Hi,
Great, thank you. What version of Nagios XI are you using and the OS? We noticed that the wkhtmltox.log is not being updated (last entry was 2021-03-04 16:17:06 ), so let's check the permissions on that file.
Code: Select all
ls -l /usr/local/nagiosxi/var/wkhtmltox.log
They should be set as follows.
Code: Select all
chown nagios.nagios /usr/local/nagiosxi/var/wkhtmltox.log
chmod 666 /usr/local/nagiosxi/var/wkhtmltox.log
Also, please post the output to the following command to check the version of wkhtmltopdf on this server.
The API commands are fully documented in the interface at Help > API Docs (See API - Objects Reference). Also, can you PM a fresh 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
Re: how to turn off automatically delete file in temp folder
Posted: Wed Jun 16, 2021 8:22 pm
by sacom01
OS : redhat 7.
nagios xi : 5.8.1
[root@dc-nagiosxi01 ~]# /usr/bin/wkhtmltopdf -V
wkhtmltopdf 0.12.1.3 (with patched qt)
pls check you inbox. already pm the profile.
thanks
Re: how to turn off automatically delete file in temp folder
Posted: Thu Jun 17, 2021 1:43 pm
by benjaminsmith
Hi
@sacom01,
Got the profile, thank you. I'm able to repeat the error consistently if I have the program URL set to the wrong address in the system settings. (Also, try using the IP address instead of the FQDN). Please go to Admin > System Config > System Settings, and make sure this is set correctly.
program-url.png
Also, open up the following file.
Code: Select all
vi /usr/local/nagiosxi/html/config.inc.php
And change this line.
Code: Select all
// Force http/https
$cfg['use_https'] = false; // determines whether cron jobs and other scripts will force the use of HTTPS instead of HTTP
To this.
Code: Select all
// Force http/https
$cfg['use_https'] = true; // determines whether cron jobs and other scripts will force the use of HTTPS instead of HTTP
Then test once more. If it fails again, please run the following command from the CLI and post the output.
Code: Select all
wget --no-check-certificate -O "/usr/local/nagiosxi/tmp/scheduledreport-nagiosadmin-WXdkhWaHFGKM-1623859806-Availability_Report.pdf" 'https://<IPADDRESS>/nagiosxi//reports/availability.php?reportperiod=last24hours&startdate=&enddate=&host=&service=&hostgroup=&servicegroup=&advanced=0&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringdowntime=yes&includesoftstates=no&assumedhoststate=3&assumedservicestate=6&timeperiod=&locale=&mode=pdf&token=eb19b3f1e96c883fdc501586084b9b9b11792f65'