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 ... 13, 14, 15 ... 107, 108, 109  Next
Author Message
corrinewinslow
DD-WRT Novice


Joined: 28 Apr 2014
Posts: 9

PostPosted: Fri May 09, 2014 2:48    Post subject: Reply with quote
How are hostnames updated? e.g. manual edits of user.js or dynamically from dnsmasq.leases?

Conan
Sponsor
al_c
DD-WRT Guru


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

PostPosted: Fri May 09, 2014 3:01    Post subject: Reply with quote
corrinewinslow wrote:
How are hostnames updated? e.g. manual edits of user.js or dynamically from dnsmasq.leases?

Conan

Conan - currently the former
corrinewinslow
DD-WRT Novice


Joined: 28 Apr 2014
Posts: 9

PostPosted: Fri May 09, 2014 14:36    Post subject: Reply with quote
al_c wrote:
corrinewinslow wrote:
How are hostnames updated? e.g. manual edits of user.js or dynamically from dnsmasq.leases?

Conan

Conan - currently the former


Read tons of posts on YAMon and predecessors. Really appreciate what you did with YAMon. Amazing work. It's a quick way to narrow down who/what is using the network.

I chose DD-WRT over other firmwares partly because of YAMon.

It would be nice to have dynamic update of hostnames and integration into the DD-WRT webpages (as a MyPage?). I ended up writing awk scripts to convert dnsmasq.conf and dnsmasq.leases into user.js format. I'll post the scripts or regular expressions if they're useful to anyone.

Conan
corrinewinslow
DD-WRT Novice


Joined: 28 Apr 2014
Posts: 9

PostPosted: Fri May 09, 2014 15:07    Post subject: Reply with quote
Is Optware required by YAMon itself? Optware was mentioned in the installation instructions but I think this was more to enable USB support. The installation instructions leave the impression Optware is a YAMon requirement.

It would be nice to amend the instructions to clarify when Optware is required. This is particularly relevant for Atheros installations because Optware on Atheros a bit of a pain to do.
http://www.dd-wrt.com/phpBB2/viewtopic.php?p=893820#893820

Conan
corrinewinslow
DD-WRT Novice


Joined: 28 Apr 2014
Posts: 9

PostPosted: Fri May 09, 2014 15:13    Post subject: Reply with quote
This YAMon topic is in the Broadcom forum but I can confirm successfully running YAMon on Atheros (Buffalo WZR-HP-AG300H).

Conan
al_c
DD-WRT Guru


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

PostPosted: Fri May 09, 2014 16:42    Post subject: Reply with quote
corrinewinslow wrote:
al_c wrote:
corrinewinslow wrote:
How are hostnames updated? e.g. manual edits of user.js or dynamically from dnsmasq.leases?

Conan

Conan - currently the former


Read tons of posts on YAMon and predecessors. Really appreciate what you did with YAMon. Amazing work. It's a quick way to narrow down who/what is using the network.

I chose DD-WRT over other firmwares partly because of YAMon.

It would be nice to have dynamic update of hostnames and integration into the DD-WRT webpages (as a MyPage?). I ended up writing awk scripts to convert dnsmasq.conf and dnsmasq.leases into user.js format. I'll post the scripts or regular expressions if they're useful to anyone.

Conan


I'd love to see those scripts and would happily incorporate them into the main script (presuming that you don't mind)

Integration with MyPage has been on my radar for a while... It's taken far longer than expected to get V2 settled down... Sigh!
tsaylor
DD-WRT Novice


Joined: 20 Jan 2014
Posts: 19

PostPosted: Fri May 09, 2014 19:20    Post subject: Reply with quote
corrinewinslow wrote:
Is Optware required by YAMon itself? Optware was mentioned in the installation instructions but I think this was more to enable USB support. The installation instructions leave the impression Optware is a YAMon requirement.

Conan

I'm running on a Netgear R6250 with no optware at all, and with YAMon2 installed on a USB drive, so it doesn't seem there should be any requirement there. My dd-wrt version:

DD-WRT v24-sp2 (01/27/14) kongac
corrinewinslow
DD-WRT Novice


Joined: 28 Apr 2014
Posts: 9

PostPosted: Sat May 10, 2014 0:23    Post subject: Reply with quote
al_c wrote:
corrinewinslow wrote:

Read tons of posts on YAMon and predecessors. Really appreciate what you did with YAMon. Amazing work. It's a quick way to narrow down who/what is using the network.

I chose DD-WRT over other firmwares partly because of YAMon.

It would be nice to have dynamic update of hostnames and integration into the DD-WRT webpages (as a MyPage?). I ended up writing awk scripts to convert dnsmasq.conf and dnsmasq.leases into user.js format. I'll post the scripts or regular expressions if they're useful to anyone.

Conan


I'd love to see those scripts and would happily incorporate them into the main script (presuming that you don't mind)

Integration with MyPage has been on my radar for a while... It's taken far longer than expected to get V2 settled down... Sigh!


Two awk scripts for creating user.js files from dnsmasq.conf and dnsmasq.leases are attached. The script dnsmasq.leases.awk is the most likely to be used but I statically assign IP addresses in a custom dnsmasq.conf and use dnsmasq.conf.awk.

The regular expressions are the parts probably most useful for YAMon integration because they parse dnsmasq.conf and dnsmasq.leases into regular expression match groups and can be used in any programming language like javascript to parse fields from dnsmasq.leases entries.

Example script usage:
Code:

./dnsmasq.leases.awk /tmp/dnsmasq.leases /opt/YAMon2/data/users.js


Regular expression for dnsmasq.leases entries such as:
0 01:24:28:e5:06:9c 192.168.1.39 computer1 01:01:24:28:e5:06:9c
Code:

.*([0-9]+) ([0-9a-zA-Z]{2}:[0-9a-zA-Z]{2}:[0-9a-zA-Z]{2}:[0-9a-zA-Z]{2}:[0-9a-zA-Z]{2}:[0-9a-zA-Z]{2}) ([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}) ([0-9a-zA-Z\-]+|[\*]+) ([0-9a-zA-Z]{2}:[0-9a-zA-Z]{2}:[0-9a-zA-Z]{2}:[0-9a-zA-Z]{2}:[0-9a-zA-Z]{2}:[0-9a-zA-Z]{2}:[0-9a-zA-Z]{2}|[\*]+).*


Each of the five sets of round brackets in the regular expression correspond to the five fields in a dnsmasq.leases entry

Regular expression for dnsmasq.conf 'dhcp-host' entries such as:
dhcp-host=a5:77:08:59:ae:e4,192.168.1.39,computer1,infinite
Code:

.*([0-9a-zA-Z]{2}:[0-9a-zA-Z]{2}:[0-9a-zA-Z]{2}:[0-9a-zA-Z]{2}:[0-9a-zA-Z]{2}:[0-9a-zA-Z]{2}),([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}),([0-9a-zA-Z\-]+).*


Each of the four sets of round brackets in the regular expression correspond to the four fields in a dnsmasq.conf 'dhcp-host' entry

Hope this helps YAMon in some way.



awk scripts to create user.js from dnsmasq.zip
 Description:
awk scripts to parse dnsmasq to YAMon formatted users.js

Download
 Filename:  awk scripts to create user.js from dnsmasq.zip
 Filesize:  1.29 KB
 Downloaded:  257 Time(s)

Mizehra
DD-WRT Novice


Joined: 10 Oct 2013
Posts: 47

PostPosted: Sat May 10, 2014 13:08    Post subject: Reply with quote
I would love this as an option. I've become too used to my own naming scheme now to want to change it up.
Gnits
DD-WRT Novice


Joined: 10 Apr 2014
Posts: 28

PostPosted: Sun May 11, 2014 15:40    Post subject: Reply with quote
Mizehra wrote:
I would love this as an option. I've become too used to my own naming scheme now to want to change it up.



Maybe as a way to populate new devices? Then once they are in the Users.js you can change them and they are maintained?
Mizehra
DD-WRT Novice


Joined: 10 Oct 2013
Posts: 47

PostPosted: Mon May 12, 2014 1:51    Post subject: Reply with quote
Gnits wrote:
Mizehra wrote:
I would love this as an option. I've become too used to my own naming scheme now to want to change it up.



Maybe as a way to populate new devices? Then once they are in the Users.js you can change them and they are maintained?


That would be PERFECT. No more "Unknown device"!.. Unless it just has a blank or unknown name.
al_c
DD-WRT Guru


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

PostPosted: Mon May 12, 2014 18:05    Post subject: Reply with quote
Gnits wrote:
Mizehra wrote:
I would love this as an option. I've become too used to my own naming scheme now to want to change it up.



Maybe as a way to populate new devices? Then once they are in the Users.js you can change them and they are maintained?


I've something running on my router now... when a new device is detected on the network (i.e., no matching MAC address in users.js), I try to get the name from the dnsmasq.leases file (and if there is no match, I default to the generic `New Device`). It will not change any of the pre-existing entries in users.js.

I'm going to test it for a bit before putting it out

Al
slidermike
DD-WRT Guru


Joined: 11 Nov 2013
Posts: 1487
Location: USA

PostPosted: Mon May 12, 2014 18:09    Post subject: Reply with quote
Al,
that's great news!
So if I have 4 "new device" already in my users.js will those be attempted to dnsmasq or will we have to delete those devices so they can be re-discovered for the dnsmasq process to give us a resolve attempt?
al_c wrote:
It will not change any of the pre-existing entries in users.js.
Al

_________________
Router currently owned:
Netgear R7800 - Router
Netgear R7000 - AP mode

R7000 specific Tips/Tricks.
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=264152
al_c
DD-WRT Guru


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

PostPosted: Mon May 12, 2014 18:41    Post subject: Reply with quote
slidermike wrote:
Al,
that's great news!
So if I have 4 "new device" already in my users.js will those be attempted to dnsmasq or will we have to delete those devices so they can be re-discovered for the dnsmasq process to give us a resolve attempt?
al_c wrote:
It will not change any of the pre-existing entries in users.js.
Al


Now that you mention it, I suppose that I could look for new devices in users.js and try to update them as well...

But for the time being, the only way to trigger the updates is, as you suggested, to delete the entries from users.js (in /opt/YAMon2/data/). The updated file will get copied to /tmp/www /data/ within a few moments.

NB - this new feature is not available in 2.0.7. I want to make sure things are still running properly on my router before letting this out into the wild... that should be in a day or two. OK?

Al
corrinewinslow
DD-WRT Novice


Joined: 28 Apr 2014
Posts: 9

PostPosted: Tue May 13, 2014 2:41    Post subject: Reply with quote
al_c wrote:

I've something running on my router now... when a new device is detected on the network (i.e., no matching MAC address in users.js), I try to get the name from the dnsmasq.leases file (and if there is no match, I default to the generic `New Device`). It will not change any of the pre-existing entries in users.js.

I'm going to test it for a bit before putting it out

Al


Would it be possible to amend the name update process to first update users.js from static names (nvram static_leases and dnsmasq.conf) and then update from dynamic names (dnsmasq.leases)? That would cover all the places that names would come from.
Goto page Previous  1, 2, 3 ... 13, 14, 15 ... 107, 108, 109  Next Display posts from previous:    Page 14 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