I set up a Perl script to parse the output of ''tc -s qdisc show dev <if>'' to get stats for MRTG. The only problem is, every time the tc command runs, I get many lines output to my kernel level syslog - 84, to be exact They look something like this: oatmail kernel: htb*c10124 m=2 t=22748 c=19272 pq=0 df=4907008 ql=0 pa=0 f: oatmail kernel: htb*c10094 m=2 t=86150 c=86150 pq=0 df=237568 ql=0 pa=0 f: oatmail kernel: htb*g j=171630276 oatmail kernel: htb*r7 m=0 oatmail kernel: htb*r6 m=0 I found some reference in the source to a command to tc to set various debug levels, although the function that seems to be printing the info (htb_debug_dump) does not seem to care about the set level - if debug is defined, it prints. Short of altering the DEFINE statement and recompiling the kernel, is there any way to disable this output? Thanks, Brad _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Thursday 13 February 2003 08:10, Brad Davidson wrote:> I set up a Perl script to parse the output of ''tc -s qdisc show dev <if>'' > to get stats for MRTG. The only problem is, every time the tc command runs, > I get many lines output to my kernel level syslog - 84, to be exact They > look something like this: > > oatmail kernel: htb*c10124 m=2 t=22748 c=19272 pq=0 df=4907008 ql=0 pa=0 f: > oatmail kernel: htb*c10094 m=2 t=86150 c=86150 pq=0 df=237568 ql=0 pa=0 f: > oatmail kernel: htb*g j=171630276 > oatmail kernel: htb*r7 m=0 > oatmail kernel: htb*r6 m=0 > > I found some reference in the source to a command to tc to set various > debug levels, although the function that seems to be printing the info > (htb_debug_dump) does not seem to care about the set level - if debug is > defined, it prints. Short of altering the DEFINE statement and recompiling > the kernel, is there any way to disable this output?I had the same problem. I uncomment the DEFINE statement. But logging there numbers, means there is something miss with your htb setup and has nothing to do with you asking for statistics. You can find more info on the homepage of htb. But it''s possible that your rates settings are too low. Stef -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
This is probably the wrong forum for this, a small patch for arping. However: - the guy who wrote arping, part of iputils, also wrote iproute2 - that guy is pretty much unreachable -- or I have to presume so, because his ftp site, the main site for his work, has been broken for months now - I don''t know where else to send it - it might be useful to someone else It''s just a fix for an annoyance -- you should be able to arping from a source address you don''t actually have. Don''t ask me why one would want to do this; it solves a detailed problem I have, and I can''t be the only one. Btw, if you''re interested enough to have read this far, this patches cleanly over the RedHat 8.0-patched version of arping. It adds one option, -B, which means, "don''t bother trying to bind, just do your business." -Steve --- arping.c 2003-02-13 00:45:26.000000000 -0800 +++ arping.c.new 2003-02-13 00:44:45.000000000 -0800 @@ -38,6 +38,7 @@ char *device="eth0"; int ifindex; char *source; +int nobind=0; struct in_addr src, dst; char *target; int dad, unsolicited, advert; @@ -62,7 +63,7 @@ void usage(void) { fprintf(stderr, - "Usage: arping [-fqbDUAV] [-c count] [-w timeout] [-I device] [-s source] destination\n" + "Usage: arping [-fqbDUAVB] [-c count] [-w timeout] [-I device] [-s source] destination\n" " -f : quit on first reply\n" " -q : be quiet\n" " -b : keep broadcasting, don''t go unicast\n" @@ -70,6 +71,7 @@ " -U : Unsolicited ARP mode, update your neighbours\n" " -A : ARP answer mode, update your neighbours\n" " -V : print version and exit\n" + " -B : do not try to bind to source address\n" " -c count : how many packets to send\n" " -w timeout : how long to wait for a reply\n" " -I device : which ethernet device to use (eth0)\n" @@ -306,7 +308,7 @@ setuid(uid); - while ((ch = getopt(argc, argv, "h?bfDUAqc:w:s:I:V")) != EOF) { + while ((ch = getopt(argc, argv, "h?bfDUAqc:w:s:I:VB")) != EOF) { switch(ch) { case ''b'': broadcast_only=1; @@ -340,6 +342,9 @@ case ''s'': source = optarg; break; + case ''B'': + nobind = 1; + break; case ''V'': printf("arping utility, iputils-ss%s\n", SNAPSHOT); exit(0); @@ -428,7 +433,7 @@ saddr.sin_family = AF_INET; if (src.s_addr) { saddr.sin_addr = src; - if (bind(probe_fd, (struct sockaddr*)&saddr, sizeof(saddr)) == -1) { + if (!nobind && bind(probe_fd, (struct sockaddr*)&saddr, sizeof(saddr)) == -1) { perror("bind"); exit(2); }
On Thu, 13 Feb 2003 at 00:41:54, Stef Coene wrote:> On Thursday 13 February 2003 08:10, Brad Davidson wrote: > I had the same problem. I uncomment the DEFINE statement. But logging there > numbers, means there is something miss with your htb setup and has nothing to > do with you asking for statistics. You can find more info on the homepage of > htb. But it''s possible that your rates settings are too low. > > StefI used htb.init (http://freshmeat.net/projects/htb.init/) to make my rules, so I''m pretty sure they should be OK. I''m looking at the code in htb_dump, which appears to be what''s called to get statistics information by the tc application. It looks to me like if you have debug enabled, as part of the stats collecting routine, it calls htb_debug_dump regardless of whether or not there''s anything wrong with your setup. There are other circumstances that it prints an error message followed by a debug dump, but I''m not seeing an error. It just looks to me like debug info is printed every time a queue is polled for stats info. If you want to take a look at what I''m talking about, check out line 1211 of sch_htb.c _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Thu, 13 Feb 2003 at 01:58:53, Brad Davidson wrote:> I''m looking at the code in htb_dump, which appears to be what''s called to get > statistics information by the tc application. It looks to me like if you have > debug enabled, as part of the stats collecting routine, it calls htb_debug_dump > regardless of whether or not there''s anything wrong with your setup. > If you want to take a look at what I''m talking about, check out line 1211 of > sch_htb.cBTW I just commented out the line in question and recompiled the module. It no longer floods the logs. As far as I can tell, there''s no good reason for it to do that. It doesn''t even check the requested debug levels, or do it of somtehing''s wrong. Every time stats info is polled, you get debug info whether you wanted it or not. Anybody else confirm this going on? Or am I just crazy? _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Thursday 13 February 2003 10:34, Brad Davidson wrote:> On Thu, 13 Feb 2003 at 00:41:54, Stef Coene wrote: > > On Thursday 13 February 2003 08:10, Brad Davidson wrote: > > I had the same problem. I uncomment the DEFINE statement. But logging > > there numbers, means there is something miss with your htb setup and has > > nothing to do with you asking for statistics. You can find more info on > > the homepage of htb. But it''s possible that your rates settings are too > > low. > > > > Stef > > I used htb.init (http://freshmeat.net/projects/htb.init/) to make my rules, > so I''m pretty sure they should be OK.But still you can configure a class with a too low rate.> I''m looking at the code in htb_dump, which appears to be what''s called to > get statistics information by the tc application. It looks to me like if > you have debug enabled, as part of the stats collecting routine, it calls > htb_debug_dump regardless of whether or not there''s anything wrong with > your setup. > > There are other circumstances that it prints an error message followed by a > debug dump, but I''m not seeing an error. It just looks to me like debug > info is printed every time a queue is polled for stats info. > > If you want to take a look at what I''m talking about, check out line 1211 > of sch_htb.cDevik? Debug problems? Stef -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Thu, 13 Feb 2003 at 11:46:55, Stef Coene wrote:> > I used htb.init (http://freshmeat.net/projects/htb.init/) to make my > rules, > > so I''m pretty sure they should be OK. > But still you can configure a class with a too low rate.I know. I''ve seen one error message in the past regarding a too-low rate, but I have since reconfigured my rules, and haven''t seen any warnings since. I don''t have any classes set with really low rates - 256kb/sec is the lowest.> Devik? Debug problems?How about a sub-option on the HTB config option to enable/disable debugging, as opposed to a #DEFINE in the source? Or maybe just a comment as to why it''s printing all this :P _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/