using check_nt to graph disk/cpu usage

Frank de Groodt sonar at kaos.xs4all.nl
Fri Feb 28 00:06:05 CET 2003


Ok, here we go:

A cpu entry in the MRTG config file:

Target[PDC_CPU]: `/usr/local/bin/checkw2k mv01 cpu`

Our checkw2k script:

#!/bin/sh

case "$2" in
  cpu)
     /usr/local/bin/check_nt -s None -H $1 -p 1021 -v CPULOAD -l 1,80,95 | 
cut -d" " -f5 | cut -d"%" -f1
     /usr/local/bin/check_nt -s None -H $1 -p 1021 -v CPULOAD -l 1,80,95 | 
cut -d" " -f5 | cut -d"%" -f1
    ;;
  mem)
    /usr/local/bin/check_nt -s None -H $1 -p 1021 -v MEMUSE | cut -d" " 
-f7 | cut -d" " -f1 | cut -d"." -f1
    /usr/local/bin/check_nt -s None -H $1 -p 1021 -v MEMUSE | cut -d" " 
-f7 | cut -d" " -f1 | cut -d"." -f1
    ;;
  disk)
    dsk="$(/usr/local/bin/check_nt -s None -H $1 -p 1021 -v USEDDISKSPACE 
-l $3 | cut -d" " -f8 | cut -d" " -f1)"
    echo "$dsk"0 | sed -e s/[.]//g
    echo "$dsk"0 | sed -e s/[.]//g
    ;;
  *)
    echo $"Usage: $0 {<host> cpu|<host> mem|<host> disk <drive 
letter>}"
    exit 1
esac

exit 0

For the mem part you can set the AbsMax to match your RAM in MRTG 
cause check_nt adds swap to the output.
For disk space set AbsMax to match the total disk without the dot and add 0.
Works well for us...

Frank

On Thu, 27 Feb 2003, Carroll, Jim P [Contractor] wrote:

> Interesting approach.
> 
> Could you explain in a little more detail how you did this?
> 
> jc
> 
> 
> > -----Original Message-----
> > From: Frank de Groodt [mailto:sonar at kaos.xs4all.nl]
> > Sent: Wednesday, February 26, 2003 6:07 PM
> > To: Erik Anderson
> > Cc: 'nagios-users at lists.sourceforge.net'
> > Subject: Re: [Nagios-users] using check_nt to graph disk/cpu usage
> > 
> > 
> > We let MRTG run check_nt to graph cpu, memory and disk usage on w2k 
> > servers.
> > 
> > Frank
> >  
> > On Wed, 26 Feb 2003, Erik Anderson wrote:
> > 
> > > I am currently using nsclient and check_nt to monitor 
> > several Windows 2000
> > > Servers.  It works great for "threshold" checking.  I am 
> > wondering if it is
> > > possible to graph the actual disk usage for a particular server.
> > > 
> > > I'm running Nagios 1.0 on debian 3.0r1.
> > > 
> > > Thanks!
> > > -Erik
> > > 
> > > - - -
> > > Erik Anderson
> > > Systems Administrator
> > > Logic Product Development
> > > Web: www.logicpd.com
> > > 
> > > 
> > > -------------------------------------------------------
> > > This SF.net email is sponsored by: Scholarships for Techies!
> > > Can't afford IT training? All 2003 ictp students receive 
> > scholarships.
> > > Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, 
> > and more.
> > > www.ictp.com/training/sourceforge.asp
> > > _______________________________________________
> > > Nagios-users mailing list
> > > Nagios-users at lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/nagios-users
> > > ::: Please include Nagios version, plugin version (-v) and 
> > OS when reporting any issue. 
> > > ::: Messages without supporting info will risk being sent 
> > to /dev/null
> > > 
> > 
> > 
> > 
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Scholarships for Techies!
> > Can't afford IT training? All 2003 ictp students receive scholarships.
> > Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
> > www.ictp.com/training/sourceforge.asp
> > _______________________________________________
> > Nagios-users mailing list
> > Nagios-users at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/nagios-users
> > ::: Please include Nagios version, plugin version (-v) and OS 
> > when reporting any issue. 
> > ::: Messages without supporting info will risk being sent to /dev/null
> > 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null
> 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list