martinm76 / zabbix-pdf-report

Reporting tool in PHP for the Zabbix Monitoring Platform. Rather versatile reporting on hosts and host groups.
https://www.zabbix.com/forum/zabbix-cookbook/25368-zabbix-dynamic-pdf-report-generation?filter_time=time_lastmonth
GNU General Public License v3.0
52 stars 55 forks source link

scheduled report with email sending #4

Closed andreaconsadoriw closed 4 years ago

andreaconsadoriw commented 5 years ago

it's possible to create a scheduled report and send it via tools like swaks?

habor73 commented 5 years ago

Thank you very much for building this Martin. I'd also like to be able to schedule weekly/monthly reports by email.

jamaisx commented 5 years ago

Hi, for a quick, really dirty solution check my repository, no enough time to write down any doc... https://github.com/jamaisx/zabbix-pdf-report

psmartins commented 5 years ago

Has anyone been able to create the reports automatically and send them by email?

schneidr commented 4 years ago

When calling the script via localhost it doesn't require authentication and uses credentials from the config file instead. So generate the pdf with a curl call and send it.

curl -L -s -o /tmp/report.pdf "http://localhost/zabbix-pdf-report/createpdf.php?ReportType=hostgroup&TriggersOn=yes&GroupID=42&ReportRange=last&timePeriod=Week"
echo "Zabbix report" | mail -s "Zabbix report" -a "From: zabbix@example.org" -A /tmp/report.pdf recipient@example.org

That's all.

martinm76 commented 4 years ago

I can confirm that the curl solution works fine. I usually install the report to /report,so depending on how you install it, the URL needs some adjustment, but you should probably get the request from access_log anyway and adapt to curl after that.

medrami07 commented 3 years ago

When calling the script via localhost it doesn't require authentication and uses credentials from the config file instead. So generate the pdf with a curl call and send it.

curl -L -s -o /tmp/report.pdf "http://localhost/zabbix-pdf-report/createpdf.php?ReportType=hostgroup&TriggersOn=yes&GroupID=42&ReportRange=last&timePeriod=Week"
echo "Zabbix report" | mail -s "Zabbix report" -a "From: zabbix@example.org" -A /tmp/report.pdf recipient@example.org

That's all.

Hey sir , please when i place this script and cron , report still dosent sent automatically any modifications?

schneidr commented 3 years ago

When calling the script via localhost it doesn't require authentication and uses credentials from the config file instead. So generate the pdf with a curl call and send it.

curl -L -s -o /tmp/report.pdf "http://localhost/zabbix-pdf-report/createpdf.php?ReportType=hostgroup&TriggersOn=yes&GroupID=42&ReportRange=last&timePeriod=Week"
echo "Zabbix report" | mail -s "Zabbix report" -a "From: zabbix@example.org" -A /tmp/report.pdf recipient@example.org

That's all.

Hey sir , please when i place this script and cron , report still dosent sent automatically any modifications?

Sorry, can't help you without knowing anything about your setup. Maybe this helps you. If not, feel free to ask a question on SF.