{"id":64,"date":"2019-05-29T04:09:04","date_gmt":"2019-05-29T04:09:04","guid":{"rendered":"http:\/\/edcint.co.nz\/checkwmiplus\/?page_id=64"},"modified":"2022-07-02T08:39:06","modified_gmt":"2022-07-01T22:39:06","slug":"installation","status":"publish","type":"page","link":"https:\/\/edcint.co.nz\/checkwmiplus\/installation\/","title":{"rendered":"Installation"},"content":{"rendered":"<p><strong>NOTE: For the legacy information refer to <a href=\"https:\/\/edcint.co.nz\/checkwmiplus\/installation-legacy\/\">Installation (Legacy)<\/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 <a href=\"https:\/\/github.com\/cesbit\/aiowmi\/tree\/main\/contrib\/wmic_server\">WMIC Server<\/a> which is part of the <a href=\"https:\/\/github.com\/cesbit\/aiowmi\">aiowmi project<\/a>. To install that simply change into the directory where you want it installed and <code>git clone https:\/\/github.com\/cesbit\/aiowmi<\/code>. The github page for <a href=\"https:\/\/github.com\/cesbit\/aiowmi\/tree\/main\/contrib\/wmic_server\">WMIC Server<\/a> contains information on how to install that. In summary, you create a long running API server that accepts WMI queries from Check WMI Plus. WMIC Server forwards the WMI queries to the target Windows host.<\/p>\n<p>Test the WMIC Server following the <a href=\"https:\/\/github.com\/cesbit\/aiowmi\/tree\/main\/contrib\/wmic_server#sample-usage\">sample usage instructions<\/a><\/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.67 and later<\/cite><br \/>\nFedora 36 with Perl 5.34, Nagios 4.4.6 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: For the legacy information refer to Installation (Legacy) This is only some basic information. I&#8217;m going to assume that if you are even looking&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],"tags":[],"class_list":["post-64","page","type-page","status-publish","hentry","category-documentation"],"_links":{"self":[{"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/pages\/64","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=64"}],"version-history":[{"count":17,"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/pages\/64\/revisions"}],"predecessor-version":[{"id":690,"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/pages\/64\/revisions\/690"}],"wp:attachment":[{"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/media?parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/categories?post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/tags?post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}