YAMon v4... usage totals by device

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Goto page Previous  1, 2, 3 ... 10, 11, 12 ... 16, 17, 18  Next
Author Message
al_c
DD-WRT Guru


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

PostPosted: Thu Apr 02, 2020 11:57    Post subject: Reply with quote
slippypete wrote:
The Daily Usage Report tab is only displaying the information for a single hour. I tracked down the bug - there is an extraneous line in the yamon4.0.js::Totals() routine that causes it to except out of the loaded hourly .js file and not execute any of the subsequent logic - in bold:

var mem=(arr.memory).replace(/[{}]/g,"").split(',')
hourly_totals.memory[hr]=mem
$("#sp-freeMem").text(mem[0])
disk_utilization=arr.disk_utilization
drawSummaryGauges(arr.disk_utilization, arr.memory )
$('#uptime').text(sec2text(arr.uptime))

The bolded line is missing a "var". The variable isn't used anyway (uses arr.disk_utilizaiton directly instead in the line below it), so I assume it's extraneous. If I remove the line then all the hours are properly rendered.


Bugger... missed that Embarassed . I'd fixed the issue in the `dev` version of the JS and forgot to post the change to `current`.

Check again, it should be fixed now (you might to reload the reports with a <ctrl>+F5 to force a refresh of the JS files).

Thanks for not only reporting the issue but also finding the resolution. It makes my life much simpler. FWIW, the JS code is also posted to the YAMon GitHub repository (https://github.com/al-caughey/YAMon-v4) so you can also fix the issues (in the code base at least... I will still have to sync to the server)

Thanks to everyone for your support & assistance. Stay safe.

Al

_________________
Thanks to everyone for supporting YAMon!

If you use and like YAMon and have not done so recently, please consider making a donation - thanks!
YAMon GitHub Repository
Sponsor
slippypete
DD-WRT Novice


Joined: 15 Jan 2020
Posts: 6

PostPosted: Thu Apr 02, 2020 14:05    Post subject: Reply with quote
Thanks Al! Btw, while debugging that I ran into another issue - I wanted to pause the cron jobs to keep the .js from updating while I was stepping through the javascript code but pause.sh wasn't successfully commenting out the YAMon4 jobs. Here's the issue in start-stop.sh:

Original:
Code:

StopScheduledJobs(){                                                             
        StopCronJobs(){                                                           
                nfc=""                                                             
                local jobList=$(cat "$cronJobsFile")                               
                IFS=$'\n'                           
                for job in $jobList
                do
                        [ ! -z $(echo "$line" | grep "$d_baseDir" | grep -v '^##') ] && line="## $job"
                        [ -z $nfc ] && nfc="$job" && continue                                       
                        nfc="$nfc\n$job"                                                           
                done                                       
                unset $IFS                                 
                echo -e "$nfc" > $cronJobsFile           
                                             
                Send2Log "StopCronJobs: $(IndentList "$nfc")" 1
                ResetCron                                       
        }


Replaced "line" with "job" at two places in the first line after the do:
Code:

                        [ ! -z $(echo "$job" | grep "$d_baseDir" | grep -v '^##') ] && job="## $job"



Also, on my openwrt installation crond doesn't always pick up the changes. I had to manually create the cron.update file to do so. (cron.update contains list of users with updated cron files, so in this case just "root").
al_c
DD-WRT Guru


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

PostPosted: Thu Apr 02, 2020 19:08    Post subject: Reply with quote
slippypete wrote:
Thanks Al! Btw, while debugging that I ran into another issue - I wanted to pause the cron jobs to keep the .js from updating while I was stepping through the javascript code but pause.sh wasn't successfully commenting out the YAMon4 jobs. Here's the issue in start-stop.sh:

Original:
Code:

StopScheduledJobs(){                                                             
        StopCronJobs(){                                                           
                nfc=""                                                             
                local jobList=$(cat "$cronJobsFile")                               
                IFS=$'\n'                           
                for job in $jobList
                do
                        [ ! -z $(echo "$line" | grep "$d_baseDir" | grep -v '^##') ] && line="## $job"
                        [ -z $nfc ] && nfc="$job" && continue                                       
                        nfc="$nfc\n$job"                                                           
                done                                       
                unset $IFS                                 
                echo -e "$nfc" > $cronJobsFile           
                                             
                Send2Log "StopCronJobs: $(IndentList "$nfc")" 1
                ResetCron                                       
        }


Replaced "line" with "job" at two places in the first line after the do:
Code:

                        [ ! -z $(echo "$job" | grep "$d_baseDir" | grep -v '^##') ] && job="## $job"



Also, on my openwrt installation crond doesn't always pick up the changes. I had to manually create the cron.update file to do so. (cron.update contains list of users with updated cron files, so in this case just "root").


Double Bugger.

WRT to picking up the changes, are you perhaps suggesting that in ResetCron, we should be creating crond.update?... that would be easy enough to do

_________________
Thanks to everyone for supporting YAMon!

If you use and like YAMon and have not done so recently, please consider making a donation - thanks!
YAMon GitHub Repository
slippypete
DD-WRT Novice


Joined: 15 Jan 2020
Posts: 6

PostPosted: Fri Apr 03, 2020 13:29    Post subject: Reply with quote
al_c wrote:

WRT to picking up the changes, are you perhaps suggesting that in ResetCron, we should be creating crond.update?... that would be easy enough to do


I'm not sure if it's the right/universal way for crond to be notified of updates but it worked for me on openwrt. I used the following:

echo "root" >> /etc/crontabs/cron.update
abhijitat
DD-WRT User


Joined: 06 Feb 2020
Posts: 167
Location: Maharashtra, India

PostPosted: Thu Apr 09, 2020 3:47    Post subject: Reply with quote
https://usage-monitoring.com/ is not working, realized in the morning when suddenly reports stopped working.
al_c
DD-WRT Guru


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

PostPosted: Thu Apr 09, 2020 4:02    Post subject: Reply with quote
abhijitat wrote:
https://usage-monitoring.com/ is not working, realized in the morning when suddenly reports stopped working.


Sorry - but it appears that the HTTP side of my website has gone down... I can get into the site via WinSCP or through my ISPs web interface and all of the content is still there. It looks like my ISP is having troubles at their end (e.g., their online support chat is not working as well).

YAMon should (AFAIK) still be collecting all of your data. You just won't be able to access the reports until my ISP gets their sh*t together.

Sorry for the inconvenience.

Al

_________________
Thanks to everyone for supporting YAMon!

If you use and like YAMon and have not done so recently, please consider making a donation - thanks!
YAMon GitHub Repository
abhijitat
DD-WRT User


Joined: 06 Feb 2020
Posts: 167
Location: Maharashtra, India

PostPosted: Thu Apr 09, 2020 5:03    Post subject: Reply with quote
No worries, I can confirm data is being collected. Its only the report that is not working as it gets some scripts from site.

Will wait for this to resolve. posted this here so that you are aware of the issue.
al_c
DD-WRT Guru


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

PostPosted: Thu Apr 09, 2020 11:01    Post subject: Reply with quote
abhijitat wrote:
No worries, I can confirm data is being collected. Its only the report that is not working as it gets some scripts from site.

Will wait for this to resolve. posted this here so that you are aware of the issue.


Thx... The website is up and running again so your reports should work again as well

_________________
Thanks to everyone for supporting YAMon!

If you use and like YAMon and have not done so recently, please consider making a donation - thanks!
YAMon GitHub Repository
rgbWRT
DD-WRT Novice


Joined: 05 May 2013
Posts: 2

PostPosted: Fri Apr 10, 2020 5:37    Post subject: Reply with quote
Hi Al (et al),

Long time DD-WRT aficionado, newbie YAMon user (please be gentle).

I've tried (i.e. thought I needed) Zabbix, SNMP, various RFlow tools like Netflow Analyzer, but what I really needed was YAMon... thank you for the pride and passion you have so obviously poured into this project.

I just installed v4.0.7 on a Netgear R8500 running kongs last version 40270M ='( and am having an issue I don't see in any previous post on the board, so my first post ever in 7 years as a DD-WRT member is for YAMon :0)

I'm seeing GetTraffic() errors in the log file. The first two (and only two) successful GetTraffic() calls I see in the logs look like this;

20:08:02
GetTraffic: down: 752317 / 5506540

but all subsequent calls look like this;

20:12:01
GetTraffic: down: 53498041 53497713 53497132 53497056 53493469 53492702 53492702 53491485 53491485 53490868 53490788 53490198 53490198 53489449 53489369 53489301 53489301 53488468 53488073 53487997 53487554 53487474 53486928 53486928 53486126 53486126 53486018 53486018 53485272 53484837 53484769 53478476 / 619
/opt/YAMon4/update-reports.sh: line 130: arithmetic syntax error

While the entry says it's coming from update-reports.sh line 130, it's actually the sourced /includes/traffic.sh line 130... the relevant line in that script would be;
Code:
total_down=$(( $total_down + ${do:-0} ))

but intuition tells me that the GetTraffic() call should only be returning two numbers representing total_up and total_down bytes for the corresponding interval.

Once that error occurs the remaining raw-traffic files are all empty.

Have you (has anyone) seen this before? Can anyone point me in the right direction to continue troubleshooting? Let me know what further information/data you may need, be glad to send setup and validation logs.

Thx
rgbWRT
DD-WRT Novice


Joined: 05 May 2013
Posts: 2

PostPosted: Sat Apr 11, 2020 20:54    Post subject: Reply with quote
Quick update: I stopped all cron jobs, deleted all files created post-installation (data, directories, etc.), rebooted the router, and didn't touch anything for 24 hours (as I saw suggested here before)... voila'

Thank you for your time Wink
wildblue52
DD-WRT Novice


Joined: 23 Oct 2016
Posts: 5

PostPosted: Tue Apr 14, 2020 14:42    Post subject: Reply with quote
rgbWRT wrote:
Hi Al (et al),

Long time DD-WRT aficionado, newbie YAMon user (please be gentle).

I've tried (i.e. thought I needed) Zabbix, SNMP, various RFlow tools like Netflow Analyzer, but what I really needed was YAMon... thank you for the pride and passion you have so obviously poured into this project.

I just installed v4.0.7 on a Netgear R8500 running kongs last version 40270M ='( and am having an issue I don't see in any previous post on the board, so my first post ever in 7 years as a DD-WRT member is for YAMon :0)

I'm seeing GetTraffic() errors in the log file. The first two (and only two) successful GetTraffic() calls I see in the logs look like this;

20:08:02
GetTraffic: down: 752317 / 5506540

but all subsequent calls look like this;

20:12:01
GetTraffic: down: 53498041 53497713 53497132 53497056 53493469 53492702 53492702 53491485 53491485 53490868 53490788 53490198 53490198 53489449 53489369 53489301 53489301 53488468 53488073 53487997 53487554 53487474 53486928 53486928 53486126 53486126 53486018 53486018 53485272 53484837 53484769 53478476 / 619
/opt/YAMon4/update-reports.sh: line 130: arithmetic syntax error

While the entry says it's coming from update-reports.sh line 130, it's actually the sourced /includes/traffic.sh line 130... the relevant line in that script would be;
Code:
total_down=$(( $total_down + ${do:-0} ))

but intuition tells me that the GetTraffic() call should only be returning two numbers representing total_up and total_down bytes for the corresponding interval.

Once that error occurs the remaining raw-traffic files are all empty.

Have you (has anyone) seen this before? Can anyone point me in the right direction to continue troubleshooting? Let me know what further information/data you may need, be glad to send setup and validation logs.

Thx


I'm getting something similar. I updated a few weeks ago and noticed that my data files were empty. I ran the install again yesterday and got hourly traffic for one hour, then it stops again. I'm seeing the same error you have:


Code:
CheckMacIP4Duplicates: no duplicate entries in /tmp/yamon/mac-ip.txt
16:36:03
GetTraffic: down: 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 702765 / 223908513
/opt/YAMon4/update-reports.sh: line 130: arithmetic syntax error
16:37:00
traffic.sh: --> 16:33 -> 16:37
16:38:00
traffic.sh: --> 16:34 -> 16:38


Is there an easy way to fix this? Or is it just easier to start all over?
ddaniel51
DD-WRT Guru


Joined: 19 Feb 2013
Posts: 1464

PostPosted: Sat Apr 18, 2020 8:55    Post subject: Reply with quote
@wildblue52

Did you read the post just above yours?

_________________
Segment 1 XR700 10Gb LAN, 1Gb WAN ISP BS
Wired AP 1 Unifi Wifi 6 LR US 1Gb LAN
Wired AP 2 Unifi Wifi 6 LR US 1Gb LAN
Wired AP 3 Unifi Wifi 6 LR US 1Gb LAN
Syslog Services Asustor 7110T NAS 10GB
NetGear XS716T 10GB Switch
download1.dd-wrt.com/dd-wrtv2/downloads/betas/ (Brain Slayer)
YAMon https://usage-monitoring.com/index.php
wildblue52
DD-WRT Novice


Joined: 23 Oct 2016
Posts: 5

PostPosted: Mon Apr 20, 2020 15:42    Post subject: Reply with quote
ddaniel51 wrote:
@wildblue52

Did you read the post just above yours?

I did. "Delete all files and wait" seemed vague and extreme - I was hoping for an easier solution.
FWIW - I did end up deleting the entire Yamon4 directory and reinstalling. I still had the same issue. I ended up deleting the /tmp/yamon/ directory and that appears to have solved it. I'm hoping I can just put my db key back in the config file and all will be back to normal.
ddaniel51
DD-WRT Guru


Joined: 19 Feb 2013
Posts: 1464

PostPosted: Sun Apr 26, 2020 2:10    Post subject: Reply with quote
Why does the Devices tab turn gray and unresponsive?
_________________
Segment 1 XR700 10Gb LAN, 1Gb WAN ISP BS
Wired AP 1 Unifi Wifi 6 LR US 1Gb LAN
Wired AP 2 Unifi Wifi 6 LR US 1Gb LAN
Wired AP 3 Unifi Wifi 6 LR US 1Gb LAN
Syslog Services Asustor 7110T NAS 10GB
NetGear XS716T 10GB Switch
download1.dd-wrt.com/dd-wrtv2/downloads/betas/ (Brain Slayer)
YAMon https://usage-monitoring.com/index.php
meyers
DD-WRT Novice


Joined: 14 Apr 2020
Posts: 11

PostPosted: Tue Apr 28, 2020 22:06    Post subject: Reply with quote
Heya, I just installed YAMonv4 and so far it looks awesome Very Happy

However there have been two things that are causing me some issues,

First when I reboot the router it doesn't seem to start YAMon. The startup script is there but when I go to the reports page it's just a blank screen. If I ssh in and start /opt/YAMon4/start.sh then everything seems to work normally. I looked at the tmp directories and nothing for YAMon is there, so I didn't think that the troubleshooting on that page that requires them being there would help.

Secondly, every time I open the page it shows a prompt to enter the monthly data cap. Additionally it asks if I want to participate in a poll and asks for a donation. I don't think this is supposed to show every time I refresh.

The data usage also seems to be off by 5 ish gb a day, upnp and SFE are disabled

Any help would be appreciated, thanks.
Goto page Previous  1, 2, 3 ... 10, 11, 12 ... 16, 17, 18  Next Display posts from previous:    Page 11 of 18
Post new topic   Reply to topic    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