New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send e-mail report even if monitorix was not running at time specified #322
Comments
Thinking about it.. maybe an option to generate and send reports independently as a one-shot task would be a great help here. Then I could set up arbitrary schedule via |
If you want to get a complete graph of the last month, that is from day 1 until day 30/31, you must generate such graph on day 1 of the current month, otherwise you'll get the graph of the last month starting counting from the day when you generated it. As you can see in I understand your problem, but I don't see a way to generate a complete graph of a very past month. The time frames created by Monitorix are hourly (optional), daily, weekly, monthly, yearly, and optionally 2 years, 3 years, etc. If you try to render a graph out from these time frames you'll get a graph with squared values and very inaccurate. For instance, try to generate a graph of the past two days with |
Frankly, the "last 30 days" graph would be more than enough for my needs. With desktop systems not running 24/7 it's not really important to have it aligned to the first day of month. As I mentioned above perhaps the option to generate and e-mail reports via a HTTP call would be all that is needed and I could do the rest only with a help of a simple shell script + |
Yes, the URL could be something like I guess this would need two extra options in |
Abused in sense that (s)he could spam your e-mail with unnecessary reports? Then perhaps the return of |
No, nobody expects to receive a MIME-formatted e-mail as a return of a URL. I need to think more on this... Perhaps a signal sent to Monitorix could be like a trigger to generate the report. I mean, I could create a new option called |
If it's just that: return JSON with the proper fields to turn it into an email. Basially (very much abstracted): {
'header': '<header part of the mail>',
'body': <the report>
} Expecting an URL returning JSON? Plenty of examples 🤣 |
That's another story. You mean that Monitorix should return a complete email which includes all the headers and the graphs in PNG converted to Base64? Don't get me wrong, I'm just asking. 😃 |
Nah, I think that is not a good idea either. Maybe this should be treated a special case and therefore we should assume there is a shell account on the server which can call This would give an advanced user to generate e-mail reports independently of the main schedule, send to different e-mail addresses/groups etc. Does that sound reasonable? |
😱 🤐 💨 |
As stated in the documentation of Perl MIME::Lite, I can write the whole message (or even the body only) to a file. I think that this could be added to the current option
But I'm not sure if saving a complete formatted email to a file is useful for later sending it. I mean, what type of tool do you would use to send a |
The user @khcassidy just opened a new issue with the same feature request, and that made me think that I completely forgot to implement all this. Sorry for that. I'll try to work on this in the next days. |
Couple ways are mentioned at https://stackoverflow.com/questions/1306115/send-eml-files-saved-on-disk |
I'll focus on the one-shot solution as it seems more natural to me, and also it will cover the current requests. |
I like the one-shot idea very much. |
This last commit adds the one-shot solution to send email reports at any time. You don't need to stop your current Monitorix instance, just execute a new one with the new parameter The following is an example to force
Let me know if it works as expected. |
Hi Mikaku, |
@khcassidy, thanks for testing this! |
Monitorix is mostly running on my desktop systems and laptops to keep track of the resource usage. Only couple of these systems are running 24/7, yet - I would like to receive weekly/monthly report for each of them. It is my understanding that if I have a monthly report configured I would only get the report if the monitored system was up on the first day of month and time configured in the config file which could be a challenge for systems used only sporadically.
The text was updated successfully, but these errors were encountered: