Thruk
Thruk copied to clipboard
Thruk v3.02 - Report not rendering PDFs & Emails not working
Describe the bug I am running Thruk & Naemon in an AlmaLinux container - trying to use the Report functionality to email an active Service problems report every day based on a URL and am having 2 problems:
- Report does not render PDFs
I'm using the URL:
/thruk/cgi-bin/status.cgi?host=all&servicestatustypes=28
The report renders fine in HTML, but is about 15MB; not suitable for emails. I switched to PDFs and the generated file is 3 pages of white space with a couple of navigation elements (scrollbars etc); no service information.
I've tried using the absolute URL https://servername:port/thruk/cgi-bin/status.cgi?host=all&servicestatustypes=28 but the behaviour is the same.
- Report is not emailed Emails from Naemon work fine, but the report emails do not. I have sendmail configured on the server to use our internal mail relay and testing it using 'echo "test" | sendmail -s subject [email protected]' works fine. Using the "Send Report By Email" feature results in a page hang for 1 minute, then returns to the reports page with no errors on screen. See Thruk log below.
Thruk Version 3.02
To Reproduce Steps to reproduce the behavior:
- Create a report like this with the URL /thruk/cgi-bin/status.cgi?host=all&servicestatustypes=28
- Create a report preview with PDF disabled and view - it works, but is around 15MB
- Create a report preview with PDF enabled and view - it creates a blank page with navigation elements displayed
- Click Send Report By Email and email the report - the UI loads for about 60 seconds, then returns to the Reports page - no email is received
Expected behavior Report PDF is generated correctly Email is sent
Additional context Thruk.log showing the long running task:
[2023/04/19 10:51:59][423247e9e57f][WARN] slow_page_log_threshold (15s) hit, page took 60.4s to load. [2023/04/19 10:51:59][423247e9e57f][WARN] page: https://xxxxxxxxxxxxxx/thruk/cgi-bin/reports2.cgi [2023/04/19 10:51:59][423247e9e57f][WARN] params: {'CSRFtoken' => '...','action' => 'email','cc' => '','desc' => 'Summary of xxxxxxxx','js' => 'no','language' => 'en','minimal' => 'yes','nav' => 'no','pdf' => 'yes','report' => '2','send' => '1','subject' => 'Report: Daily DDI M... [2023/04/19 10:51:59][423247e9e57f][WARN] user: xxxxxxxxxx [2023/04/19 10:51:59][423247e9e57f][WARN] address: xxxxxxxxxx [2023/04/19 10:51:59][423247e9e57f][WARN] +----------------------------------------------------------------------------------+-------------+ [2023/04/19 10:51:59][423247e9e57f][WARN] | total time | 60.34885s | [2023/04/19 10:51:59][423247e9e57f][WARN] +----------------------------------------------------------------------------------+-------------+ [2023/04/19 10:51:59][423247e9e57f][WARN] | _dispatcher: https://xxxxxxxxxxxxxxxl/thruk/cgi-bin/reports2.cgi | 60.34860s | [2023/04/19 10:51:59][423247e9e57f][WARN] | time: Wed Apr 19 10:50:59 2023 - host: 423247e9e57f - pid: 15947 - req: 1752 | | [2023/04/19 10:51:59][423247e9e57f][WARN] | Root begin | 0.00730s | [2023/04/19 10:51:59][423247e9e57f][WARN] | User::set_dynamic_attributes | 0.00077s | [2023/04/19 10:51:59][423247e9e57f][WARN] | Thruk::Controller::reports2::index | 60.33884s | [2023/04/19 10:51:59][423247e9e57f][WARN] | AddDefaults::add_defaults(ADD_CACHED_DEFAULTS) | 0.23508s | [2023/04/19 10:51:59][423247e9e57f][WARN] | AddDefaults::get_proc_info | 0.23036s | [2023/04/19 10:51:59][423247e9e57f][WARN] | AddDefaults::set_processinfo | 0.23002s | [2023/04/19 10:51:59][423247e9e57f][WARN] | AddDefaults::set_processinfo fetch | 0.22925s | [2023/04/19 10:51:59][423247e9e57f][WARN] | _do_on_peers(get_processinfo) | 0.22788s | [2023/04/19 10:51:59][423247e9e57f][WARN] | _get_result_parallel(328c5,6680b,00a4c,9bce3,5214a,5090a,eb527,b | 0.22737s | [2023/04/19 10:51:59][423247e9e57f][WARN] | slowest site: 5090a -> 0.2091 | | [2023/04/19 10:51:59][423247e9e57f][WARN] | _merge_answer() | 0.00019s | [2023/04/19 10:51:59][423247e9e57f][WARN] | Utils::Menu::read_navigation() | 0.00340s | [2023/04/19 10:51:59][423247e9e57f][WARN] | Utils::Reports::get_report_templates() | 0.02291s | [2023/04/19 10:51:59][423247e9e57f][WARN] | render: get_variable.tt | 0.00164s | [2023/04/19 10:51:59][423247e9e57f][WARN] | render: get_variable.tt | 0.00145s | [2023/04/19 10:51:59][423247e9e57f][WARN] | render: get_variable.tt | 0.00162s | [2023/04/19 10:51:59][423247e9e57f][WARN] | render: get_variable.tt | 0.00153s | [2023/04/19 10:51:59][423247e9e57f][WARN] | render: get_variable.tt | 0.00153s | [2023/04/19 10:51:59][423247e9e57f][WARN] | render: get_variable.tt | 0.00208s | [2023/04/19 10:51:59][423247e9e57f][WARN] | render: get_variable.tt | 0.00152s | [2023/04/19 10:51:59][423247e9e57f][WARN] | render: get_variable.tt | 0.00150s | [2023/04/19 10:51:59][423247e9e57f][WARN] | render: get_variable.tt | 0.00152s | [2023/04/19 10:51:59][423247e9e57f][WARN] | render: get_variable.tt | 0.00153s | [2023/04/19 10:51:59][423247e9e57f][WARN] | render: get_variable.tt | 0.00135s | [2023/04/19 10:51:59][423247e9e57f][WARN] | render: get_variable.tt | 0.00073s | [2023/04/19 10:51:59][423247e9e57f][WARN] | Utils::Reports::report_send() | ~60.07724s | [2023/04/19 10:51:59][423247e9e57f][WARN] | render: get_variable.tt | 0.00077s | [2023/04/19 10:51:59][423247e9e57f][WARN] | render: get_variable.tt | 0.00072s | [2023/04/19 10:51:59][423247e9e57f][WARN] | render: get_variable.tt | 0.00108s | [2023/04/19 10:51:59][423247e9e57f][WARN] | render: get_variable.tt | 0.00112s | [2023/04/19 10:51:59][423247e9e57f][WARN] | render: reports/report_from_url.tt | 0.00135s | [2023/04/19 10:51:59][423247e9e57f][WARN] | Root end | 0.00160s | [2023/04/19 10:51:59][423247e9e57f][WARN] | finalize_request | 0.00025s | [2023/04/19 10:51:59][423247e9e57f][WARN] +----------------------------------------------------------------------------------+-------------+ [2023/04/19 10:51:59][423247e9e57f][WARN] | total time waited on backends | 0.22717s | [2023/04/19 10:51:59][423247e9e57f][WARN] | total time waited on rendering | 0.00000s | [2023/04/19 10:51:59][423247e9e57f][WARN] | total time | 60.34885s | [2023/04/19 10:51:59][423247e9e57f][WARN] +----------------------------------------------------------------------------------+-------------+