cancel
Showing results for 
Search instead for 
Did you mean: 

ADSL monitoring and graphing tool for BSD ?

disfroot
Rising Star
Posts: 236
Thanks: 11
Registered: ‎28-04-2008

ADSL monitoring and graphing tool for BSD ?

Hi,
Any favourite BSD Unix (or AMP) solutions for monitoring and graphing line stats ?
I've found NINO http://nino.sourceforge.net/nino/nino.html which can use an ADSL SNMP MIB from here http://www.oidview.com/mibs/0/ADSL-LINE-MIB.html
It's not a dedicated ADSL tool, though, so it's not clear whether it will display the ADSL MIB block in a friendly or useful way ( with graphing and logging).
As it's SNMP, it should work with quite a few routers without HTML page hacking or undocumented debug telnet modes.
9 REPLIES 9
avatastic
Grafter
Posts: 1,136
Thanks: 2
Registered: ‎30-07-2007

Re: ADSL monitoring and graphing tool for BSD ?

I couldn't find one I liked so I ended up writing my own.
I use a small daemon I wrote in C to collect the information from snmp and then dump it in to a MySQL database.
I then wrote something in PHP to pull out the data and display it.
If you're interested I can put the source code up somewhere.
(This was written for and running under FreeBSD using the included bsnmpd and mysql 5)
F9 member since 4 Sep 1999
F9 ADSL customer since 27 Aug 2004
DLM manages your line the same way DRM manages your rights.
Look at all the pretty graphs! (now with uptime logging!)
WWWombat
Grafter
Posts: 1,412
Thanks: 4
Registered: ‎29-01-2009

Re: ADSL monitoring and graphing tool for BSD ?

I use Cacti as a webapp graphing tool, that relies on rrdtool to store the network statistics, which then gathers stats every 5 minutes. This is on Fedora Linux, so I guess it will work on BSD equally well.
My router/modem (Netgear DG834GT) doesn't support SNMP, so I wrote a Perl script that is used by Cacti, that logs in to the router to scrape the line stats. Over time, I've gradually added more scripts to gather information from Plusnet's portal, Speedtest.net, and another script that checks download speeds. The last gets updated at times, to control the bandwidth I use by restricting how often tests take place.
Cacti does support SNMP, and I use that for gathering data from other machines.
HOWEVER: Cacti doesn't support alarms or notifying problems to you - you'd need something like Nagios for that, but I never got around to setting that up.
Nowadays, I'd want the two to happen within 1 software package, and I'd probably use something like Zabbix; I just haven't got around to doing it yet. With fibre coming soon, I'll lose access to the line stats, but will gain from having a SamKnows/Ofcom measurement box, so that will probably prompt me to give it a go. I did find a review page at http://workaround.org/node/304
Plusnet Customer
Using FTTC since 2011. Currently on 80/20 Unlimited Fibre Extra.
disfroot
Rising Star
Posts: 236
Thanks: 11
Registered: ‎28-04-2008

Re: ADSL monitoring and graphing tool for BSD ?

Thanks for the pointers ! Nino's install scripts need to be avoided for BSD, as they do bad things and assume init.d rather than rc.local.
Also a lot of apache faff-ing to get it to run in a /var/www chroot - particularly if you haven't already got mod_perl loaded and working, as I hadn't. I also couldn't work out whether having the server snmpd daemon running was necessary if I was only interested in the modem's stats. The server stats via SNMP are of no interest to me - only the ADSL MIB block. I think Nino has failed at the starting block 😞
@avatastic - perhaps you could post a tgz or bz2 as an attachment to this thread ?
@WWWombat -  Cacti looks rather good. There is an OpenBSD package for rrdtool (1.2.30), and I already have PHP5 installed.
petertaylor
Dabbler
Posts: 23
Registered: ‎10-05-2011

Re: ADSL monitoring and graphing tool for BSD ?

i'd also be very interested in doing this.
i use the TG585v8, so no SNMP, but i'm sure i could modify the perl script to do something similar.
i've become a bit of a graphing geek  Embarrassed i have an EON energy monitor, that i log the tempterature and current/max energy used.
WWWombat
Grafter
Posts: 1,412
Thanks: 4
Registered: ‎29-01-2009

Re: ADSL monitoring and graphing tool for BSD ?

I'm having issues with broadband at the moment, which gives me logistical problems getting the scripts & this page at the same time.
I'll try to post some of the perl scripts tomorrow, or over the weekend...
Plusnet Customer
Using FTTC since 2011. Currently on 80/20 Unlimited Fibre Extra.
petertaylor
Dabbler
Posts: 23
Registered: ‎10-05-2011

Re: ADSL monitoring and graphing tool for BSD ?

Hi WWWombat,
have you had any luck getting the scripts up yet?
avatastic
Grafter
Posts: 1,136
Thanks: 2
Registered: ‎30-07-2007

Re: ADSL monitoring and graphing tool for BSD ?

My C source file can be found at http://skynet.avatastic.co.uk/~adw/trafficmon.c
Build instructions are at the top, as are some of the variables that'll need to be set for your MySQL install.
The table that is logged to looks like
mysql> describe usage_log_c;
+----------+------------+------+-----+---------+-------+
| Field    | Type       | Null | Key | Default | Extra |
+----------+------------+------+-----+---------+-------+
| start    | bigint(20) | NO   | PRI | NULL    |       |
| up       | bigint(20) | NO   |     | NULL    |       |
| down     | bigint(20) | NO   |     | NULL    |       |
| duration | bigint(20) | NO   |     | NULL    |       |
+----------+------------+------+-----+---------+-------+
4 rows in set (0.09 sec)

The PHP is very bug riddled and I'm too ashamed to share it at the moment  Grin but when I've fixed it up, I'll whack that up too.
[edit]Looking at the OP, it looks like you're after line stats monitoring not Bandwidth usage logging. I've not got anything that does that.
My signature ---\/ works by using http to my Netgear DM111 and pppctl to the PPP client on the FreeBSD server.
The source for that can be found at http://skynet.avatastic.co.uk/~adw/uptime-src.phps
[/edit]
F9 member since 4 Sep 1999
F9 ADSL customer since 27 Aug 2004
DLM manages your line the same way DRM manages your rights.
Look at all the pretty graphs! (now with uptime logging!)
disfroot
Rising Star
Posts: 236
Thanks: 11
Registered: ‎28-04-2008

Re: ADSL monitoring and graphing tool for BSD ?

Thanks for posting the source ! Yes, I am interested in the ADSL bit really. More reading on the various implementations of SNMP in these SOHO modem-routers makes me think that simply turning on SNMP may generate problems - several are alleged to be very leaky and eventually crash the box. Ah well.
WWWombat
Grafter
Posts: 1,412
Thanks: 4
Registered: ‎29-01-2009

Re: ADSL monitoring and graphing tool for BSD ?

Quote from: petertaylor
Hi WWWombat,
have you had any luck getting the scripts up yet?

Sorry, I had to focus on some server re-install & backup problems first. Then Plusnet changed the layout of some oftheir website pages...
I'll get what I can here this afternoon...
Plusnet Customer
Using FTTC since 2011. Currently on 80/20 Unlimited Fibre Extra.