YAMon 2.2 Usage Reporting: by device per hr/day/mo or live

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 ... 94, 95, 96 ... 107, 108, 109  Next
Author Message
Helipil0t
DD-WRT Novice


Joined: 22 Jun 2010
Posts: 40

PostPosted: Thu Nov 26, 2015 0:25    Post subject: Re: Groups & Devices Reply with quote
Helipil0t wrote:
al_c wrote:
Researcher wrote:
al_c wrote:
Helipil0t wrote:
Anyone else having a hard time maintaing the Devices list? I have database integration enabled. I spent hours inputing information for over 100 devices. Things seemed to be working well for a while and then next thing you know many if not all of the devices default back to

Code:
Unknown   new device - XX:XX:XX:XX:XX:XX       


I saved a copy of the users.js file after inputting all the information. Restoring to this backup fixes the issue for a short while and then it happens again. Am I doing something wrong?

Uh-oh! I've never seen this but at least one other user has...

Pls stop the script, fix users.js, set _loglevel=-1 in your config.file & then restart the script. Send me the log file after users.js gets corrupted...

I can compare what you are getting with what others have sent.

Al


I just upgraded to 2.2.5 and I am seeing this as well.
Code:
Unknown   new device - XX:XX:XX:XX:XX:XX       

I am seeing duplicate MAC address listed, one known and one unknown.

I am also getting
Code:
Error #4 reading the devices data file: `data/users.js` TypeError: n is undefined

I have clicked on the link to the users.js in the error and it opens fine, I don't see any obvious format errors. My user.js file is correct and doesn't contain any errors as described by Helipil0t.


To anyone who is having this problem, can I ask you to zip up your users.js, hourly & monthly data, and log files and send them to me via PM (or to al@caughey.ca). Please do not post them here!

I can then replicate your reporting environment at my end and that should help confirm it is the same issue and how to resolve it.

I will get to this ASAP!

Al


So Yesterday I ended up turning off database integration, I also decided to re-organize the data files by Year and Month.. I restored the users.js file and so far I've been running for about 12 hours without any issues.

I'm going to try to replicate the problem today with logs enabled. I'll get you the logs and data files hopefully by the end of the day.

Thanks Al


Hey Al,
A few questions. What's the significance of NOT shutting down the script before modifying the users.js file.

Also a couple of things are not clear to me. With database integration enabled, is the users.js file still being used to populate the Devices list? What effect does modifying the users.js file have on the information stored on the database. Does the database get updated with the information in the users.js file or from the browser's cache? Similarly, when does the local users.js file get changed if not manually by the user?

Just trying to understand the script a little better to help figure out what's going on. I've got everything back to the things they were when the users.js file was being corrupted. So far everything's running ok except for one or two new devices that I keep having to modify. Changes take effect for a short while, then it resorts back to being a new device..

Thanks again!
Sponsor
al_c
DD-WRT Guru


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

PostPosted: Thu Nov 26, 2015 15:05    Post subject: Re: Groups & Devices Reply with quote
Helipil0t wrote:


Hey Al,
A few questions. What's the significance of NOT shutting down the script before modifying the users.js file.

Also a couple of things are not clear to me. With database integration enabled, is the users.js file still being used to populate the Devices list? What effect does modifying the users.js file have on the information stored on the database. Does the database get updated with the information in the users.js file or from the browser's cache? Similarly, when does the local users.js file get changed if not manually by the user?

Just trying to understand the script a little better to help figure out what's going on. I've got everything back to the things they were when the users.js file was being corrupted. So far everything's running ok except for one or two new devices that I keep having to modify. Changes take effect for a short while, then it resorts back to being a new device..

Thanks again!


It is *essential* to shut down the script prior to updating users.js...

To minimize the wear & tear on the USB drive (and to lessen the load on your router), I read from users.js just once (when the script is launched) and only update the file when necessary (i.e., an IP address changes or a new device is added, etc). When that happens, the new values completely overwrite whatever was saved previously. So... if you make changes when the script is running, they will get clobbered.


With respect to the reports, as you know - but others may not - the `Edit Devices` dialog allows you to tailor the group, name and/or display colour for any device on your network. (You open this dialog by going to the Devices tab and clicking the edit device icon in the right most column of the table.)

Due to browser security, I cannot update users.js from the reports... so instead, I store those updates in a localStorage variable (and in the database if you have that option enabled).

When you reload the page, the device info from the localStorage variables or the database overrides the values in users.js.

If you subsequently go into users.js and update the values on your router, the local values will still override things... you must clear the local values in the `Edit Device` dialog.

(The advantage of the database is that all of your settings are shared across all browsers and devices you use to access the reports.)

I hope this makes sense.

Al
Helipil0t
DD-WRT Novice


Joined: 22 Jun 2010
Posts: 40

PostPosted: Thu Nov 26, 2015 15:54    Post subject: Re: Groups & Devices Reply with quote
al_c wrote:
Helipil0t wrote:


Hey Al,
A few questions. What's the significance of NOT shutting down the script before modifying the users.js file.

Also a couple of things are not clear to me. With database integration enabled, is the users.js file still being used to populate the Devices list? What effect does modifying the users.js file have on the information stored on the database. Does the database get updated with the information in the users.js file or from the browser's cache? Similarly, when does the local users.js file get changed if not manually by the user?

Just trying to understand the script a little better to help figure out what's going on. I've got everything back to the things they were when the users.js file was being corrupted. So far everything's running ok except for one or two new devices that I keep having to modify. Changes take effect for a short while, then it resorts back to being a new device..

Thanks again!


It is *essential* to shut down the script prior to updating users.js...

To minimize the wear & tear on the USB drive (and to lessen the load on your router), I read from users.js just once (when the script is launched) and only update the file when necessary (i.e., an IP address changes or a new device is added, etc). When that happens, the new values completely overwrite whatever was saved previously. So... if you make changes when the script is running, they will get clobbered.


With respect to the reports, as you know - but others may not - the `Edit Devices` dialog allows you to tailor the group, name and/or display colour for any device on your network. (You open this dialog by going to the Devices tab and clicking the edit device icon in the right most column of the table.)

Due to browser security, I cannot update users.js from the reports... so instead, I store those updates in a localStorage variable (and in the database if you have that option enabled).

When you reload the page, the device info from the localStorage variables or the database overrides the values in users.js.

If you subsequently go into users.js and update the values on your router, the local values will still override things... you must clear the local values in the `Edit Device` dialog.

(The advantage of the database is that all of your settings are shared across all browsers and devices you use to access the reports.)

I hope this makes sense.

Al


Thanks for your response Al.

So you're saying the localStorage variable or the Database (if enabled) will always overwrite the users.js file? If I have database integration enabled there should be no reason to ever modify users.js on the router, correct? If I do in-fact shutdown the script, modify the users.js and startup the script again, will the users.js be preserved or will it be overwritten (database enabled)?
al_c
DD-WRT Guru


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

PostPosted: Thu Nov 26, 2015 19:52    Post subject: Re: Groups & Devices Reply with quote
Helipil0t wrote:
So you're saying the localStorage variable or the Database (if enabled) will always overwrite the users.js file?
Yes... with the clarification that the LS variable/DB info simply alters what is *displayed* in the reports. It does not affect the contents of the file.
(I don't think I was clear in my previous response.)

Helipil0t wrote:
If I have database integration enabled there should be no reason to ever modify users.js on the router, correct?
Yes, with the DB option turned on, all of your settings are shared across any browser/device that views your reports. (Without DB integration, all changes - e.g., customizations to Device info - are stored in a LocalStorage variable which is specific to that browser on that device... that is just the way the LS variables work.)


Helipil0t wrote:
If I do in-fact shutdown the script, modify the users.js and startup the script again, will the users.js be preserved or will it be overwritten (database enabled)?
The version of users.js in /opt/YAMon2/data is only ever changed by the script or you. Security in the web server prevents the reports from writing anything back to the router (hence the need for the external database). See clarification above Smile


With a different web server (Lighttpd) and PHP, there *might* be a way to eliminate the need for the database... but that will require very detailed instructions of what to download and how to install and configure things properly. ATM, (IMHO) the current DB integration option is simpler.

I will look into Lighttpd & PHP when time permits (and only after I get IPv6 implmemented... I promise!)

Al
SimulationMan32
DD-WRT User


Joined: 28 Aug 2014
Posts: 135
Location: Winnipeg, MB, Canada

PostPosted: Thu Nov 26, 2015 20:19    Post subject: Reply with quote
As far as I can tell the corrupted users.js file only occurs with the database option enabled.

I will try to get the log files soon.

_________________
KONG Builds for R7000, AC68U
Brainslayer for everything else
al_c
DD-WRT Guru


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

PostPosted: Fri Nov 27, 2015 2:46    Post subject: Reply with quote
SimulationMan32 wrote:
As far as I can tell the corrupted users.js file only occurs with the database option enabled.

I will try to get the log files soon.
I'm really intrigued by this. The script running on your router - other than writing the database key to config.js as the script starts - has *no* interactions at all with the database. All of the database activity happens in the reports. So AFAIK, the database integration should have no impact whatsoever on users.js.

However, that said, I've been wrong in the past...
Al
delle54
DD-WRT Novice


Joined: 06 Sep 2015
Posts: 11
Location: Hannover, Germany

PostPosted: Sat Nov 28, 2015 21:14    Post subject: Reply with quote
@al_c: I just want to mention something about the installation.

About 2 years ago, I could finaly change from DSL to VDSL and got a new router from my ISP. Here in Germany, the ISP can force you to use the delivered router. Since this "little toy" was not suitable for my purpose, I only used it as a modem and DHCP-Server and used a "real" router connected per LAN for my network.

After I installed YAMon, I had the total live-traffic in the live-view and the monthly breakdown, but no users.

For about 4 days I read almost half of this thread, googled for the problem I had, but found nothing.

Today I was just about to give up, but had the idea to try to set my router as a DHCP-Server instead and everything works well since then Very Happy

The default gateway for all of the WDS-APs is the router, whereby I assume that the modem ist handling the NAT.


Last edited by delle54 on Sun Nov 29, 2015 22:09; edited 3 times in total
onkelandy
DD-WRT Novice


Joined: 22 Feb 2015
Posts: 7

PostPosted: Sat Nov 28, 2015 22:17    Post subject: Bug with Billing Day Reply with quote
Hi Al!

I also had the problem with the ISP Billing Day. I've set it in the config file but on the first start of the web interface I got stuck because the Billing Day was empty.

After changing the _doLocalFiles from 2 to 0 everything works fine! So there must be some sort of bug with downloading the files...

Best wishes and thanks for your work
SquareofPrimes
DD-WRT Novice


Joined: 29 Aug 2015
Posts: 5

PostPosted: Tue Dec 01, 2015 2:07    Post subject: Reply with quote
Hi Al,

I have been racking my brain to find out what is going on, but not in a code sense since I'm not a programmer. I cannot seem to remove or update these entries with the correct information. It just ignores the changes. I tried reinstalling from scratch, but it picked up a bunch of stuff from old traffic files I moved back in that cover about the last year.

It seems that these are all old entries in the data files I moved back into the Data folder, but don't know where. I changed to the database model to hopefully delete these entries, but that didn't work. If a device comes on the network I can change the details but otherwise I cannot figure out how to edit these entries.

Thanks!



Yamon2.jpg
 Description:
 Filesize:  239.78 KB
 Viewed:  6272 Time(s)

Yamon2.jpg




Last edited by SquareofPrimes on Wed Dec 02, 2015 6:51; edited 2 times in total
Helipil0t
DD-WRT Novice


Joined: 22 Jun 2010
Posts: 40

PostPosted: Tue Dec 01, 2015 15:31    Post subject: Reply with quote
SquareofPrimes wrote:
Hi Al,

I have been racking my brain to find out what is going on, but not in a code sense since I'm not a programmer. I cannot seem to remove or update these entries with the correct information. It just ignores the changes. I tried reinstalling from scratch, but it picked up a bunch of stuff from old traffic files I moved back in that cover about the last year.

It seems that these are all old entries in the data files I moved back into the Data folder, but don't know where. I changed to the database model to hopefully delete these entries, but that didn't work. If a device comes on the network I can change the details but otherwise I cannot figure out how to edit these entries.

Thanks!


Yup That's the same problem I was having. The only way I was able to fix this problem was to manually modify the users.js file for those entries. But then things got messed up presumably because I didn't stop the script before modifying the file. (Conversation about that earlier in this thread) Since then, I stopped the script, edited the file, started the script back up. And with Database integration enabled, I stopped messing around with the users.js file and so far I've been running for about a week without any problems. FYI: You really should black out all those MAC addresses when posting screenshots like that.
Helipil0t
DD-WRT Novice


Joined: 22 Jun 2010
Posts: 40

PostPosted: Tue Dec 01, 2015 16:15    Post subject: Memory Usage Reply with quote
One thing I wanted to bring up Al was the Memory usage of YAMon2.

Should I worry about it hogging cached ram? I know cached ram can be reclaimed by other processes when needed. But It seems to be a bit excessive.

I have two identical ac68u routers running the same DD-WRT build. One is running YAMon the other is not so it's interesting to compare.

Here's memory usage from the one not running YAMon (uptime: 17 days):
Code:

root@router:~# free
             total       used       free     shared    buffers     cached
Mem:        255508      43448     212060          0       4560      12376
-/+ buffers/cache:      26512     228996
Swap:            0          0          0

And usage from the one that is running YAMon (uptime: 7 days, I cleared the cache yesterday):
Code:

root@router:~# free
             total       used       free     shared    buffers     cached
Mem:        255508     204452      51056          0       1840     166108
-/+ buffers/cache:      36504     219004
Swap:            0          0          0


That's 153MB difference in cached RAM between the two and it seems to be creeping up every day. Is this normal?
Helipil0t
DD-WRT Novice


Joined: 22 Jun 2010
Posts: 40

PostPosted: Wed Dec 02, 2015 4:14    Post subject: Re: Memory Usage Reply with quote
Helipil0t wrote:
One thing I wanted to bring up Al was the Memory usage of YAMon2.

Should I worry about it hogging cached ram? I know cached ram can be reclaimed by other processes when needed. But It seems to be a bit excessive.

I have two identical ac68u routers running the same DD-WRT build. One is running YAMon the other is not so it's interesting to compare.

Here's memory usage from the one not running YAMon (uptime: 17 days):
Code:

root@router:~# free
             total       used       free     shared    buffers     cached
Mem:        255508      43448     212060          0       4560      12376
-/+ buffers/cache:      26512     228996
Swap:            0          0          0

And usage from the one that is running YAMon (uptime: 7 days, I cleared the cache yesterday):
Code:

root@router:~# free
             total       used       free     shared    buffers     cached
Mem:        255508     204452      51056          0       1840     166108
-/+ buffers/cache:      36504     219004
Swap:            0          0          0


That's 153MB difference in cached RAM between the two and it seems to be creeping up every day. Is this normal?


So by the end of today it seems to have topped out.

Code:

root@router:~# free
             total       used       free     shared    buffers     cached
Mem:        255508     216960      38548          0       1108     185064
-/+ buffers/cache:      30788     224720
Swap:            0          0          0


Things look to be stable so I'm not too concerned about it. I'll keep an eye on it during peek hours and see how it goes.
delle54
DD-WRT Novice


Joined: 06 Sep 2015
Posts: 11
Location: Hannover, Germany

PostPosted: Wed Dec 02, 2015 4:31    Post subject: Reply with quote
I have no idea of what I am doing wrong. YAMon2 has been running for a few days now, but it only shows upload but absolutely no download traffic. My router is a TP-Link WDR-3600 and have even tried different builds of DD-WRT.
al_c
DD-WRT Guru


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

PostPosted: Wed Dec 02, 2015 5:14    Post subject: Reply with quote
delle54 wrote:
I have no idea of what I am doing wrong. YAMon2 has been running for a few days now, but it only shows upload but absolutely no download traffic. My router is a TP-Link WDR-3600 and have even tried different builds of DD-WRT.


Is your router running DHCP? It must!

Have you enabled PrivOxy? (If yes, that is a known conflict)

Make sure that logging is turned on (and _loglevel=0 (or -1) in your config.file. Restart your script and let it run for a while then send me the log(s).

Thx!

Al
delle54
DD-WRT Novice


Joined: 06 Sep 2015
Posts: 11
Location: Hannover, Germany

PostPosted: Wed Dec 02, 2015 5:49    Post subject: Reply with quote
As I mentioned a few posts ago, that DHCP must be running was not mentioned in the installation instructions. I found that out by myself after about 4 days. Yes DHCP is running.
And I dont't even know what PrivOxy is.


Last edited by delle54 on Wed Dec 02, 2015 7:18; edited 1 time in total
Goto page Previous  1, 2, 3 ... 94, 95, 96 ... 107, 108, 109  Next Display posts from previous:    Page 95 of 109
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