New Reports addon

@roberto & Co. :wink:

Spent some time, over these errors. :face_with_peeking_eye:
It took me a long time because I am not a programmer. :wink:

It seems that the cause of these messages is unsent messages.

The DMA is trying to send them, but due to previous errors and fails.

===

What I did.

  1. created files

/var/mail/root
/var/mail/nobody

After this action, the above errors stopped appearing.

  1. added to the file /var/ipfire/reports/send_mail.sh
# Get sender email 
SENDER=$(grep -E '^SENDER=' "$MAIL_CONF" | head -n1 | cut -d'=' -f2- | tr -d ' ')
if [[ -z "$SENDER" ]]; then
echo "Error: No se encontró SENDER en $MAIL_CONF" >&2
exit 1
fi

the following line

} | $SENDMAIL -t

I changed to

} | $SENDMAIL -f $SENDER -t

===

After these changes

1 in the file `/var/ipfire/dma/ I removed the line “MASQUERADE”

2 I deleted the files

/var/mail/root
/var/mail/nobody

3 I did a test of sending reports

The test looks successful. :smiley:

===

Could someone with more proramist experience check the correctness of the changes made?

Best Regards

2 Likes

@roberto Hi, Just installed this add-on and I must say, well one!! Works perfectly and looks great. I like the top 10 lists. Really appreciate the work you put into this, thank you so much.

1 Like

Roberto this is fantastic! Thank you!!

IPFire Ver 229.196

1 Like

Please start giving your releases version numbers.

Hi @xperimental.

My mistake was not starting with versions every time I posted an updated file. I’m sorry.

@tphz great work on your contribution. I’ve already added it, and here’s the latest version, which I hope is “final” (for now). Over time, I’ll be adding more reports to the add-on.

reports(final).ipfire.tgz.zip (35,2 KB)

I’m sorry I couldn’t reply sooner; I’ve been away for a few days.

Best regards, and thank you all for your contributions.

2 Likes

Roberto, I just installed this. Excellent work. Everything works as intended. The only question I have is what the “Activate Sending Task” checkbox does. Does this schedule an automatic report generation and sending at certain times? I played with it and can’t figure out how it works. I don’t see a place where I can schedule a certain day or time.

Thanks!

edit: I also just noticed that the subject line of the sent email is not translated to English (Informes del systema IPFire), nor is the text at the top of the email body (Informe de Firewall)

Neither is a big deal, but I suppose you might want to fix that at some point when you’ve got nothing else to do. :slight_smile:

1 Like

Hi @bloater99.

As for how the shipping tasks work, I’ve tried to make them as simple as possible. Let me explain.

When you select the report scope as “Hour,” it generates a report with information for one hour, and if you select the “Activate sending task” box, it sends that report every hour. When you select the “Day” scope, it generates a report with information for one day, and if you select the “Activate sending task” box, it sends that report every day. And so on for the rest: “Week” every week and “Month” every month. It doesn’t make sense to generate it every “Hour” and then send it to you once a day.

As for the other thing you mentioned, I didn’t notice. I’ll look into it as soon as possible.

Bye

1 Like

Also, I just noticed this. Yesterday at about 11:00 am I set up a “Day” report. I received the report at 11am. This morning when I woke up, I had a report in my inbox that was delivered at 01:25 am. That is approximately 14-15 hours, which is neither an hour, nor a day. Is that normal?

Hi again @bloater99.

Let me tell you how this “scheduled tasks” thing works. It turns out I couldn’t find a way to create them with fcrontab, and the only way I could find to do them is this way (a bit creative, hehe).

Okay. When you select a “scope” (Hour, Day, etc.), an existing file in /var/reports/ called “settings” is modified, which sets the corresponding line to “off” or “on” if it’s “Hour,” “Day,” etc. Then, there are some scripts in “fcron.XXXX” that check if the “settings” from before has an “off” or “on” value, and depending on which one, the corresponding fcron.XXXX is launched. The scripts found in “fcron.xxxx” are “scheduler_hourly,” “scheduler_daily,” “scheduler_weekly,” and “scheduler_monthly.”

Now, I don’t know how to manage the sending of “fcron.XXXX”, but I’m sure someone on the forum will tell us how it goes.

A bit creative, don’t you think?

2 Likes

@roberto , @bloater99

the processing is ok. I don’t know another easy way to do this. :wink:

About the times

  • I didn’t check why a daily report is send 1 hour after installation. Maybe the Reports WUI page just release an actual report.
  • The times for periodic task in fcron are
    • 01:25 for daily
    • 02:47 for weekly
    • 03:57 for monthly
    • xx:01 for hourly

as you can see by fcrontab -l. The reports are generated by the runparts mechanism of IPFire.

2 Likes

Hello everyone!!!

Good news! I’ve added a new RPZ report. I’ve used version “rpz-beta-0.1.18-18.ipfire.tar.” I don’t know if there’s a later version, but it uses the “rpz-metrics” command located in “/usr/sbin”.

I’ve also improved the IDS report, and it now uses the “location lookup” command to input countries.

reports.ipfire.tgz.zip (45,8 KB)

If it is not installed, it will not appear on the “Reports” page.

Will you try it and let me know?

Thank you very much.

2 Likes

Hi @Roberto,

I just discovered your Reports add-on…

Great idea, and congratulations on your work and sharing it with the community !

Already tested and approved, I took the opportunity to translate it into French (from the last updated EN translation file).
reports.fr.zip (978 Octets)

Kind regards and keep delighting us !

2 Likes

Thanks @steph78630 for the translation file.

I’ll add it. Thanks for trying it out.

This add-on will supposedly not be affected by future updates, as I’ve tried to make it as independent of IPFire as possible. It will only be affected if the location of the log files changes.

I imagine it will also be affected when IPFire version 3.0 is released :wink:

Bye.

1 Like

Here is the new version (sorry for not having it with versions) with the French translation thanks to @steph78630.

reports.ipfire.tgz.zip (46,5 KB)

Bye.

2 Likes

hi
I tested your addon it’s good I wanted to thank you for this addon if I can manage to extend the display of the scafyl frame to the maximum and reduce your size of the police of the first colone
ty

Hi, I wanted to propose a change to improve the component.
Now, you can choose between daily, weekly, and monthly report schedules.
The schedule for this report is fixed in the system.
For this improvement, I wanted to take inspiration from another component I found online that I’ve used in the past, where you could choose the report schedule and days.
Perhaps someone more knowledgeable than me could see how that part is done and import it into this component.
The component can be downloaded from this link:

Yes, you’re right. It would be great to be able to do that. I also used this add-on, but the problem, as you well know, is that it lacks maintenance, and with updates, it stopped working properly. When I created the add-on, I considered doing it with a similar task scheduler, but I saw the complexity and decided to keep it simple. I was trying to figure out how it worked or how to create tasks with IPFire’s fcrontab, but I didn’t see how to do it. Perhaps someone with more knowledge knows how to do it or can tell us how to implement it. Regards, and thanks for the comment.

Bye.

I’d be happy to help, but it’s beyond my knowledge.
We’re both confident that someone else will come forward.