[mrtg] Re: Suppressing command-line errors, using perl scripts

Spencer B. Torene sbtorene at pbs.org
Tue Jan 24 18:46:40 MET 2006


Thank you very much, Takumi.  Everything is working perfectly now.

I only had to add " 2> /dev/null" to the end of the script call.

I haven't tried your netstat command yet, but it does look much better
than mine.  I'll give it a go in the near future.


Thanks again!
Spencer


> "netstat -a -n | grep -E "^(tcp)"| cut -c 68-|sort|uniq -c | sort -n |
> grep TIME_WAIT"
> 
> Is causing a bunch of messages to be sent to the MRTG server that look
> like this:
[snip]
> warning, got bogus tcp line.
[snip]
> so is there a way of suppressing these warnings?

Assuming you are Linux luser:
  man bash
then read a section 'REDIRECTION'
and
  man null

See also http://www.freeos.com/guides/lsst/ch04sec1.html
You got the idea, I hope.


An alternative to your (complex) script:
  netstat --ip -na | awk 'BEGIN {c=0} /^tcp.* TIME_WAIT / {c++} \
    END {print c}'

-- 
Takumi Yamane <yamtak at b-session.com>


_________________________________________________________________

AFRICAN AMERICAN LIVES
Join nine African Americans on an extraordinary journey to discover their past.
Wednesday, February 1st, 9/8C only on PBS
pbs.org/africanamericanlives
_________________________________________________________________

This email may contain material that is confidential or proprietary to PBS and is intended solely for use by the intended recipient.  Any review, reliance or distribution of such material by others, or forwarding of such material without express permission, is strictly prohibited.  If you are not the intended recipient, please notify the sender and destroy all copies.
_________________________________________________________________

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://lists.ee.ethz.ch/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the mrtg mailing list