YAMon 3.0... Usage Reporting by device per hr/day/mo

Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> General Questions
Goto page Previous  1, 2, 3 ... 40, 41, 42 ... 149, 150, 151  Next
Author Message
ran
DD-WRT Novice


Joined: 30 Jul 2008
Posts: 15

PostPosted: Tue Aug 30, 2016 14:53    Post subject: Reply with quote
ddaniel51 wrote:
You'll be better off splitting the usb with a jffs and a opt volume.


If I may ask, why have two partitions? I had a 2GB USB, and since the only thing it is used for is YAMon, I figured I'd just leave it as one partition...
Sponsor
mac913
DD-WRT Guru


Joined: 02 May 2008
Posts: 1848
Location: Canada

PostPosted: Tue Aug 30, 2016 16:18    Post subject: Reply with quote
On my 8GB USB Flash Drive there are 3 partitions...

533MB - swap
5,334MB - /opt - ext4 file system
2,134MB - /jffs - ext4 file system

_________________
Home Network on Telus 1Gb PureFibre - 10GbE Copper Backbone
2x R7800 - Gateway & WiFi & 3xWireGuard - DDWRT r53562 Std k4.9

Off Site 1

R7000 - Gateway & WiFi & WireGuard - DDWRT r54517 Std
E3000 - Station Bridge - DDWRT r49626 Mega K4.4

Off Site 2

R7000 - Gateway & WiFi - DDWRT r54517 Std
E2000 - Wired ISP IPTV PVR Blocker - DDWRT r35531


YAMon 3.4.6 | DNSCrypt-Proxy V2
al_c
DD-WRT Guru


Joined: 13 Apr 2013
Posts: 2134
Location: Ottawa Canada

PostPosted: Tue Aug 30, 2016 17:01    Post subject: Reply with quote
ran wrote:
ddaniel51 wrote:
You'll be better off splitting the usb with a jffs and a opt volume.


If I may ask, why have two partitions? I had a 2GB USB, and since the only thing it is used for is YAMon, I figured I'd just leave it as one partition...


As long as everyone is asking questions, why not mount to /opt?


Al
colonelriley
DD-WRT Novice


Joined: 18 Aug 2016
Posts: 48

PostPosted: Tue Aug 30, 2016 22:02    Post subject: Reply with quote
al_c wrote:


As long as everyone is asking questions, why not mount to /opt?


Al


I'm def a few steps behind the previous poster, but I still can't seem to get the usb drive (named opt or not) to mount writable to /opt...
MoreBloodWine
DD-WRT User


Joined: 23 Jun 2016
Posts: 147

PostPosted: Wed Aug 31, 2016 1:28    Post subject: Reply with quote
al_c wrote:
MoreBloodWine wrote:
cohassetsteve wrote:
I changed the day number in the config.file from 19 to 20. In the settings tab it still shows 19. I have shutdown and restarted the script a couple of times. I have also selected the reset settings button on the settings page - how do I reread the config.file to reflect the change.
That's one thing I've asked myself about being able to change the day as my ISP floats me by a day sometimes but to do what you after. Gotta clear the browser cache for the router site. In my case 192.168.1.1... or you can try ctrl+f5 which probably wont work.

Why some of that data is locally stored and supersedes the files is beyond me.


Why is the ISP reset date changing?!? If you've changed ISP's and the date moves that is understandable. I cannot fathom why it would change otherwise. Can you explain?

YAMon was not really designed to work with a frequently moving reset date... that may take some work.

Back to the question at hand: why does the JS load the reset date from the LocalStorage variable rather than the config.js?

That was a bug and I've fixed it. Give it another try (but you'll likely need to force a refresh by typing <ctrl>+F5

Al
Same ISP for years... I dont pretend to understand it and it's never by much but see ?

Also, any ideas on what I asked about how storage is handled within YAMon when the stick's near full ? Like can you add a keep x days worth of data ? Like could you code something to delete data older than x months ?

Not sure if how people store it would matter, I use the month and year option.



isp_billing.png
 Description:
 Filesize:  15.18 KB
 Viewed:  6811 Time(s)

isp_billing.png



_________________
al_c
DD-WRT Guru


Joined: 13 Apr 2013
Posts: 2134
Location: Ottawa Canada

PostPosted: Wed Aug 31, 2016 3:56    Post subject: Reply with quote
MoreBloodWine wrote:
al_c wrote:
MoreBloodWine wrote:
cohassetsteve wrote:
I changed the day number in the config.file from 19 to 20. In the settings tab it still shows 19. I have shutdown and restarted the script a couple of times. I have also selected the reset settings button on the settings page - how do I reread the config.file to reflect the change.
That's one thing I've asked myself about being able to change the day as my ISP floats me by a day sometimes but to do what you after. Gotta clear the browser cache for the router site. In my case 192.168.1.1... or you can try ctrl+f5 which probably wont work.

Why some of that data is locally stored and supersedes the files is beyond me.


Why is the ISP reset date changing?!? If you've changed ISP's and the date moves that is understandable. I cannot fathom why it would change otherwise. Can you explain?

YAMon was not really designed to work with a frequently moving reset date... that may take some work.

Back to the question at hand: why does the JS load the reset date from the LocalStorage variable rather than the config.js?

That was a bug and I've fixed it. Give it another try (but you'll likely need to force a refresh by typing <ctrl>+F5

Al
Same ISP for years... I dont pretend to understand it and it's never by much but see ?

Also, any ideas on what I asked about how storage is handled within YAMon when the stick's near full ? Like can you add a keep x days worth of data ? Like could you code something to delete data older than x months ?

Not sure if how people store it would matter, I use the month and year option.


From month to month, do you know when your next interval starts? I see no rhyme nor reason in the sequence of start dates. Unless there is a pattern, I don't know what to do to help you with this! (Suggest an ISP with a constant interval start date, perhaps?!?)

With respect to filling your USB drive. Unless you are using a minuscule thumb drive, you should not have any problems - e.g., I now have close to 1100 daily and monthly data files dating back to May 2013... they require a scant 17MB of disk space.

OTOH, the log files can be come disk hogs (esp. if _logleve<1). Those are the files that you want to clean out on a regular basis. Perhaps the contents of daily-bu too/

YAMon currently does not have the capability to purge these files. It would probably be better to run that as a chron job rather than adding it within YAMon IMHO.
al_c
DD-WRT Guru


Joined: 13 Apr 2013
Posts: 2134
Location: Ottawa Canada

PostPosted: Wed Aug 31, 2016 3:59    Post subject: Reply with quote
colonelriley wrote:
al_c wrote:


As long as everyone is asking questions, why not mount to /opt?


Al


I'm def a few steps behind the previous poster, but I still can't seem to get the usb drive (named opt or not) to mount writable to /opt...

Have you tried a different USB drive? In the past mounting as readonly file system has been resolved by reformatting or replacing the drive.

Do it mount read/write in jffs? I have no clue why a drive could mount RW at one and RO at the other.

Al

Al
MoreBloodWine
DD-WRT User


Joined: 23 Jun 2016
Posts: 147

PostPosted: Wed Aug 31, 2016 4:09    Post subject: Reply with quote
al_c wrote:
MoreBloodWine wrote:
al_c wrote:
MoreBloodWine wrote:
cohassetsteve wrote:
I changed the day number in the config.file from 19 to 20. In the settings tab it still shows 19. I have shutdown and restarted the script a couple of times. I have also selected the reset settings button on the settings page - how do I reread the config.file to reflect the change.
That's one thing I've asked myself about being able to change the day as my ISP floats me by a day sometimes but to do what you after. Gotta clear the browser cache for the router site. In my case 192.168.1.1... or you can try ctrl+f5 which probably wont work.

Why some of that data is locally stored and supersedes the files is beyond me.


Why is the ISP reset date changing?!? If you've changed ISP's and the date moves that is understandable. I cannot fathom why it would change otherwise. Can you explain?

YAMon was not really designed to work with a frequently moving reset date... that may take some work.

Back to the question at hand: why does the JS load the reset date from the LocalStorage variable rather than the config.js?

That was a bug and I've fixed it. Give it another try (but you'll likely need to force a refresh by typing <ctrl>+F5

Al
Same ISP for years... I dont pretend to understand it and it's never by much but see ?

Also, any ideas on what I asked about how storage is handled within YAMon when the stick's near full ? Like can you add a keep x days worth of data ? Like could you code something to delete data older than x months ?

Not sure if how people store it would matter, I use the month and year option.


From month to month, do you know when your next interval starts? I see no rhyme nor reason in the sequence of start dates. Unless there is a pattern, I don't know what to do to help you with this! (Suggest an ISP with a constant interval start date, perhaps?!?)

With respect to filling your USB drive. Unless you are using a minuscule thumb drive, you should not have any problems - e.g., I now have close to 1100 daily and monthly data files dating back to May 2013... they require a scant 17MB of disk space.

OTOH, the log files can be come disk hogs (esp. if _logleve<1). Those are the files that you want to clean out on a regular basis. Perhaps the contents of daily-bu too/

YAMon currently does not have the capability to purge these files. It would probably be better to run that as a chron job rather than adding it within YAMon IMHO.
I dont see how that's possible. At one point I manages 100+ mb of space before I reset from the monthly issue you fixed.

Since my last data wipe on the 27th where I started gathering data on the 28th. My USB drive is already at 7.1mb

It's ext4 as suggested and nothing else done but plugging it to the router.

_________________
MoreBloodWine
DD-WRT User


Joined: 23 Jun 2016
Posts: 147

PostPosted: Wed Aug 31, 2016 4:11    Post subject: Reply with quote
Don't recall what my log level is but whatever the default of the install is, is what it's at. As for the ISP, only game in town.

But there's nothing that can be done for the billing date thing ? Even if at the end of the current cycle yamon asks for current date and if it's a neg 1. 22>21, it uses historical date to fill that missing day. Hope that makes sense.

_________________
al_c
DD-WRT Guru


Joined: 13 Apr 2013
Posts: 2134
Location: Ottawa Canada

PostPosted: Wed Aug 31, 2016 4:41    Post subject: Reply with quote
MoreBloodWine wrote:
al_c wrote:


With respect to filling your USB drive. Unless you are using a minuscule thumb drive, you should not have any problems - e.g., I now have close to 1100 daily and monthly data files dating back to May 2013... they require a scant 17MB of disk space.

OTOH, the log files can be come disk hogs (esp. if _logleve<1). Those are the files that you want to clean out on a regular basis. Perhaps the contents of daily-bu too/

YAMon currently does not have the capability to purge these files. It would probably be better to run that as a chron job rather than adding it within YAMon IMHO.
I dont see how that's possible. At one point I manages 100+ mb of space before I reset from the monthly issue you fixed.

Since my last data wipe on the 27th where I started gathering data on the 28th. My USB drive is already at 7.1mb

It's ext4 as suggested and nothing else done but plugging it to the router.


I'm looking at my USB drive right now. After clearing out a *lot* of old logs, etc., my YAMon3 directory is 102MB. And, within that directory, I have:

  • files at the root --> 173KB
  • /strings --> 2KB
  • /includes -->28KB
  • /www --> 427KB
  • /old --> 621KB (I put all of my old versions of the main yamon script into this folder)
  • /daily-bu2-->5,900KB
  • /data-->17,140KB (and I assure you the files go back to May 2013)
  • /logs --> 80,000KB


NB - if _loglevel=-1, it is not unusual to see a log file for one day that is 30+MB. If that file is wrapped up into the daily-backup, the disk space gets consumed even faster.

Regardless, it would not be overly difficult to create a cron job that purges the logs on a regular basis - e.g., the following command removes all files older than 30 days with a `.log` extension:
Code:
find /opt/YAMon3/logs/ -name *.log -mtime +30 -exec rm -f {} \;

(google and stackoverflow.com are wonderful resources!)

I'll leave adding the cron job as an exercise Smile

Al
MoreBloodWine
DD-WRT User


Joined: 23 Jun 2016
Posts: 147

PostPosted: Wed Aug 31, 2016 5:14    Post subject: Reply with quote
I've done crons before.

2 4 * * 0 find /opt/YAMon3/logs/ -name *.log -mtime +30 -exec rm -f {} \;

Runs 4:02am each Sun. not that I'd need it to when once a month would suffice. I assume for the bu it'd be this ?

2 4 * * 0 find /opt/YAMon3/daily-bu2/ -name *.tar -mtime +30 -exec rm -f {} \;

Also, this is odd.

root@DD-WRT (WNDR4500):~# crontab -e
-sh: crontab: not found
root@DD-WRT (WNDR4500):~#

_________________
MoreBloodWine
DD-WRT User


Joined: 23 Jun 2016
Posts: 147

PostPosted: Wed Aug 31, 2016 5:15    Post subject: Reply with quote
Also, how do I dbl check my current log level ?

Ty.

_________________
al_c
DD-WRT Guru


Joined: 13 Apr 2013
Posts: 2134
Location: Ottawa Canada

PostPosted: Wed Aug 31, 2016 12:35    Post subject: Reply with quote
MoreBloodWine wrote:
Also, how do I dbl check my current log level ?

Ty.


See _loglevel in your config.file
al_c
DD-WRT Guru


Joined: 13 Apr 2013
Posts: 2134
Location: Ottawa Canada

PostPosted: Wed Aug 31, 2016 12:54    Post subject: Reply with quote
MoreBloodWine wrote:
Don't recall what my log level is but whatever the default of the install is, is what it's at. As for the ISP, only game in town.

But there's nothing that can be done for the billing date thing ? Even if at the end of the current cycle yamon asks for current date and if it's a neg 1. 22>21, it uses historical date to fill that missing day. Hope that makes sense.

Does your your ISP enforce a cap on your data usage?

If no (i.e., you have unlimited data), the billing date is not particularly relevant (other than for display purposes). However, if you do have a cap, tracking the totals relative to the start of your billing cycle is important.

YAMon has been designed to work relative to a fixed (and unchanging) start to the billing cycle... making that variable would require a *massive* change to the way that the data is organized in the bash script and accessed via the reports.

One poorly conceived notion that is coming to mind is a script to `re-arrange` the data after the fact (a tweaked version of h2m.sh perhaps)... however, unless you know in advance when the new cycles will start, it'll be impossible to automate that process. Can you get that info from your ISP?

Let me noodle on this a bit longer. Or if anyone else has an idea, chime in.

Al
al_c
DD-WRT Guru


Joined: 13 Apr 2013
Posts: 2134
Location: Ottawa Canada

PostPosted: Wed Aug 31, 2016 12:59    Post subject: Reply with quote
MoreBloodWine wrote:
Also, this is odd.

root@DD-WRT (WNDR4500):~# crontab -e
-sh: crontab: not found
root@DD-WRT (WNDR4500):~#


enter `busybox` in PuTTY (or equivalent) on your router to see a list of the available commands.

Many of the common (and useful) commands are not present in a lot of the firmware variants... which causes me no end of grief!
Goto page Previous  1, 2, 3 ... 40, 41, 42 ... 149, 150, 151  Next Display posts from previous:    Page 41 of 151
Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum