e-mail notifications

Suggest improvements and new features for Gargoyle.

Moderator: Moderators

Post Reply
SergeS
Posts: 58
Joined: Tue Aug 07, 2012 9:09 pm

e-mail notifications

Post by SergeS »

Hello everybody,

would be nice to have optional everyday scheduled e-mail notifications to admins email with log-file, bandwidth distribution, connected hosts, etc.

staclos
Posts: 3
Joined: Fri Jan 17, 2014 4:17 am

Re: e-mail notifications

Post by staclos »

SergeS wrote:...would be nice to have optional everyday scheduled e-mail notifications to admins email with log-file, bandwidth distribution, connected hosts, etc.
It would be good features. I am for the request.

bjm
Posts: 18
Joined: Tue Oct 09, 2012 3:39 am

Re: e-mail notifications

Post by bjm »

wouldn't this just be a cron job you could configure?

Buck
Posts: 2
Joined: Sun Apr 27, 2014 4:44 pm

Re: e-mail notifications

Post by Buck »

bjm wrote:wouldn't this just be a cron job you could configure?
and how can it be configured?
Do you have any ressource I can find a How-To or similar?
Would be greatly appreciated :)

This e-mail notification is the only thing I am missing right now with Gargoyle. Everything else is just great!

n0pin
Posts: 129
Joined: Thu Jan 09, 2014 6:39 am

Re: e-mail notifications

Post by n0pin »

Use this code to gather data and save it into a file:

Code: Select all

#!/bin/sh

rm /tmp/email-log.txt

touch /tmp/email-log.txt

#Web Usage

sh /tmp/do_webmon_backup.sh
echo -e "Recently Visited Sites:\n" >> /tmp/email-log.txt
cat /usr/data/webmon_domains.txt >> /tmp/email-log.txt
echo -e "\nRecent Web Searches:\n" >> /tmp/email-log.txt
cat /usr/data/webmon_searches.txt >> /tmp/email-log.txt

#Logs
echo -e "\nSystem logs:\n" >> /tmp/email-log.txt
logread | grep "" >> /tmp/email-log.txt

#DHCP Leases

echo -e "\nDHCP Leases:\n" >> /tmp/email-log.txt
cat /tmp/dhcp.leases >> /tmp/email-log.txt

#ARP Records

echo -e "\nARP Records:\n" >> /tmp/email-log.txt
cat /proc/net/arp >> /tmp/email-log.txt
It creates file /tmp/email-log.txt in which you can find Web usage history, logs, DHCP leases and ARP records. Now all you have to do is to install some e-mail package like msmtp or mini-sendmail and use it to send this file to your email. Then you can just use cron to repeat this.

I can develop a plugin if enough people want this function.

Buck
Posts: 2
Joined: Sun Apr 27, 2014 4:44 pm

Re: e-mail notifications

Post by Buck »

n0pin wrote:
It creates file /tmp/email-log.txt in which you can find Web usage history, logs, DHCP leases and ARP records. Now all you have to do is to install some e-mail package like msmtp or mini-sendmail and use it to send this file to your email. Then you can just use cron to repeat this.

I can develop a plugin if enough people want this function.
I really want to thank you! :)
At the moment I don't know how to set up the rest, but this will definitely help me to read further.
Anyway, a Plugin would be really appreciated! :)

mates
Posts: 128
Joined: Mon Nov 14, 2011 7:53 am

Re: e-mail notifications

Post by mates »

I think it would be nice to have (mean as plugin)

keepsake
Posts: 1
Joined: Sat Jun 28, 2014 5:32 pm

Re: e-mail notifications

Post by keepsake »

I have a Buffalo 600 series dual-band router. Would what you propose here in this posting fit in the memory therein?

I would like to have cron in the router run a regular ping of another site and email/text me if it goes down.

Any help would be greatly appreciated.

n0pin
Posts: 129
Joined: Thu Jan 09, 2014 6:39 am

Re: e-mail notifications

Post by n0pin »


rcooke
Posts: 2
Joined: Mon Apr 06, 2015 8:39 pm

Re: e-mail notifications

Post by rcooke »

n0pin wrote:Use this code to gather data and save it into a file:

Code: Select all

#!/bin/sh

rm /tmp/email-log.txt

touch /tmp/email-log.txt

#Web Usage

sh /tmp/do_webmon_backup.sh
echo -e "Recently Visited Sites:\n" >> /tmp/email-log.txt
cat /usr/data/webmon_domains.txt >> /tmp/email-log.txt
echo -e "\nRecent Web Searches:\n" >> /tmp/email-log.txt
cat /usr/data/webmon_searches.txt >> /tmp/email-log.txt

#Logs
echo -e "\nSystem logs:\n" >> /tmp/email-log.txt
logread | grep "" >> /tmp/email-log.txt

#DHCP Leases

echo -e "\nDHCP Leases:\n" >> /tmp/email-log.txt
cat /tmp/dhcp.leases >> /tmp/email-log.txt

#ARP Records

echo -e "\nARP Records:\n" >> /tmp/email-log.txt
cat /proc/net/arp >> /tmp/email-log.txt
It creates file /tmp/email-log.txt in which you can find Web usage history, logs, DHCP leases and ARP records. Now all you have to do is to install some e-mail package like msmtp or mini-sendmail and use it to send this file to your email. Then you can just use cron to repeat this.

I can develop a plugin if enough people want this function.
Yes I would like to have this email sending info (Bandwidth usage, search, etc) in a scheduler as a Plug-in.

Post Reply