Getting performance data from a windows host

Tom DE BLENDE tdeblend at gcc.dhl.com
Thu Jan 16 08:53:55 CET 2003


Dear Ian,

I used to log performance data in a tab delimited file for further
analysis. Now I just use MRTG to graph real time CPU data, and that is
really helpful. I know there are sexier things around like Cricket,
based on rrdtool, but MRTG does the job just fine here.

This is what I used for MRTG:

<code>

#!/bin/sh
hostname=$1
uptime=`/usr/local/netsaint/libexec/check_nt -H $1 -p 1248 -v UPTIME |
cut -d: -f2`
stat=`/usr/local/netsaint/libexec/check_nt -H $1 -p 1248 -v CPULOAD -l
5,80,95,60,80,95,1440,80,95 | cut -d\% -f1 | awk '{print $5}'
`
echo $stat
echo $stat
echo $uptime
echo $hostname

</code>

And this is what I used for logging the stuff in a file:

<code>

#!/bin/sh
[ ! -f /usr/local/netsaint/logging/logs.txt ] && echo -n '"Date"
"Time" ' >> /usr/local/netsaint/logging/logs.txt && sed
's/^/"/;s/$/"/' < /usr/local/netsaint/logging/servers| tr "\n" " " >>
/usr/local/netsaint/logging/logs.txt && echo >>
/usr/local/netsaint/logging/logs.txt
echo '"'`date '+%m/%e/%Y'`'" ''"'`date '+%T'`'" '`for server in \`cat
/usr/local/netsaint/logging/servers\`; do
/usr/local/netsaint/libexec/check_nt -H $server -p 1248 -v CPULOAD -l
10,80,95,60,80,95,1440,80,95 | cut -d\% -f1 | awk '{print "\"" $5
"\""}'; done` >> /usr/local/netsaint/logging/logs.txt

</code>

Looking at that last 'script' makes my stomach turn. It was written
long ago, and is not used anymore, but should do the job. It requires
a file with a list of all servers you want to have stats for.

Shouldn't be too hard to do the same with Perl.

Kind regards,
Tom


Ian Stokes-Rees wrote:
> 
> I have NSClient running on my windows hosts, and I would like to get
> performance data from them.  What is the best way to do this?  I am
> currently thinking that I should just put a wrapper around check_nt, parse
> the output with perl, and then re-form the output line to contain the
> performance metrics in a "clean" form for logging.
> 
> Ian.
> 
> --
> Ian Stokes-Rees                     i.stokes-rees at physics.ox.ac.uk
> Particle Physics, Oxford            http://www-pnp.physics.ox.ac.uk/~stokes/
> 
> -------------------------------------------------------
> This SF.NET email is sponsored by: A Thawte Code Signing Certificate
> is essential in establishing user confidence by providing assurance of
> authenticity and code integrity. Download our Free Code Signing guide:
> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0028en
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users


-------------------------------------------------------
This SF.NET email is sponsored by: A Thawte Code Signing Certificate 
is essential in establishing user confidence by providing assurance of 
authenticity and code integrity. Download our Free Code Signing guide:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0028en




More information about the Users mailing list