Home Latest show Previous shows Presenters Forums Contact FAQ LugRadio Live Map Planet #lugradio

Any Python Programmers Bored?

General discussion about the LUGRadio shows.

Moderators: mrben, jono, matt, trig

z0mbix
New to the freak show
 
Posts: 38
Joined: Fri May 06, 2005 4:56 pm
Location: Harrow, UK

Any Python Programmers Bored?

Postby z0mbix on Thu Jul 21, 2005 1:33 pm

I'm only really able to program CLI scripts/programs, but I'm fed up of the ugly Nettraf TCL/TK Client. Does anyone fancy making a Python/GTK client?

Nettraf: http://www.nettraf.hpg.ig.com.br/

It looks like the client just receives this from the server:

DATA 3692021729 2804675136
DATA 3692027262 2804903117
DATA 3692033440 2805132420
DATA 3692038905 2805362340
DATA 3692049224 2805591921
DATA 3692061917 2805821085
DATA 3692079529 2806050515
DATA 3692083165 2806113976
DATA 3692088080 2806302771
DATA 3692093573 2806464284
DATA 3692097478 2806555280
DATA 3692100378 2806661159
DATA 3692103707 2806783217

Cheers z0mbix
If it ain't broke, it's Ubuntu

Elleomea
Knows their stuff
 
Posts: 264
Joined: Thu Apr 08, 2004 1:58 pm
Location: Aberystwyth, Wales

Postby Elleomea on Thu Jul 21, 2005 6:19 pm

I might have a go; already started knocking up the GUI, but be warned, if it takes me more than a day or two I'm likely to be distracted and lose interest ;).

Trying to keep the GUI similar to the Tk version (only prettier, obviously):

Image
Image
How much ham could a hamster stir, if a hamster could stir ham?

z0mbix
New to the freak show
 
Posts: 38
Joined: Fri May 06, 2005 4:56 pm
Location: Harrow, UK

Postby z0mbix on Thu Jul 21, 2005 9:31 pm

Wow, looking awesome! Thanks very much :D
If it ain't broke, it's Ubuntu

Elleomea
Knows their stuff
 
Posts: 264
Joined: Thu Apr 08, 2004 1:58 pm
Location: Aberystwyth, Wales

Postby Elleomea on Thu Jul 21, 2005 10:24 pm

I was planning on combining the In and Out graphs, in to two line graphs on the same axis with different coloured lines; would that be okay with you, or would you prefer the separate graphs that the original Tk interface employs? My thinking was simply that if you wanted to compare incoming and outgoing data flow this presentation style would be much nicer.
How much ham could a hamster stir, if a hamster could stir ham?

z0mbix
New to the freak show
 
Posts: 38
Joined: Fri May 06, 2005 4:56 pm
Location: Harrow, UK

Postby z0mbix on Thu Jul 21, 2005 10:32 pm

That's fine by me, I'm just happy that you're interesting in writing it. Something that would be nice though is the ability to run the program more than once to monitor more than one server, as I have atleast four servers what I'd like to monitor.
If it ain't broke, it's Ubuntu

Elleomea
Knows their stuff
 
Posts: 264
Joined: Thu Apr 08, 2004 1:58 pm
Location: Aberystwyth, Wales

Postby Elleomea on Fri Jul 22, 2005 2:18 am

Well, here's an initial version: http://linux.mikeasoft.com/gtknettraf.tar.gz

It should have all the features the Tk client has plus:
* A preference dialog.
* Semi-decent error checking.
* Unit selection (bytes, kilobytes, megabytes), so it can handle displaying anything from a few bytes to 10 megabytes of traffic (per second).
* Prettyness.

It should also work in Windows, though I haven't tested that.

Here are a few updated screenshots:

Image
Image
Image

If you nag me enough I might get around to adding support for multiple machines ;). How does having the display tabbed, with a separate tab for each machine sound?
How much ham could a hamster stir, if a hamster could stir ham?

z0mbix
New to the freak show
 
Posts: 38
Joined: Fri May 06, 2005 4:56 pm
Location: Harrow, UK

Postby z0mbix on Fri Jul 22, 2005 12:40 pm

It looks superb, thank you very much :D I'm not sure if it's me being a bit stupid, but the readings are quite different between both clients. I have both running at the same time: Both are set to bytes per second. This is what I'm seeing:

Image

With the tk version you have to set the min/max bytes per sec in ~/.nettrafcrc

What exactly is the DATA line the client receives?
If it ain't broke, it's Ubuntu

Elleomea
Knows their stuff
 
Posts: 264
Joined: Thu Apr 08, 2004 1:58 pm
Location: Aberystwyth, Wales

Postby Elleomea on Fri Jul 22, 2005 1:08 pm

Strange; I get almost identical results from both clients, there's a slight time difference between when they each update though. Are you sure this isn't what's causing the difference? The two graphs look fairly similar in shape, and the GTK client looks to be in the middle of a spike of activity while the Tk client looks as though it might be at the end of it.

Image

Also have you checked they're monitoring the same interface? The default Tk setup looks at ppp0, while the default GTK setup looks at eth0. Though this would seem unlikely due to the similarity of the graphs.
Last edited by Elleomea on Fri Jul 22, 2005 1:17 pm, edited 1 time in total.
How much ham could a hamster stir, if a hamster could stir ham?

Elleomea
Knows their stuff
 
Posts: 264
Joined: Thu Apr 08, 2004 1:58 pm
Location: Aberystwyth, Wales

Postby Elleomea on Fri Jul 22, 2005 1:13 pm

On second thoughts, try this version: http://linux.mikeasoft.com/gtknettraf-1.0.1.tar.gz

I might have been assuming network conditions would be more perfect than I should have; since I was testing on the localhost this wouldn't have come up as an issue, but over a real network it'd be more likely to become apparent.
How much ham could a hamster stir, if a hamster could stir ham?

z0mbix
New to the freak show
 
Posts: 38
Joined: Fri May 06, 2005 4:56 pm
Location: Harrow, UK

Postby z0mbix on Fri Jul 22, 2005 1:35 pm

:D Yes both monitoring same IP and Interface. The newer version has made a difference. It looks much more acurate now, thanks. The only thing is out graph line dissappeared during heavy out traffic, so would there be a way to set the min/max or maybe there's a better way of doing it.

Image

It is much quicker to get the data than the tk version, so i can now see it's getting exactly the same data. Thanks again :D
If it ain't broke, it's Ubuntu

Elleomea
Knows their stuff
 
Posts: 264
Joined: Thu Apr 08, 2004 1:58 pm
Location: Aberystwyth, Wales

Postby Elleomea on Fri Jul 22, 2005 1:45 pm

Well, as things stand if you switch the units to kilobytes you'll be able to see things during heavy traffic periods; I'll see about making it more customisable later today.
How much ham could a hamster stir, if a hamster could stir ham?

z0mbix
New to the freak show
 
Posts: 38
Joined: Fri May 06, 2005 4:56 pm
Location: Harrow, UK

Postby z0mbix on Fri Jul 22, 2005 2:39 pm

OK, thats great. I can't thank you enough. You should definately publish this somewhere so other sysadmins can be put out of their tk misery!
If it ain't broke, it's Ubuntu

Elleomea
Knows their stuff
 
Posts: 264
Joined: Thu Apr 08, 2004 1:58 pm
Location: Aberystwyth, Wales

Postby Elleomea on Fri Jul 22, 2005 3:24 pm

I've knocked up a little page at http://linux.mikeasoft.com/gtknettraf.php and sent an e-mail along to the author of NetTraf to let him know.
How much ham could a hamster stir, if a hamster could stir ham?

Elleomea
Knows their stuff
 
Posts: 264
Joined: Thu Apr 08, 2004 1:58 pm
Location: Aberystwyth, Wales

Postby Elleomea on Sun Jul 24, 2005 6:38 pm

I've almost finished support for multiple machines (mostly just need to rewrite the graph function to support it now), and I've added a display of the total amount of data sent and received from each machine. So I thought it was high time to show off a little more and give you a new screenshot or two to look at :).

Image
Image

Should be fully ready in the next day or two :).
How much ham could a hamster stir, if a hamster could stir ham?

z0mbix
New to the freak show
 
Posts: 38
Joined: Fri May 06, 2005 4:56 pm
Location: Harrow, UK

Postby z0mbix on Sun Jul 24, 2005 9:08 pm

Absolutely awesome! Thank you very much :D
If it ain't broke, it's Ubuntu

Next

Return to General Discussion

Who is online

Users browsing this forum: MSN [Bot] and 1 guest

cron