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

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3 ... 69, 70, 71 ... 107, 108, 109  Next
Author Message
davecjr
DD-WRT Novice


Joined: 07 Mar 2014
Posts: 32

PostPosted: Sat May 23, 2015 16:34    Post subject: Reply with quote
I've had this a lot over time and would appreciate a quick explanation if possible as to what may be happening so I can fix it myself. I'm sure 'al_c' has fixed this for me a time or two in the past but it happens so often for me I hate to even ask every time!


Error #4 reading the hourly data file: `data/2015-05-22-hourly_data.js` SyntaxError: Expected '}'

I looked at usage a few times yesterday and all was fine and now I try to look back at yesterday for the whole day and get this error above. I have this like three days of the last week.
Sponsor
al_c
DD-WRT Guru


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

PostPosted: Sat May 23, 2015 20:12    Post subject: Reply with quote
davecjr wrote:
I've had this a lot over time and would appreciate a quick explanation if possible as to what may be happening so I can fix it myself. I'm sure 'al_c' has fixed this for me a time or two in the past but it happens so often for me I hate to even ask every time!


Error #4 reading the hourly data file: `data/2015-05-22-hourly_data.js` SyntaxError: Expected '}'

I looked at usage a few times yesterday and all was fine and now I try to look back at yesterday for the whole day and get this error above. I have this like three days of the last week.


Dave - in spite of what the error message indicates, I'm pretty sure one of the lines in your hourly usage file is missing a close bracket `)`...

e.g., look for something like the second line in the code below

Code:
hu({"mac":"xx:20:xx:C0:xx:xx","hour":"01","down":64699,"up":81483})
hu({"mac":"xx:5A:04:xx:xx:D0","hour":"01","down":34078,"up":55733}
hu({"mac":"C0:EE:xx:xx:74:xx","hour":"01","down":0,"up":180172})
hu({"mac":"C0:xx:xx:xx:47:xx","hour":"01","down":100193,"up":468097})

(Once you've found the offending line, you will have to fix it in both /opt/YAMon2/data and /tmp/www/data.

I have seen this happen on my router but only on one or two occasions - not as regularly as you seem to get it. Clearly there is a bug in my code but I don't know what provokes the error yet.

Can you set your loglevel to -1 and PM the log to me once the error occurs again?

Thanks (and sorry!)

Al
davecjr
DD-WRT Novice


Joined: 07 Mar 2014
Posts: 32

PostPosted: Sat May 23, 2015 21:09    Post subject: Reply with quote
Thanks, I just fixed one day that wouldn't pull up the day at all and gave just the error. Here is what the file looked like when opened in Notepad++. All I did was delete a space to get the whole like displayed on the same line like the rest of the file. Didn't seem to have an actual character missing just on a separate line.

After getting the line all on one line and uploading to both places, I don't get an error. My totals for that day on a couple of devices are crazy high but not error anymore. Thanks as always.



lineerror.png
 Description:
 Filesize:  12.36 KB
 Viewed:  7259 Time(s)

lineerror.png


davecjr
DD-WRT Novice


Joined: 07 Mar 2014
Posts: 32

PostPosted: Sat May 23, 2015 21:29    Post subject: Reply with quote
Not sure how to get the accurate total but I'm pretty sure a couple of these aren't correct. What's gonna happen if I just drop the last couple of digits on one of the hourly download numbers to at least get it closer to a real number? I'm assuming more may have to be done?


hourlydatahigh.png
 Description:
 Filesize:  14.93 KB
 Viewed:  7250 Time(s)

hourlydatahigh.png


al_c
DD-WRT Guru


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

PostPosted: Sat May 23, 2015 22:42    Post subject: Reply with quote
davecjr wrote:
Thanks, I just fixed one day that wouldn't pull up the day at all and gave just the error. Here is what the file looked like when opened in Notepad++. All I did was delete a space to get the whole like displayed on the same line like the rest of the file. Didn't seem to have an actual character missing just on a separate line.

After getting the line all on one line and uploading to both places, I don't get an error. My totals for that day on a couple of devices are crazy high but not error anymore. Thanks as always.


Ok... that's a different problem... the regular expression is matching two results rather than just one. I suspect an IP address changed or new device was added to your network and is re-using an IP address... I just started getting that sort of behaviour too and I'm working on an update.

Can you PM me your logs?

TIA

Al
rseiler
DD-WRT Guru


Joined: 01 Oct 2007
Posts: 622

PostPosted: Sat May 23, 2015 23:38    Post subject: Re: Symbolic Linking to data... does this work for you??? Reply with quote
al_c wrote:
First, create a directory and create the symbolic link

Code:
mkdir /tmp/www/data2
mount -o bind /opt/YAMon2/data /tmp/www/data2

I was just comparing that with the command that I picked for the earlier issue with Openwrt (the one that you mentioned you went on to create a config.file parameter for):
ln -s /tmp/www /www/user

I'm sure there's some nuanced difference between using mount -o and ln -s, but I'm not sure what it is aside from the ln one being visible with ls -l and the other not. I'm curious, though. BTW, using mount -o for your data2 test did work on OpenrWRT.

Quote:
I'm pretty sure there is a way to persist the sym link in nvram... So instead, I have a bit of code that creates the sym link when the script starts

That's fortunate, since OpenWRT doesn't have nvram.
wirerydr
DD-WRT Novice


Joined: 30 Nov 2013
Posts: 26

PostPosted: Sun May 24, 2015 3:36    Post subject: Re: Symbolic Linking to data... does this work for you??? Reply with quote
rseiler wrote:
al_c wrote:
First, create a directory and create the symbolic link

Code:
mkdir /tmp/www/data2
mount -o bind /opt/YAMon2/data /tmp/www/data2

I was just comparing that with the command that I picked for the earlier issue with Openwrt (the one that you mentioned you went on to create a config.file parameter for):
ln -s /tmp/www /www/user

I'm sure there's some nuanced difference between using mount -o and ln -s, but I'm not sure what it is aside from the ln one being visible with ls -l and the other not. I'm curious, though. BTW, using mount -o for your data2 test did work on OpenrWRT.

The only other practical difference I'm aware of involves chroots. Symlinks within chroots point to targets within the chroot, while bind-mounting allows for the possibility of mounting something from outside a chroot to within the chroot.

Personally, I love bind-mounting. I use it on my routers in a run-on-mount script to mount persistent subdirectories on a USB drive to /tmp/root (a.k.a. root's home-dir) and /var/log, providing me with a persistent home-directory and a persistent log storage medium.

For the purposes of YAMon2, the two methods should operate interchangeably.

_________________
Ubiquiti EdgeRouter Lite | Primary router
D-Link dgs-1100-08 smartswitch | Main VLAN-aware switch
Netgear R7000 #1 | Primary AP
Netgear R7000 #2 | AC-only client-bridge (office)
Asus RT-AC66U | AC-only client-bridge (HTPC)
Netgear WNDR3700v2 | client-bridge (basement)
boggy4062
DD-WRT Novice


Joined: 31 Jan 2009
Posts: 4

PostPosted: Fri May 29, 2015 19:36    Post subject: Reply with quote
Am I the only one with this problem?
My every OTHER month in the report is missing. As you can tell from the attached picture
Nov, Jan,Mar,May is there, but "Dec, Feb, Apr" are missing. It it looks like a "undocumented feature" to me Smile

Help.



Yamon2_prob1.jpg
 Description:
YAMON2 traffic summary picture
 Filesize:  27.45 KB
 Viewed:  7029 Time(s)

Yamon2_prob1.jpg


al_c
DD-WRT Guru


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

PostPosted: Fri May 29, 2015 20:34    Post subject: Reply with quote
boggy4062 wrote:
Am I the only one with this problem?
My every OTHER month in the report is missing. As you can tell from the attached picture
Nov, Jan,Mar,May is there, but "Dec, Feb, Apr" are missing. It it looks like a "undocumented feature" to me Smile

Help.


Wow... I've never seen that!

Do the monthly files exist in your /opt/YAMon2/data directory?

Did you view the reports at all in April? If no, then currently, there will be no entry.

At the moment, you can only add new entries to the bottom of the table... so the only way add a missing entry in the middle is to delete the ones below it and then click the green `+` to add this back to the table.

I'll see if I can detect a missing value and (at a minimum) leave a blank in the table.

Al
boggy4062
DD-WRT Novice


Joined: 31 Jan 2009
Posts: 4

PostPosted: Fri May 29, 2015 20:41    Post subject: Reply with quote
al_c wrote:
boggy4062 wrote:
Am I the only one with this problem?
My every OTHER month in the report is missing. As you can tell from the attached picture
Nov, Jan,Mar,May is there, but "Dec, Feb, Apr" are missing. It it looks like a "undocumented feature" to me Smile

Help.


Wow... I've never seen that!

Do the monthly files exist in your /opt/YAMon2/data directory?

Did you view the reports at all in April? If no, then currently, there will be no entry.

At the moment, you can only add new entries to the bottom of the table... so the only way add a missing entry in the middle is to delete the ones below it and then click the green `+` to add this back to the table.

I'll see if I can detect a missing value and (at a minimum) leave a blank in the table.

Al


Yes they do. I must be VERY SPECIAL indeed! Shocked Very Happy



Yamon2_prob2.jpg
 Description:
Yamon2 List of monthly files.
 Filesize:  24.29 KB
 Viewed:  7017 Time(s)

Yamon2_prob2.jpg


Gnits
DD-WRT Novice


Joined: 10 Apr 2014
Posts: 28

PostPosted: Sun May 31, 2015 3:21    Post subject: Reply with quote
A request, Al_C. I don't check this as often as I should to ensure it is working correctly. Can there be an option to send a snapshot of the daily stats page at the end of the day?

I know it seems like a lot of email, but I would happily delete it after seeing it but this way I would not miss it even when I forget about it. Especially since this all works so well I CAN forget about it from time to time.
al_c
DD-WRT Guru


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

PostPosted: Sun May 31, 2015 17:23    Post subject: Reply with quote
Gnits wrote:
A request, Al_C. I don't check this as often as I should to ensure it is working correctly. Can there be an option to send a snapshot of the daily stats page at the end of the day?

I know it seems like a lot of email, but I would happily delete it after seeing it but this way I would not miss it even when I forget about it. Especially since this all works so well I CAN forget about it from time to time.


With the new send alert capability, this now possible... I'll see what I can add
al_c
DD-WRT Guru


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

PostPosted: Mon Jun 01, 2015 4:19    Post subject: YAMon 2.1.0b is now available Reply with quote
Three new features in this release
1. You can now opt to organize the files within your data directory (so you can have sub-directories for month and/or year)
2. You can `symlink` to the data directory (meaning that you do not need separate copies on your USB drive and in the /tmp/www/ directories).
3. The script now limits you to 24 sendAlert messages per day (the last one being an alert that you've gone over your limit)

#1 & 2 were requested by particular users... sorry for forgetting who deserves the credit for these features.

NB - if you enable the symlink option, you *must* also change the path to data on the `Settings` tab in your reports to `data2` (or whatever value you've set in `config.file`).

I've also made a number of changes to how the script keeps internal track of the current/active IP & MAC addresses on the router. Hopefully this'll help to address a number of issues some of you have had over the past year or so.

The latest version of the script can be downloaded from http://www.dd-wrt.com/phpBB2/viewtopic.php?p=887920#887920

As usual, let me know if you have any issues (or new feature requests)... IPv6 is next on the list (honest!)

Al


Last edited by al_c on Tue Jun 02, 2015 15:16; edited 2 times in total
Mizehra
DD-WRT Novice


Joined: 10 Oct 2013
Posts: 47

PostPosted: Mon Jun 01, 2015 10:07    Post subject: Reply with quote
Heya Al, just wanted to let you know that upon starting the script, some errors are thrown:

Code:

root@Nighthawk:/tmp/mnt/sda1/yamon# ./yamon.startup

******************************************************************
******************************************************************
 ___      ___   ____        ____    ____
 \\\\    ////  ///\\\      |||\\\  ///|||   ______    __  ___
  \\\\  ////  ////\\\\     ||||\\\///||||  ////\\\\  ||||/|||\
   \\\\////  ////  \\\\    |||| \\// |||| ||||  |||| ||||/\||||
    \\\///  /////\/\\\\\   ||||  \/  |||| ||||  |||| ||||  ||||
     ////  ////      \\\\  ||||      |||| ||||  |||| ||||  ||||
    ////  ////        \\\\ ||||      ||||  \\\\////  ||||  ||||

                     Yet Another Monitor
               Copyright (c) 2013-2014 Al Caughey
                     All rights reserved.
                  http://usage-monitoring.com
Launch options:
  + <path to yamon2.sh>
  + <path to yamon2.sh> <path to config.file>
  + <path to yamon2.sh> --help
  + <path to yamon2.sh> --stop

YAMon :: 2.1.0b

root@Nighthawk:/tmp/mnt/sda1/yamon# iptables v1.3.7: host/network `192.168.x.xxx' not found
iptables v1.3.7: host/network `192.168.x.xxx' not found


Probably due to the fact that I am running 10.0.0.* as my network.

edit: Or maybe that the default setting for 'includebridge' is set to 1.


Last edited by Mizehra on Mon Jun 01, 2015 13:07; edited 1 time in total
al_c
DD-WRT Guru


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

PostPosted: Mon Jun 01, 2015 12:15    Post subject: Reply with quote
Mizehra wrote:


YAMon :: 2.1.0b

root@Nighthawk:/tmp/mnt/sda1/yamon# iptables v1.3.7: host/network `192.168.x.xxx' not found
iptables v1.3.7: host/network `192.168.x.xxx' not found[/code][/code]

Probably due to the fact that I am running 10.0.0.* as my network.

edit: Or maybe that the default setting for 'includebridge' is set to 1.


You are right... _includeBridge should be 0 (unless you have a bridge in your network). Change line #68 of `default config.file`.

My bad for leaving an incorrect value in the config. No help to you but I've fixed the zip file on page one of this thread. Thanks for pointing this out.

Al
Goto page Previous  1, 2, 3 ... 69, 70, 71 ... 107, 108, 109  Next Display posts from previous:    Page 70 of 109
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware 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