OPNsense Forum

English Forums => Zenarmor (Sensei) => Topic started by: Meg on December 26, 2024, 08:31:14 PM

Title: Cron job for email sheduled reports
Post by: Meg on December 26, 2024, 08:31:14 PM
Hello. On the Opnsense Gui under cron jobs dropdown list there is a cron job for Zenarmor email Sheduled Reports. I have email scheduled reports working daily in Zenarmor settings, but was trying to set the cron job to get a report every 12 hours. The cron job seems to be ignored and I only get a report once a day at the time set in Zenarmor scheduled reports settings. Does anyone know why this cron job doesn't work? I didn't make it, it was already in the dropdown list of cron jobs.
Title: Re: Cron job for email sheduled reports
Post by: IHK on December 27, 2024, 12:24:44 PM
Zenarmor allows configuring report frequency only as daily, weekly, or monthly. Therefore, there is no direct setting to receive reports every 12 hours. However, you can manually set up a cron job in System > Settings > Cron to run the Zenarmor reporting script:

/usr/local/opnsense/scripts/OPNsense/Zenarmor/report-gen/send.py

Setting Up a Cron Job

1 - Go to System > Settings > Cron.
2 - Add a new cron job.
3 - Use the above command and set the schedule to 0 */12 * * * for every 12 hours.

Avoid Conflicts

Ensure the cron job does not overlap with Zenarmor's internal reporting schedule.
For example, if Zenarmor generates daily reports, set the cron job at a different time.

Alternative Solutions

1 - Syslog Integration: Export logs to a syslog server for analysis every 12 hours. Refer to the Zenarmor Syslog Integration documentation.
2 - API Usage: If you have technical expertise, use the Zenarmor API to create a custom script that generates reports every 12 hours.

For more information, check out the Zenarmor Documentation or contact our support team.
Title: Re: Cron job for email sheduled reports
Post by: Meg on December 27, 2024, 05:44:47 PM
Thanks. I Have the cron job working now. This post can be marked solved
Title: Re: Cron job for email sheduled reports
Post by: IHK on December 28, 2024, 10:15:12 AM
I'm glad to hear that your issue has been resolved! Thank you for your feedback.
If you need any further assistance, please don't hesitate to reach out.

Wishing you a great day!