Script Output Issue - Check_NT calcs

Lorand S. D'Caltan ldcaltan at isystemsllc.com
Fri Dec 28 21:55:28 CET 2007


Ok, this is a much more specific version of an earlier question.

echo $RESULT | awk '{printf $1/8/1000000}' 
output = 247.302 

echo $RESULT | awk '{printf "%.f" '"$1/8/1000000"'}' 
output = 0

I suspect this is why Nagios is returning a 0 in the results when it 
runs this script:

#############

#!/bin/bash

RESULT=`./check_nt -H adr01 -p 1248 -v COUNTER -l 
"\Process(EvDRServer)\Virtual Bytes","%.0f" -w 1500 -c 2000`

CALCULATED=`echo $RESULT | awk '{print $1/8/1000000}'`

echo $CALCULATED
exit 0

#############

What I don't know is why it's doing this. Is there some way I can force 
Nagios to simply take the plain output of the script instead of trying 
to apply a printf function to it?

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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