From: Michael R. <re...@eu...> - 2003-03-20 07:55:24
|
Hi Eric again, > I have a firewall with 4 eth* ports on it. My eth0 is connected to a T1 > which is rated at about 1.5mbit/s. How do I configure lcd4linux to > monitor only that eth0 port and show's the usage in kbps/s and as a graph? > > If I can get this to work, I'll be able to see my T1's utilization at a > glance.. I'm afraid this does not work at the moment, but it's on my Todo-List for a while now. The problem is that this would need a bit redesign in the token structure. There is a _big_ redesign ongoing, but at the moment only in my mind. YOu could patch lcd4linux so it does not sum up all the eth* devices, but use only eth0: system.c function Net() while ((s=strsep(&p, "\n"))) { int n, u; unsigned long v[16]; n=sscanf (s, " eth%d: %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld", &u, &v[0], &v[1], &v[2], &v[3], &v[4], &v[5], &v[6], &v[7], &v[8], &v[9], &v[10], &v[11], &v[12], &v[13], &v[14], &v[15]); ==> add the following line here: if (u != 0) continue; ==> done! if (n==17) { pkg_rx+=v[0]; pkg_tx+=v[8]; *bytes=1; } else if (n==12) { pkg_rx+=v[0]; pkg_tx+=v[5]; *bytes=0; } else if (n>0) { error ("parse(/proc/net/dev) failed: unknown format"); fd=-1; return -1; } } warning! This is untested! This would skip every line except eth0 HTH, Michael -- netWorks Vox: +43 316 698260 Michael Reinelt Fax: +43 316 692343 Geisslergasse 4 GSM: +43 676 3079941 A-8045 Graz, Austria e-mail: re...@eu... |