Using check_vmware_api

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
MikeM-2468
Posts: 17
Joined: Wed May 18, 2011 2:58 pm

Using check_vmware_api

Post 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?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Using check_vmware_api

Post by tmcdonald »

Before we do that, can you show us the command line string you are running?
Former Nagios employee
MikeM-2468
Posts: 17
Joined: Wed May 18, 2011 2:58 pm

Re: Using check_vmware_api

Post by MikeM-2468 »

./check_vmware_api -D vcenter -l MEM -u user -p password
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Using check_vmware_api

Post 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?
MikeM-2468
Posts: 17
Joined: Wed May 18, 2011 2:58 pm

Re: Using check_vmware_api

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Using check_vmware_api

Post 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.
Former Nagios employee
MikeM-2468
Posts: 17
Joined: Wed May 18, 2011 2:58 pm

Re: Using check_vmware_api

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Using check_vmware_api

Post 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.
Former Nagios employee
MikeM-2468
Posts: 17
Joined: Wed May 18, 2011 2:58 pm

Re: Using check_vmware_api

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Using check_vmware_api

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked