We are using a check to monitor the temdb file size with check_nt
./check_nt -H $HOSTADDRESS$ -p 12489 -v COUNTER -l "\\SQLServer:Databases(tempdb)\Data File(s) Size (KB)","%f"
but we would like to display the file size in GB instead of KB. With this check we always get a kb file size back. Is there a simple way to still use the check_nt check and display (UOM) in GB? Or is there a document we can use (we already checked ./check_nt --help)
Thanks in advance!
use check_nt with COUNTER convert kb to gb
Re: use check_nt with COUNTER convert kb to gb
Does the counter have an output for GB? I don't think check_nt will perform the math for it as it's just polling that counter for the data.
One way around this, would be to write a wrapper script around it to add some math calculations.
One way around this, would be to write a wrapper script around it to add some math calculations.
Former Nagios Employee
Re: use check_nt with COUNTER convert kb to gb
ok, thnx. I will take a look at it. If i find a solutions / script i will post it.
Re: use check_nt with COUNTER convert kb to gb
As an example, you can use something like this:
Code: Select all
#!/bin/bash
value=`/usr/local/nagios/libexec/check_nt -H 192.168.X.X -p 12489 -s'secret' -v COUNTER -l "\memory\cache faults/sec"`
exitcode=$?
echo $(echo "$value/1024/1024" | bc -l)
exit $exitcode