Check ESX Datastores using Python and CIM

Good Afternoon guys, here I created another Python Script. This script will check your DataStores aka VMFS. I built this script so that it can be used with Nagios and or Zenoss. The purpose of this script is so that you can monitor thresholds on a per DataStore/VMFS. You will need to download and install Pywbem in order to use this script. You can get it here
Example below…

        example below...
python check_datastore.py -u "http://esxhost" -a "login passwd" --d "Esxtestvol2" -w 60 -c 73 -m GB
Warning Esxtestvol2 189GB Avail 62% used |avail=189

python check_datastore.py -u "http://esxhost" -a "login passwd" --d "Esxtestvol2" -w 70 -c 85 -m MB
OK Esxtestvol2 194558MB Avail 61% used |avail=194558

python check_datastore.py -u "http://esxhost" -a "login passwd" --d "ISO" -w 10 -c 21 -m KB
Critical ISO 41867542528KB Avail 21% used |avail=41867542528

python check_datastore.py -u "http://esxhost" -a "login passwd" --d "Esxtestvol2" -w 70 -c 85
OK Esxtestvol2 204008849408bytes Avail 61% used |avail=204008849408

-u, --url This is the URL you will use to connect to the ESX server, "http://esxhost"
-a, --auth This is the Login and Passwd you will use, "login passwd"
-d, --dstore This is the DataStore aka VMFS to check, "Esxtestvol2"
-w, --warn This is the warning threshold that you will set, 70
-c, --crit This is the critical threshold that you will set, 85
-m, --metric This is the metric that you will use, "KB", "MB", "GB", The default is Bytes

You can download this script here check_datastore.py

{quickdown:32}


ScreenShot below of the script…

 

This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

2 Responses to Check ESX Datastores using Python and CIM

  1. tlindsay42 says:

    The script link above is broken

Leave a Reply