Article View: news.software.nntp
Article #27866Re: INN stats to MRTG
From: Jeff Liebermann
Date: Mon, 27 Apr 1998 00:00
Date: Mon, 27 Apr 1998 00:00
74 lines
3792 bytes
3792 bytes
On 26 Apr 1998 22:54:50 +0200, Stig Sandbeck Mathisen
<ssm@rlyeh.net> wrote:
>jeffl@comix.santa-cruz.ca.us (Jeff Liebermann) writes:
>
>> retch=`rcmd $1 "df -v -i $2" | tail -1 | tr -d %` #News Filesys
>> set $retch # break apart into fields using IFS seperators
>> echo $6 # Percentage diskspace used
>> echo $9 # Percentage inodes used
>> #
>
>You could, of course, use awk instead of the variable thingie. It's a
>bit cleaner.
>
>--> df -v -i . | tail -1 | td -d % | awk '{print $6"\n"$9}'
I tried that and ran into a minor problem. The MRTG Perl scripts
do not like leading spaces in front of each number. I had some
trouble getting rid of these spaces and simply gave up. However,
I like your idea of adding the "\n". Change my last two lines
to:
echo "$6"\n"$9
and it's a bit cleaner. Note that what I was trying to do was
supply a general purpose shell script method of extracting
numbers from common utilities and feeding them to MRTG.
>As for getting data to MRTG, I use small daemons (with TCP wrappers)
>instead of rcmd.
Talking to a port instead of running rcmd is the right way to do
it. However, I run all my data collection inside the firewall
and therefore have no need for packet filters and massive
security. I only export the final graphs and HTML documents to
the outside world. In this case, rcmd is acceptable.
Most sites have only one INN news server so leaving telnet
running as a daemon is not a problem. However, I use MRTG to
collect all manner if statistics and traffic information from
every box that claims to have SNMP support. Using a daemon per
interface would really clutter my process table. Instead, I use
SNMP (snmpget or getone commands), rcmd to a shell script, or in
desperation, ftp or rcp the logfile and process it locally. The
data collection options are many and no one method works for
everything.
(A very nice example of reading INN logs via IP ports deleted.
Thanks much).
I recently posted instructions to the MRTG mailing list on how to
do a general purpose read from a port as well as other examples
of MRTG data extraction. For the benifit of those that want to
learn by destroying:
Plotting sar paging data.
http://www.ee.ethz.ch/~slist/mrtg/msg04538.html
http://www.ee.ethz.ch/~slist/mrtg/msg04553.html
How to setup tcp/ip to read anything from a socket.
http://www.ee.ethz.ch/~slist/mrtg/msg04512.html
Try not to use a port number that is used by something else on
the system. I accidently used the control port for my Milan
print server (2002) and was wondering why data collection was a
bit erratic.
--
Jeff Liebermann 150 Felker St #D Santa Cruz CA 95060
(408)699-0483 pgr (408)426-1240 fax (408)336-2558 home
http://www.cruzio.com/~jeffl WB6SSY
jeffl@comix.santa-cruz.ca.us jeffl@cruzio.com
Technical Details
Message-ID:
<3549d010.31286081@news.ricochet.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<353B9E8F.2842E0E9@poseidon.rider.edu> <87hg3m4zkr.fsf@hastur.rlyeh.net> <3541e250.7034723@news.ricochet.net> <87wwccwbfp.fsf@hastur.rlyeh.net>Show Full Headers
Complete Article Headers
Message-ID: <3549d010.31286081@news.ricochet.net> Subject: Re: INN stats to MRTG Date: Mon, 27 Apr 1998 00:00:00 +0000 From: jeffl@comix.santa-cruz.ca.us (Jeff Liebermann) References: <353B9E8F.2842E0E9@poseidon.rider.edu> <87hg3m4zkr.fsf@hastur.rlyeh.net> <3541e250.7034723@news.ricochet.net> <87wwccwbfp.fsf@hastur.rlyeh.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 347948432 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Reply-To: jeffl@comix.santa-cruz.ca.us Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsabuse@supernews.com X-Trace: 893638877 F7W8ZAFJM82E CCB3C usenet54.supernews.com Organization: Committee To Maintain an Independent Xenix Newsgroups: news.software.nntp