{"id":679,"date":"2022-07-02T08:20:09","date_gmt":"2022-07-01T22:20:09","guid":{"rendered":"https:\/\/edcint.co.nz\/checkwmiplus\/?page_id=679"},"modified":"2022-07-02T08:40:20","modified_gmt":"2022-07-01T22:40:20","slug":"installation-legacy","status":"publish","type":"page","link":"https:\/\/edcint.co.nz\/checkwmiplus\/installation-legacy\/","title":{"rendered":"Installation (Legacy)"},"content":{"rendered":"<p><strong>NOTE: This is the legacy page which refers to the legacy wmic command line binary. For information using the new wmic_server, refer to <a href=\"https:\/\/edcint.co.nz\/checkwmiplus\/installation\/\">Installation<\/a><\/strong><\/p>\n<p>This is only some basic information. I&#8217;m going to assume that if you are even looking at adding plugins to Nagios that you have some idea of what you are doing.<\/p>\n<p><strong>Prerequisites<\/strong><\/p>\n<p>Check WMI Plus requires the WMI client, wmic from Zenoss.<br \/>\nThe information on how to get wmic up and running was originally available on <a href=\"http:\/\/www.thibault.info\/node\/2\">Matthieu Thibault&#8217;s<\/a> site but that appears to have now disappeared. There is a comprehensive installation example <a href=\"http:\/\/edcint.co.nz\/checkwmiplus\/installation-terminal-session\/\">here<\/a>.<\/p>\n<p>We actually found an RPM containing wmic on <a href=\"http:\/\/rpm.pbone.net\">rpm.pbone.net<\/a> (search for wmic). It worked but I did choose to\u00a0<a href=\"http:\/\/dev.zenoss.org\/svn\/trunk\/inst\/externallibs\/wmi-1.3.13.tar.bz2\">download the source from Zenoss<\/a> and compile my own as it end up being smaller.<br \/>\n<em>Update: Seems the source is missing from the zenoss.org site, maybe they have moved it somewhere else. There is a copy of it <a href=\"http:\/\/edcint.co.nz\/checkwmiplus\/download\/zenoss-wmi-source-v1-3-14\/\">here<\/a>.<\/em><\/p>\n<p><span style=\"color: #ff0000;\">Update 2021: You will most likely want <a style=\"color: #ff0000;\" href=\"https:\/\/edcint.co.nz\/checkwmiplus\/fix-for-windows-10-v2004\/\">this version<\/a> of the wmic source since this one works with Windows 10 v2004 and above.<\/span><\/p>\n<p>You will need the following Perl modules. Development uses the versions shown. If you use any other version you may experience errors. <a href=\"http:\/\/edcint.co.nz\/checkwmiplus\/about\/support\/\">Let us know<\/a> about errors that might be version related as it may be possible to code the plugin around them. You will need to be prepared to help test any fixes.<\/p>\n<p>Installation of the perl modules might depend on your Linux distribution. For Fedora, they are all installed with Perl itself or available as packages (<code>perl-Config-IniFiles<\/code>, <code>perl-DateTime<\/code>, <code>perl-Scalar-List-Utils<\/code> and <code>perl-Number-Format<\/code><code><\/code>, <code>perl-JSON<\/code>). The other way to install perl modules is to use the cpan command eg <code>cpan install Config::IniFiles<\/code><\/p>\n<p>You can find your own module versions by running<\/p>\n<p><code>check_wmi_plus.pl -d -d | head -n 25<\/code><\/p>\n<p><code>--------------------- Module Versions ---------------------<br \/>\nMODULE_NAME INSTALLED_VERSION STATUS DESIRED_VERSION<br \/>\nHTTP::Request::Common ok 0<br \/>\nJSON ok 0<br \/>\nScalar::Util 1.62 ok 1.22<br \/>\nGetopt::Long 2.52 ok 2.38<br \/>\nPerl Version 5.034001 ok 5.01<br \/>\nConfig::IniFiles 3.000003 ok 2.58<br \/>\nStorable 3.25 ok 2.22<br \/>\nLWP::UserAgent ok 0<br \/>\nNumber::Format 1.75 ok 1.73<br \/>\nDateTime 1.57 ok 0.66<br \/>\nData::Dumper 2.183 ok 2.125<br \/>\n<\/code><\/p>\n<p>If you want to use the ini file you will need the <code>Config::IniFiles<\/code> Perl module.<br \/>\nThere are other Perl Modules used, but these are very often installed along with Perl:<br \/>\n<code>Getopt::Long<\/code> (to read the command line parameters)<br \/>\n<code>Data::Dumper<\/code> (for debug mode)<br \/>\n<code>DateTime<\/code> (for checks where we need to know time eg checkfileage, checkeventlog)<br \/>\n<code>Scalar::Util<\/code> (for testing if valid data is returned from WMI query)<br \/>\n<code>Storable<\/code> (for keeping state)<br \/>\n<code>Number::Format<\/code> (for formatting numbers)<\/p>\n<p><strong>Plugin Configuration<\/strong><\/p>\n<p>We run the plugin from a specific directory and we have Nagios installed in certain directories. The plugin wants to know what these directories are. So if yours don&#8217;t match the defaults, you will need to change them.<\/p>\n<p><cite>Version 1.60 and later<\/cite><br \/>\nUntar the download bundle to a temporary directory before moving the files to their final locations.<br \/>\nThe download bundle contains all the executable files at the top level of the bundle. You will want to copy these files to a folder such as \/usr\/local\/bin.<br \/>\nAn etc folder is also contained in the bundle. This etc folder should be copied to \/etc as this is now the default location for the config file and ini files.<br \/>\nRename check_wmi_plus.conf.sample to check_wmi_plus.conf<br \/>\nEdit check_wmi_plus.conf and set all the directory locations. Hopefully, you will only need to do this the very first time you install Check WMI Plus<br \/>\nMake sure the config files are all readable and writable by the Nagios user)<br \/>\nRemove the temporary folder<br \/>\nThere is a chance that you might need to edit the plugin itself as it relies on being able to find utils.pm from your nagios installation.<br \/>\nIf you get errors complaining about utils.pm or %ERROR then you may need to change the lines:<br \/>\n<code>use lib \"\/usr\/lib\/nagios\/plugins\";<br \/>\nuse lib \"\/usr\/lib64\/nagios\/plugins\";<\/code><\/p>\n<p><strong>Testing<\/strong><\/p>\n<p>The plugin has been tested with the following other software versions:<\/p>\n<p><cite>Version 1.49 and earlier<\/cite><br \/>\nFedora 14 with Perl 5.12, Nagios 3.2.3 and pnp4nagios v0.4.14.<\/p>\n<p><cite>Version 1.50 and later<\/cite><br \/>\nFedora 16 with Perl 5.14, Nagios 3.3.1 and pnp4nagios v0.4.14.<\/p>\n<p><cite>Version 1.60 and later<\/cite><br \/>\nFedora 22 with Perl 5.20, Nagios 3.5.1 and pnp4nagios v0.6.22.<\/p>\n<p><cite>Version 1.61 and later<\/cite><br \/>\nFedora 24 with Perl 5.22, Nagios 4.0.8 and pnp4nagios v0.6.25.<\/p>\n<p><cite>Version 1.64 and later<\/cite><br \/>\nFedora 28 with Perl 5.26, Nagios 4.3.4 and pnp4nagios v0.6.25.<\/p>\n<p>Tested with the following Windows versions:<br \/>\nWindows XP SP3 (32 bit)<br \/>\nWindows 7 (32 bit) (not tested very often)<br \/>\nWindows 10 Pro 64 bit<br \/>\nWindows Server 2003 R2 64 bit (Thanks to Grant Davies for the license)<br \/>\nWindows Server 2008 R2 64 bit<br \/>\nWindows Server 2012 (some testing performed &#8211; anyone want to give us a license so more testing can be done?)<\/p>\n<p>Also, reported to largely work with Windows 2000.<\/p>\n<p>We have done a lot of testing, but we bet we have not found everything that can go wrong. <a href=\"http:\/\/edcint.co.nz\/checkwmiplus\/about\/support\/\">Let us know<\/a> if you find something that needs fixing.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NOTE: This is the legacy page which refers to the legacy wmic command line binary. For information using the new wmic_server, refer to Installation This&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[15,21],"tags":[],"class_list":["post-679","page","type-page","status-publish","hentry","category-documentation","category-legacy"],"_links":{"self":[{"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/pages\/679","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/comments?post=679"}],"version-history":[{"count":3,"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/pages\/679\/revisions"}],"predecessor-version":[{"id":685,"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/pages\/679\/revisions\/685"}],"wp:attachment":[{"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/media?parent=679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/categories?post=679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/tags?post=679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}