Daily Usage Stats via Email

Suggest improvements and new features for Gargoyle.

Moderator: Moderators

BugShooter
Posts: 13
Joined: Tue Aug 21, 2018 1:45 pm
Location: United Arab Emirates

Re: Daily Usage Stats via Email

Post by BugShooter »

Thankyou so much for your support.

I've configured WinSCP and now i can access email.sh

Now i realised that,what i was looking aint "quota usage stats"
actually it was daily "Bandwidth Distribution Table"

Kindly check what ive done and if you dont mind educate me.
Ive tried making a table which i'd like to get in my report but no idea about where to point the same.

Code: Select all

if printf '%s' "$data" | egrep -q "6"
then
	#Bandwidth Distribution Table
	echo -e "<br><h1>Bandwidth Distribution Table:</h1><br><table $tablestyle>" >> /tmp/email-log.txt
	echo "<tr><th $thstyle>Host</th><th $thstyle>Total</th><th $thstyle>Down</th><th $thstyle>Up</th></tr>" >> /tmp/email-log.txt;
	cat /xxx > /tmp/work.tmp
	while read line
	do
	xxx
	converttime=$(date -d @$time);
	echo "<tr><td $tdstyle>"$converttime"</td><td $tdstyle>xxx</td></tr>" >> /tmp/email-log.txt;
	done < /tmp/work.tmp
	rm /tmp/work.tmp
	echo -e "</table>" >> /tmp/email-log.txt
fi
WDR4300 v1 on 1.10.x
WR841ND v7 on 1.10.x

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

Re: Daily Usage Stats via Email

Post by Lantis »

I’ll find some time to look at this in the next few days.
Can I just check you still want to get your quotas right?
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.

BugShooter
Posts: 13
Joined: Tue Aug 21, 2018 1:45 pm
Location: United Arab Emirates

Re: Daily Usage Stats via Email

Post by BugShooter »

No.I mean the same thing under the bandwidth distribution pie diagram,
"bandwidth distribution table"

Actually what i needed in the table are
1)Data usage of every host for the day
2)Sum of total data for the day
3)Sum of data for the month till date
WDR4300 v1 on 1.10.x
WR841ND v7 on 1.10.x

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

Re: Daily Usage Stats via Email

Post by Lantis »

You'll want to get the download + upload data for each IP on a per day basis using

Code: Select all

bw_get -i "bdist4-download-day-31" -h -m
bw_get -i "bdist4-upload-day-31" -h -m
The format of the data is:

Code: Select all

bdist4-download-day-31 ip_address
timestart
timeend
lasttime
32 datapoints
Examples of how the data is parsed can be found here
https://raw.githubusercontent.com/ericp ... s/bdist.js
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.

BugShooter
Posts: 13
Joined: Tue Aug 21, 2018 1:45 pm
Location: United Arab Emirates

Re: Daily Usage Stats via Email

Post by BugShooter »

Since im new to bash,i didn't have any idea to implement the same.Things are not like what i expected.
Can you help me out completing this code from the scratch.
i mean from "if printf" to "fi" for the attached output table.

Your kind assistance will be greatly appreciated.
Image
https://1drv.ms/u/s!AjQgjEoFXarEeutKRU0diO7h8dA
WDR4300 v1 on 1.10.x
WR841ND v7 on 1.10.x

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

Re: Daily Usage Stats via Email

Post by Lantis »

I just don't have the time to do that for you i'm sorry.
I've spent plenty of time giving you the foundation and building blocks to do it yourself or for someone else to give you a hand. :)
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.

Post Reply