RES: check_rrd modifications

Marcio Queiroz marcioqueiroz at vicom.com.br
Wed Oct 1 19:43:24 CEST 2003


Hi,

i´m using check_rrd_data.pl (contrib directory) to monitor bandwith usage,
and i make a litle script that gives a warning and critical messages in 70%
or 90% of the bandwith. It work´s for what i need. I call that script
check_rrd. If you could send me your when you have finished the
modificatios.

here is the script :

#/sbin/sh

# usage : check_rrd <RRd index in rrd-files> <warning value> <critical
value> <Ds Number : 0 for in/ 1 for out>"

exitstatus=0

saida=`/usr/local/nagios/libexec/check_rrd_data.pl $1 'return "Traffic over
70%: Warning\n" if ($value > '$2');' 'return  "T
raffic over 90%: Critical\n" if ($value > '$3');' 'printf"Traffic Ok - Value
= %.2fKbytes\n", $value; return 0;' $4`
if [ "$saida" = "Traffic over 70%: Warning" ]; then
   exitstatus=1
else if [ "$saida" = "Traffic over 90%: Critical" ]; then
     exitstatus=2
      else if [ "$saida" = "Traffic Ok - Value = nanKbytes" ]; then
              saida="Unknown"
              exitstatus=3
                 else if [ "$saida" = "Can't open data file for $1" ]; then 
                   exitstatus=3
                      fi
           fi
     fi
fi
echo $saida
exit $exitstatus


bye,

	Marcio Q.  Dall Agnol
	phone : 55-21-3873-5826
	Fax      : 55-21-3873-5845
	marcioqueiroz at vicom.com.br
	VICOM
	Net Serviços de Comunicação S/A
	Visite nossas páginas:
	Redes Corporativas: <http://www.vicom.com.br>
	Internet Banda Larga: <http://www.virtua.com.br>
	TV por Assinatura : <http://www.net.tv.br>
	Institucional: http://www.netservicos.com



> ----- Mensagem original -----
> De:		Cook, Garry [SMTP:GWCOOK at mactec.com]
> Enviada em:		quarta-feira, 1 de outubro de 2003 12:53
> Para:		nagios-users at lists.sourceforge.net
> Assunto:		[Nagios-users] check_rrd modifications
> 
> Is anyone using check_rrd to monitor/alarm on bandwidth thresholds? I
> started working with it yesterday and have since made a few
> modifications, as it didn't seem to do what I needed.
> 
> I have one remaining problem that I am trying to work out, perhaps
> someone can assist...
> 
> The output of check_rrd run from the command line appears like so:
> OK - Current BW In: 1132077 bps
> However, when run from within Nagios the output appears this way:
> OK - Current BW In: bps
> 
> As you can see, the actual data is not passed to the cgi or something.
> This seems odd, because both the 'In' and '1132077' are variables within
> the script, so the first one is displayed and the second is not.
> 
> Any ideas?
> 
> Also, let me know if anyone is interested in the modified script and
> I'll be glad to post it once I get this last bit figured out.
> 
> Garry W. Cook, CCNA
> Network Infrastructure Manager
> MACTEC, Inc. - http://www.mactec.com/
> 303.308.6228 (Office) - 720.220.1862 (Mobile) 
> 
> 
> -------------------------------------------------------
> 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