{"id":870,"date":"2011-12-09T09:29:26","date_gmt":"2011-12-09T14:29:26","guid":{"rendered":"http:\/\/it.thelibrarie.com\/weblog\/?p=870"},"modified":"2011-12-09T10:56:14","modified_gmt":"2011-12-09T15:56:14","slug":"esxi-monitoring-via-nagios","status":"publish","type":"post","link":"https:\/\/it.thelibrarie.com\/weblog\/2011\/12\/esxi-monitoring-via-nagios\/","title":{"rendered":"ESXi Monitoring via Nagios"},"content":{"rendered":"<p>My current infrastructure budget does not allow for vSphere Server, ESXi 4.1 Enterprise, or OpsView Enterprise.  They all have one thing in common: they&#8217;re more than $0.  OK, I know OpsView comes in a community flavor, but still.  ESXi hypervisor 4.1 is also free.<\/p>\n<p>So originally I was going to just run SNMP monitoring through Nagios, but I found out that I needed to enable ESXi&#8217;s SNMP before I could attempt that.  Long story short, ESXi&#8217;s SNMP is not worth monitoring.  CIM, the supported protocol from VMWare, apparently is the route I needed to go.<\/p>\n<p>So I found this site:<br \/>\nhttp:\/\/www.matthewjwhite.co.uk\/blog\/2010\/02\/09\/monitoring-esxi-server-health-using-nagiosopsview\/<br \/>\nWhich gave me the direction I needed.<\/p>\n<p>Log onto your Nagios Server:<br \/>\n<code>apt-get install python-pywbem<\/code><br \/>\n<code>cd \/usr\/local\/nagios\/libexec<\/code><br \/>\n<code><del datetime=\"2011-12-09T14:21:08+00:00\">wget http:\/\/communities.vmware.com\/servlet\/JiveServlet\/downloadBody\/7170-102-7-4233\/check_esx_wbem.py<\/del><\/code><br \/>\n<code>wget http:\/\/it.thelibrarie.com\/utilities\/check_esxi_hardware.py<\/code><br \/>\n<code>chmod +x check_esxi_hardware.py<\/code><\/p>\n<p>Check by running the following:<br \/>\n<code>.\/check_esxi_hardware.py IPOFYOURESXISERVER root password VENDOR<\/code><br \/>\nYou should receive a simple &#8220;OK&#8221; to verify everything is working<\/p>\n<blockquote><p>define command{<br \/>\n        command_name    check_esxi_hardware<br \/>\n        command_line    $USER1$\/check_esxi_hardware.py -H $HOSTADDRESS -U $ARG1$ -P $ARG2$ -V $ARG3$<br \/>\n        }<\/p><\/blockquote>\n<p>And the check as defined for one of my ESXi servers<\/p>\n<blockquote><p>define service{<br \/>\n        use                     generic-service<br \/>\n        host_name               esx01<br \/>\n        service_description     ESXi Hardware Monitor<br \/>\n        check_command           check_esxi_hardware!readonlyuser!somepassword!dell<br \/>\n        }<\/p><\/blockquote>\n<p>Verify it&#8217;s working after the check, you should have the green bar saying OK.<\/p>\n<p>I had to edit a little bit as the previous script did not function through nagios although it did work via the command line.  Nagios merely reported everything as OK even though I had errors reported on the CLI.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My current infrastructure budget does not allow for vSphere Server, ESXi 4.1 Enterprise, or OpsView Enterprise. They all have one thing in common: they&#8217;re more than $0. OK, I know OpsView comes in a community flavor, but still. ESXi hypervisor 4.1 is also free. So originally I was going to just run SNMP monitoring through &hellip; <a href=\"https:\/\/it.thelibrarie.com\/weblog\/2011\/12\/esxi-monitoring-via-nagios\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">ESXi Monitoring via Nagios<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-870","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/870","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/comments?post=870"}],"version-history":[{"count":3,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/870\/revisions"}],"predecessor-version":[{"id":872,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/870\/revisions\/872"}],"wp:attachment":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/media?parent=870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/categories?post=870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/tags?post=870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}