Page 1 of 2

Using check_vmware_api

Posted: Fri Mar 21, 2014 11:56 am
by MikeM-2468
I've been able to get the plugin installed and working at the command line for the most part. But I can't seem to get it to recognize warn and crit conditions. Does anyone have a sample command line that works for this?

Re: Using check_vmware_api

Posted: Fri Mar 21, 2014 2:06 pm
by tmcdonald
Before we do that, can you show us the command line string you are running?

Re: Using check_vmware_api

Posted: Fri Mar 21, 2014 2:11 pm
by MikeM-2468
./check_vmware_api -D vcenter -l MEM -u user -p password

Re: Using check_vmware_api

Posted: Fri Mar 21, 2014 2:25 pm
by slansing
So it does not look like you are actually defining warning or critical thresholds, what is that command currently returning to you? The plugin usage is denoted here:

http://exchange.nagios.org/directory/Pl ... pi/details

Where '-w' = warning and '-c' = critical, have you tried adding those and based off the return from running the plugin adjusted them as to cause an actual critical or warning return?

Re: Using check_vmware_api

Posted: Fri Mar 21, 2014 2:28 pm
by MikeM-2468
Sorry. I included only the base portion of the command that was working. I've attempted to add -w and -c with no change no matter what I set them to.

./check_vmware_api -D vcenter -l MEM -u user -p password -w 50 -c 100
and
./check_vmware_api -D vcenter -l MEM -u user -p password -w 500000 -c 1000000

provide the same result - CHECK_VMWARE_API OK

Re: Using check_vmware_api

Posted: Mon Mar 24, 2014 10:06 am
by tmcdonald
That plugin might be looking for bytes and not MB or GB. In your example "1000000" bytes is only ~976 KB. You might want to try multiples of 1048576 which is 1MB.

Can you show us the full output? There might be some perfdata in there that can confirm/deny this theory. Try running it with "-vvv" as an argument.

Re: Using check_vmware_api

Posted: Mon Mar 24, 2014 10:16 am
by MikeM-2468
Here are four examples with output:

./check_vmware_api -D vcenter -l MEM -u user -p password -w 1 -c 2
CHECK_VMWARE_API OK - mem usage=134764.05 MB (71.64%), overhead=15748.00 MB, swapped=1311.48 MB, memctl=1234.24 MB | mem_usagemb=134764.05MB;1;2 mem_usage=71.64%;1;2 mem_overhead=15748.00MB;1;2 mem_swap=1311.48MB;1;2 mem_memctl=1234.24MB;1;2

./check_vmware_api -D vcenter -l MEM -u user -p password -w 100 -c 200
CHECK_VMWARE_API OK - mem usage=134757.33 MB (71.64%), overhead=15746.79 MB, swapped=1311.48 MB, memctl=1234.24 MB | mem_usagemb=134757.33MB;100;200 mem_usage=71.64%;100;200 mem_overhead=15746.79MB;100;200 mem_swap=1311.48MB;100;200 mem_memctl=1234.24MB;100;200

./check_vmware_api -D vcenter -l MEM -u user -p password -w 1000 -c 2000
CHECK_VMWARE_API OK - mem usage=134765.11 MB (71.64%), overhead=15752.27 MB, swapped=1311.48 MB, memctl=1234.24 MB | mem_usagemb=134765.11MB;1000;2000 mem_usage=71.64%;1000;2000 mem_overhead=15752.27MB;1000;2000 mem_swap=1311.48MB;1000;2000 mem_memctl=1234.24MB;1000;2000

./check_vmware_api -D vcenter -l MEM -u user -p password -w 1000000000 -c 2000000000
CHECK_VMWARE_API OK - mem usage=134765.11 MB (71.64%), overhead=15752.27 MB, swapped=1311.48 MB, memctl=1234.24 MB | mem_usagemb=134765.11MB;1000000000;2000000000 mem_usage=71.64%;1000000000;2000000000 mem_overhead=15752.27MB;1000000000;2000000000 mem_swap=1311.48MB;1000000000;2000000000 mem_memctl=1234.24MB;1000000000;2000000000

Re: Using check_vmware_api

Posted: Mon Mar 24, 2014 10:42 am
by tmcdonald
I think you're on the right track. Take a look at the following URL:

http://www.matisse.net/bitcalc/?input_a ... ion=legacy

1000000000 bytes is a little under 1 GB. 1073741824 bytes is a full gigabyte. You can use this calculator to determine the values you need for -w and -c. They will likely be *very* big numbers.

Re: Using check_vmware_api

Posted: Mon Mar 24, 2014 10:47 am
by MikeM-2468
I'll look at that, but we're looking to alert for levels above the warn and crit, right? Wouldn't it trigger on:
./check_vmware_api -D vcenter -l MEM -u user -p password -w 1 -c 2

I shouldn't be looking to exceed the numbers. I should alert if the reading exceeds my stated levels.

Re: Using check_vmware_api

Posted: Mon Mar 24, 2014 4:12 pm
by abrist
You need to specify a sub command in order to use thresholds:
* mem - shows mem info
+ usage - mem usage in percentage
+ usagemb - mem usage in MB
+ swap - swap mem usage in MB
o listvm - turn on/off output list of swapping VM's
+ memctl - mem used by VM memory control driver(vmmemctl) that controls ballooning
o listvm - turn on/off output list of ballooning VM's
^ all mem info(plus overhead and no thresholds)
Try:

Code: Select all

./check_vmware_api -D vcenter -l MEM -s usage -u user -p password -w 1 -c 2