On Fri, 20 Jan 2006 11:53:46 -0500, "Spencer B. Torene" wrote 
in <[EMAIL PROTECTED]>:
> 
> I just got into using Perl scripts on remote servers and MRTG.  One
> remote script, which uses this command-line command:
> 
> "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 <[EMAIL PROTECTED]>

--
Unsubscribe mailto:[EMAIL PROTECTED]
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

Reply via email to