NAME

Thruk::Utils::Reports - Utilities Collection for Reporting

DESCRIPTION

Utilities Collection for Reporting

METHODS

get_report_list

get_report_list($c, [$noauth], [$nr])

return list of all reports for this user

get_report

get_report_list($c, $nr, [$noauth])

return report for given id

report_show

report_show($c, $nr)

generate and show the report

report_send

report_send($c, $nr, [$skip_generate, $to, $cc, $subject, $desc])

generate and send the report

return values are:

-2 : nothing to do, report runs on another cluster node already
 0 : report failed
 1 : report sucessful and mail was sent
 2 : report generated, no mail send because of thresholds not hit

report_save

report_save($c, $nr, $data)

save a report

report_remove

report_remove($c, $nr)

remove report

generate_report

generate_report($c, $nr)

generate a new report

queue_report

queue_report($c, $nr, [$mail])

queue a report for update. returns true if report got queued.

queue_report_if_busy

queue_report_if_busy($c, $nr, [$mail])

Queue a report for update. Queue will only be used if all slots are busy. Returns 1 if queue is used or undef if there are free slots.

generate_report_background

generate_report_background($c, $report_nr, $with_mails, $report, $force, $debug)

start a report in the background and queue it if all slots are busy

get_report_data_from_param

get_report_data_from_param($params)

return report data for given params

update_cron_file

update_cron_file($c)

update reporting cronjobs

set_running

set_running($c, $nr, [$val])

  $val can be
      * 0 to indicate the report is finished
      * pid of the report generating process

update running state of report

set_waiting

set_waiting($c, $nr, $with_mails)

set waiting status of job

clean_report_tmp_files

clean_report_tmp_files($c, $nr)

remove any tmp files from this report

get_report_templates

get_report_templates($c)

return available report templates

get_report_languages

get_report_languages($c)

return available report languages

add_report_defaults

add_report_defaults($c, [$fields], $report)

add report defaults

get_running_reports_number

get_running_reports_number($c)

returns list ($running, $waiting)

get_new_report

get_new_report($c, [$data])

returns default report data

store_report_data

store_report_data($c, $nr, $data)

writes report to disk

read_report_file

read_report_file($c, $nr, [$rdata, $noauth, $simple])

returns report

normalize_required_field

normalize_required_field($c, $field)

returns normalized field structure, convert old array list into hash structure

check_for_waiting_reports

check_for_waiting_reports($c)

works on next queued report

returns nothing

apply_report_parameters

apply_report_parameters($c, $to, $from)

set report parameters into target hash

returns target hash

get_report_themes

get_report_themes($c)

returns list of themes which have a 'stylesheets/*reports.css' file.