check_esx_host_vmfs plugin issue while monitoring ESXi DS

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.
Locked
sunnysthakur
Posts: 6
Joined: Tue Feb 26, 2013 8:26 am

check_esx_host_vmfs plugin issue while monitoring ESXi DS

Post by sunnysthakur »

Hello,

I setup a check_esx_host_vmfs plugin for monitoring datastore status on ESXi server. But on configuring this plugin, this is working fine but it displays "WARNING" status on UI of Nagios every time.
Currently my datastore size is 926.50 GB and right now free space available is 570.60 GB but still it showing warning on UI.

In command.cfg i mentioned the below one for this plugin.

Code: Select all

define command{
        command_name check_esx_host_vmfs
        command_line $USER1$/check_esx3 -H $HOSTADDRESS$ -u $USER11$ -p $USER12$ -l vmfs -w $ARG2$ -c $ARG3$
}
In my services.cfg file i defined the below lines to check the status of datastore using the above mentioned command.

Code: Select all

# check for datasource usage
define service{
        use                            generic-service
        action_url                     /nagiosgraph/cgi-bin/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$' onMouseOver='showGraphPopup(this)' onMouseOut='hi                                       deGraphPopup()' rel='/nagiosgraph/cgi-bin/showgraph.cgi?host=$HOSTNAME$&service=$SERVICEDESC$
        host_name                      ESXiserver
        service_description            ESXi Datasource Usage
        is_volatile                    0
        check_period                   24x7
        max_check_attempts             3
        normal_check_interval          3
        retry_check_interval           1
        contact_groups                 vmwareadmins
        notification_interval          120
        notification_period            24x7
        notification_options           u,c,r
        check_command                  check_esx_host_vmfs!90!98
      } 
Warning message is 90% and Critical is 98%, but right now its 61% but shows a warning on Nagios UI.

Is i am define something wrong here to setup this plugin or this is a bug in this.
Attachments
esxi_datastore.PNG
esxi_datastore.PNG (2.55 KiB) Viewed 2809 times
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_esx_host_vmfs plugin issue while monitoring ESXi D

Post by abrist »

Try changing the check args to $ARG1$ and $ARG2$ instead of $ARG2$ and $ARG3$:

Code: Select all

define command{
        command_name check_esx_host_vmfs
        command_line $USER1$/check_esx3 -H $HOSTADDRESS$ -u $USER11$ -p $USER12$ -l vmfs -w $ARG1$ -c $ARG2$
}
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.
sunnysthakur
Posts: 6
Joined: Tue Feb 26, 2013 8:26 am

Re: check_esx_host_vmfs plugin issue while monitoring ESXi D

Post by sunnysthakur »

After changing to $ARG1$ and $ARG2$ WARNING message converts to CRITICAL now.

however i set the warning limit after 90% and critical limit after 95%. Currently datastore is consuming 61% space.

Code: Select all

define service{
        use                            generic-service
        action_url                     /nagiosgraph/cgi-bin/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$' onMouseOver='showGraphPopup(this)' onMouseOut='hi                                       deGraphPopup()' rel='/nagiosgraph/cgi-bin/showgraph.cgi?host=$HOSTNAME$&service=$SERVICEDESC$
        host_name                      Esxihost
        service_description            ESXi Datasource Usage
        is_volatile                    0
        check_period                   24x7
        max_check_attempts             3
        normal_check_interval          3
        retry_check_interval           1
        contact_groups                 vmwareadmins
        notification_interval          120
        notification_period            24x7
        notification_options           u,c,r
        [b]check_command                  check_esx_host_vmfs!90!95[/b]
Below is the command which i changed to $ARG1$ and $ARG2$

Code: Select all

define command{
        command_name check_esx_host_vmfs
        command_line $USER1$/check_esx3 -H $HOSTADDRESS$ -u $USER11$ -p $USER12$ -l vmfs -w $ARG1$ -c $ARG2$
}
I also checked this command by executing on bash and it shows CRITICAL.

Code: Select all

[root@monitor nagios]# /usr/lib64/nagios/plugins/check_esx3 -H 104.10.50.218 -u admin -p password1234 -l vmfs -w 90 -c 95
CHECK_ESX3 CRITICAL - Storages : datastore1=584293.00 MB (61.59%) | datastore1=584293.00MB;90;95
Am i missing somewhere to define warning and critical limits as i have total 1 TB drive and after and currently 61% is filled but still it show critical.
sunnysthakur
Posts: 6
Joined: Tue Feb 26, 2013 8:26 am

Re: check_esx_host_vmfs plugin issue while monitoring ESXi D

Post by sunnysthakur »

Hello,

After googling for this issue and found that the check_esx3 script is throwing WARNING and CRITICAL status if we use %age for datastore [w 90% and c 95%].
This works fine if we set triggers in MBs [Total size/trigger%] [ -w 853862 -c 901299]

Code: Select all

/usr/lib64/nagios/plugins/check_esx3 -H 104.10.50.218 -u admin -p password1234 -l vmfs -o used -w 853862 -c 901299
CHECK_ESX3 OK - Storages : datastore1=364443 MB (38.41%) | datastore1=364443MB;853862;901299

Code: Select all

# /usr/lib64/nagios/plugins/check_esx3 -H 10.0.0.218 -l vmfs -u supadmin -p Bebo1234 -l vmfs -o used
CHECK_ESX3 OK - Storages : datastore1=364443 MB (38.41%) | datastore1=364443MB;;
To set the trigger we have to define the -w and -c as per the disk capacity on each esx hosts.

Detail is given on this link
http://exchange.nagios.org/directory/Pl ... st/details

Better to fix this script to use %age instead of MBs
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_esx_host_vmfs plugin issue while monitoring ESXi D

Post by abrist »

Have you tried inverting the percentage, instead of "used" space, it may be "free" space. The fact that you started getting criticals after making the previous change leads me to think this might be the case. Try 10% and 5% for the thresholds, otherwise, you will have to use MB as uom.
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.
sunnysthakur
Posts: 6
Joined: Tue Feb 26, 2013 8:26 am

Re: check_esx_host_vmfs plugin issue while monitoring ESXi D

Post by sunnysthakur »

Hi abrist.

I tried with %age but it always shows WARNING message on Nagios System or by command prompt.
I used lesser 10% and higher 90% but message is same.

Getting hint on google to use MB instead of %age as this plugin works well with MB only.

Now this is working fine.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_esx_host_vmfs plugin issue while monitoring ESXi D

Post by slansing »

Great thanks for letting us know, I am going to look further into this one.
Locked