Email notifications plugin revisited

Want to share your OpenWrt / Gargoyle knowledge? Implemented a new feature? Let us know here.

Moderator: Moderators

dpint
Posts: 32
Joined: Fri Oct 31, 2014 10:48 am

Re: Email notifications plugin revisited

Post by dpint »

Look at the first post in this thread for instructions.
Last edited by dpint on Wed Apr 27, 2016 4:11 pm, edited 1 time in total.

ispyisail
Moderator
Posts: 4884
Joined: Mon Apr 06, 2009 3:15 am
Location: New Zealand

Re: Email notifications plugin revisited

Post by ispyisail »

Code: Select all

opkg update


Code: Select all

wget -O /tmp/email.ipk http://dpint.si/storage/gargoyle/plugin-gargoyle-email-notifications/plugin-gargoyle-email-notifications_2.0-2_all.ipk


Code: Select all

opkg install /tmp/email.ipk


Code: Select all

rm /tmp/email.ipk


Do you need help with SSH (putty)

rseiler
Posts: 197
Joined: Sun Dec 15, 2013 12:31 am

Re: Email notifications plugin revisited

Post by rseiler »

Thanks for this.

This is really minor, but let's say you set the report to happen at midnight. When midnight strikes, at that instant the day changes from, say, Aug 22 to Aug 23rd, but the bandwidth report includes bandwidth usage for the 23rd, which of course (since that day hasn't happened yet) is always 0.

How about in this case of midnight decrementing to the "previous" day?

doug_porsche
Posts: 74
Joined: Fri Aug 16, 2013 3:59 pm

Re: Email notifications plugin revisited

Post by doug_porsche »

Dont mean to be captain obvious, but.

What if you run the report the last minuet of the day you want, not the first minuet of the day you dont.

Run the report @ 11:59 PM, not 12:00 AM

rseiler wrote:Thanks for this.

This is really minor, but let's say you set the report to happen at midnight. When midnight strikes, at that instant the day changes from, say, Aug 22 to Aug 23rd, but the bandwidth report includes bandwidth usage for the 23rd, which of course (since that day hasn't happened yet) is always 0.

How about in this case of midnight decrementing to the "previous" day?
NETGEAR WNDR3700v4 or an old Soup can with string. So hard to tell these days.

rseiler
Posts: 197
Joined: Sun Dec 15, 2013 12:31 am

Re: Email notifications plugin revisited

Post by rseiler »

doug_porsche wrote:Run the report @ 11:59 PM, not 12:00 AM

The best you can do is 11:55, and that's how I have it set.

But I just wanted to point out what happens at midnight and a possible way to improve it. I'm thinking most people (anyone?) aren't going for 11:55.

One other idea: Download usage loses the decimal, which can significant. So, for example, if you actually used 2.9GB, the report will be "2GBytes." Why not just say what it is?

dpint
Posts: 32
Joined: Fri Oct 31, 2014 10:48 am

Re: Email notifications plugin revisited

Post by dpint »

But I just wanted to point out what happens at midnight and a possible way to improve it. I'm thinking most people (anyone?) aren't going for 11:55.


This is not really a bug. I don't think that report should show data from the previous day if the time is 00:00 as this is already a new day.

One other idea: Download usage loses the decimal, which can significant. So, for example, if you actually used 2.9GB, the report will be "2GBytes." Why not just say what it is?


Bash doesn't support floating-point numbers, but I found out it can be done using awk.

https://paste.fedoraproject.org/414268/14722112/raw/

For bandwidth decimals copy, paste and save above code to /usr/lib/gargoyle/email.sh.

rseiler
Posts: 197
Joined: Sun Dec 15, 2013 12:31 am

Re: Email notifications plugin revisited

Post by rseiler »

Thanks for that script mod. Tested it out last night and it worked perfectly.

On that midnight thing, I didn't mean to suggest that it was a bug, just kind of a loophole in the system in that the category "Bandwidth usage" will always be zero if someone chooses midnight.

rseiler
Posts: 197
Joined: Sun Dec 15, 2013 12:31 am

Re: Email notifications plugin revisited

Post by rseiler »

Hey dpint, a quick question on updating.

If someone has installed via the UI and wants to update, is it OK just to follow your first post but with an "opkg upgrade" instead of the install? Or should it be removed one way or another before upgrading?

Aside from the special update to the .sh file a couple posts up, I had thought that 1.9.1 via the UI would be the latest, but then I noticed that the top post had been edited recently and wasn't out-of-date. I do see at least one difference between the UI and ipk routes: email.js.

Lantis
Moderator
Posts: 5773
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Email notifications plugin revisited

Post by Lantis »

Remove then reinstall.
Preferably using the GUI for both actions.

gpkg which is a wrapper for opkg calls certain other gargoyle functions when packages are installed or removed.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

dpint
Posts: 32
Joined: Fri Oct 31, 2014 10:48 am

Re: Email notifications plugin revisited

Post by dpint »

rseiler wrote:Hey dpint, a quick question on updating.

If someone has installed via the UI and wants to update, is it OK just to follow your first post but with an "opkg upgrade" instead of the install? Or should it be removed one way or another before upgrading?

Aside from the special update to the .sh file a couple posts up, I had thought that 1.9.1 via the UI would be the latest, but then I noticed that the top post had been edited recently and wasn't out-of-date. I do see at least one difference between the UI and ipk routes: email.js.


Most of the time installing plugin from GUI will get you an outdated version of it, as it takes some time for packages in repository to get updated. You can always install the newest plugin version using commands on the first page. It is recommended that you remove plugin before reinstalling.

Post Reply