use check_nt with COUNTER convert kb to gb

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
dicenl
Posts: 15
Joined: Fri Mar 18, 2016 7:13 am

use check_nt with COUNTER convert kb to gb

Post by dicenl »

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!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: use check_nt with COUNTER convert kb to gb

Post by rkennedy »

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.
Former Nagios Employee
dicenl
Posts: 15
Joined: Fri Mar 18, 2016 7:13 am

Re: use check_nt with COUNTER convert kb to gb

Post by dicenl »

ok, thnx. I will take a look at it. If i find a solutions / script i will post it.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: use check_nt with COUNTER convert kb to gb

Post by ssax »

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
Locked