{"id":124,"date":"2019-05-29T05:16:26","date_gmt":"2019-05-29T05:16:26","guid":{"rendered":"http:\/\/edcint.co.nz\/checkwmiplus\/?p=124"},"modified":"2022-06-24T19:13:28","modified_gmt":"2022-06-24T09:13:28","slug":"check-wmi-plus-pro-to-improve-performance-and-functionality","status":"publish","type":"post","link":"https:\/\/edcint.co.nz\/checkwmiplus\/check-wmi-plus-pro-to-improve-performance-and-functionality\/","title":{"rendered":"Check WMI Plus Pro to improve performance and functionality"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69df452adef6a\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69df452adef6a\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/edcint.co.nz\/checkwmiplus\/check-wmi-plus-pro-to-improve-performance-and-functionality\/#Pro_Features\" >Pro Features<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/edcint.co.nz\/checkwmiplus\/check-wmi-plus-pro-to-improve-performance-and-functionality\/#Going_Pro\" >Going Pro<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/edcint.co.nz\/checkwmiplus\/check-wmi-plus-pro-to-improve-performance-and-functionality\/#Sample_Usage_Stats\" >Sample Usage Stats<\/a><\/li><\/ul><\/nav><\/div>\n\r\n<p>Check WMI Plus Pro improves performance in a couple of different ways (first 2 items in the feature list) as well as some functional improvements:<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Pro_Features\"><\/span>Pro Features<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Ini performance improvements. This change sees a massive improvement in the performance when using ini file based checks. On our test machine the plugin uses around 320-380ms of CPU time per plugin invocation. With the Pro version installed, the same checks use 45-56ms of CPU time. That&#8217;s a massive improvement that will make a major difference to the CPU utilisation of your Nagios server depending on how many ini based checks you are using.<\/li>\r\n<li>Helper and Join query caching. By default and helper and join queries are cached, this can significantly reduce the number of WMI queries performed, hence making the plugin faster. Typically, helper and join data is relatively static and may only ever need to be queried infrequently. The &#8211;helperexpiry and &#8211;joinexpiry options allow you to change the default cache time.<\/li>\r\n<li>Ability to use Helper Queries in ini-based checks. Helper queries allow you to defined checks which use WMI data (other than the primary) query and make it available to be used in calculations. Some examples of helper queries might be ones that obtain the total number of cores available, the total number of user logged in, the total number of drives in the Windows machine. This data can then be used in calculations that require it. The ini check [checkproc cpubycore] shows a full example on how to obtain and use helper query data.<\/li>\r\n<li>Ability to check disk quotas using the checkquota mode. This allows you to check for users that have exceeded or are about to exceed quotas for any combination of drives. Specify which drives\/users to evaluate using &#8211;includedata\/&#8211;excludedata.<\/li>\r\n<li>Ability to check file shares using the checkshare mode. This allows you to check for changes to shares or if any shares are added\/deleted eg any share added to C:. Specify which shares to evaluate using &#8211;includedata\/&#8211;excludedata.<\/li>\r\n<li>Ability to check users defined in groups. Alert on changes to users in groups. Specify which groups\/users to evaluate using &#8211;includedata\/&#8211;excludedata.<\/li>\r\n<li>Ability to check logons ie currently logged in users using checklogon. Alert on changes to logons and\/or various logon attributes eg Interactive logons. Specify which logons to evaluate using &#8211;includedata\/&#8211;excludedata.<\/li>\r\n<li>Ability to check startup commands using the checkstartupcommand mode. This allows you to check for changes to start up command or if any commands are added\/deleted or other settings eg Users. Specify which startup commands to evaluate using &#8211;includedata\/&#8211;excludedata.<\/li>\r\n<li>Ability to check print queues using checkprintjob mode. Alert if the job queue does not change between invocations. Alert if the job queue goes above a specific number of jobs and other settings. Specify which print jobs to evaluate using &#8211;includedata\/&#8211;excludedata.<\/li>\r\n<li>Ability to check user accounts using checkuseraccount. Alert on changes to the accounts, if an account becomes locked out, disabled, pass does not expire etc. Specify which accounts to evaluate using &#8211;includedata\/&#8211;excludedata.<\/li>\r\n<li>Ability to check groups using checkgroup. Alert on changes to groups and\/or various group attributes. Specify which groups to evaluate using &#8211;includedata\/&#8211;excludedata.<\/li>\r\n<li>Ability to check printer status (as reported by Windows)<\/li>\r\n<li>Collect usage stats for later analysis. Over a 10 day period, these <a href=\"http:\/\/edcint.co.nz\/checkwmiplus\/nagios-configuration\/nagios-service-definitions\/\">sample services<\/a> with a 5 minute normal check interval performed around 96,000 checks. The usage stats file was 16.7MB in size.<\/li>\r\n<li>Specify warning and critical criteria as regular expressions. This extends to &#8211;includedata and &#8211;excludedata since they use the same format as warning and critical specifications. This can be useful for testing for strings, multiple discreet values (eg testing for 1007 or 1012 or 1015 but not the values in between) and various other things eg if values such as True or False are returned by a WMI field.<\/li>\r\n<li>Use variable substitutions. This allows translation of strings to other strings for some command line operations and display purposes. For example, for checkeventlog this can translate eventcodes eg 7036 to more meaningful words. Also used to translate timezone numbers eg +600 to timezone words eg AEST. Also for checkeventlog, allows you to specify record types by name not number eg use -o Info instead of -o 3. Can be used to allow use of words (instead of numbers) in critical and warning specifications eg -c SYSTEMDOWN instead of -c 4583. Some samples included.<\/li>\r\n<li>Ability to modify the normal exit code of the plugin based on a specification.<\/li>\r\n<li>Ability to use &#8211;includedata and &#8211;excludedata on specific internal checks (versus just ini file checks). This will be especially useful for modes like checkdrivesize where you can specify all drives with &#8220;-a .&#8221; and then exclude specific drives eg &#8220;&#8211;excludedata DeviceID=~&#8217;F:|e:'&#8221;.<\/li>\r\n<li>Ability to control the way event are included and excluded. By default any matching events will include\/exclude an event. Added a new mode &#8216;includeall&#8217; where all match specifications have to be met for the event log records to be included. This allows precise selection of event log records.<\/li>\r\n<li>Show some plugin performance stats at the end of each plugin output. The output for checkcpu looks like:<br \/>OK (Sample Period 300 sec) &#8211; Average CPU Utilisation 22.40% Plugin Elapsed<br \/>[Preparation: 0.000s]<br \/>[wmic: 0.256s]<br \/>Plugin Elapsed: 0.349s<br \/>CPU &#8211; User:0.015997 (0.011998+0.003999) System:0.015996 (0.006998+0.008998) MyTotal:0.018996 ChildTotal:0.012997 Total:0.031993 Elapsed:0.349 WMIC_Calls:1 WMIC_Library_Calls:0<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>Running these <a href=\"http:\/\/edcint.co.nz\/checkwmiplus\/nagios-configuration\/nagios-service-definitions\/\">sample services<\/a> over about a 26 hour period with a 5 minute normal check interval (about 40% are ini-based checks) generated the following comparison between using the ini performance improvements and not using them (figures shown using an SQL query against the usage stats):<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">Pro  Checks      Avg Elapsed (sec)  AvgCPU (sec)  Days        Ini Checks\r\n---  ----------  -----------------  ------------  ----------  ----------\r\nNo   9825        0.68               0.182         1.1         4120     \r\nYes  7115        0.574              0.068         0.794       2982\r\n\r\n<\/pre>\r\n\r\n\r\n\r\n<p>Table generated using the command line:<code>sqlite3 -header -column \r\n\/opt\/nagios\/bin\/plugins\/check_wmi_plus.data\/check_wmi_plus.usagedb.alternate\r\n   \"select count(*) as 'Checks',round(sum(elapsedtime)\/count(*),3) as \r\n'Avg Elapsed (sec)',round(sum(totalcpu)\/count(*),3) as 'AvgCPU \r\n(sec)',round(julianday(max(timestamp))-julianday(min(timestamp)),2) as \r\n'Days',sum(iniused) as 'Ini Checks' from usage\"<\/code><\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Going_Pro\"><\/span>Going Pro<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n<p><a name=\"goingpro\"><\/a><\/p>\r\n\r\n<p>The Pro version is a chargeable option and hence is not publicly available. The latest versions of the plugin will automatically use the Pro version if it is installed on your system. It is available with a support contract. The support contract provides free Pro version upgrades for one year.<\/p>\r\n<p><a name=\"goingpro\"><\/a>\r\n\r\n<\/p>\r\n<p>If you are buying the Pro version in order to improve the CPU that Check WMI Plus uses then, before deciding to go Pro you need to understand the following:<\/p>\r\n<p><a name=\"goingpro\"><\/a>\r\n\r\n<\/p>\r\n<ul class=\"wp-block-list\">\r\n<li>The Pro version may be of benefit if you are seeing high CPU load. It might not help your &#8220;load problem&#8221;.<\/li>\r\n<li>If your load average is less than or equal to the number of total cores available to your system, then you don&#8217;t have a load problem.<\/li>\r\n<li>We are of the opinion that even if your load is higher than your number of cores, what really matters (or it is a major factor) is your check latency. If your check latency is still good, then Pro may or may not really help you.<\/li>\r\n<li>Check WMI Plus Pro can only reduce the CPU that the plugin uses. It may not be able to reduce the load on your server to something you deem acceptable, but it will reduce the CPU used by the plugin.<\/li>\r\n<li>You are buying Pro so that Check WMI Plus uses less CPU.<\/li>\r\n<li>We can only guarantee the Check WMI Plus Pro reduces the CPU Check WMI Plus consumes. We can not guarantee that it reduces your CPU utilisation or load.<\/li>\r\n<\/ul>\r\n<p><a name=\"goingpro\"><\/a>\r\n\r\n<\/p>\r\n<p>There are a couple of tests you can run to confirm if the load is most likely generated by lots of Check WMI Plus checks.<br \/>Try <a href=\"http:\/\/edcint.co.nz\/checkwmiplus\/faq\/i-have-pro-but-my-load-cpu-has-not-improved\/#usecached\">using cached WMI responses<\/a> and then try <a href=\"http:\/\/edcint.co.nz\/checkwmiplus\/faq\/i-have-pro-but-my-load-cpu-has-not-improved\/#disablecwp\">disabling Check WMI Plus<\/a>.<\/p>\r\n<p><a name=\"goingpro\"><\/a>\r\n\r\n<\/p>\r\n<p>If you understand the above and would like to go Pro, then register interest\/comments via the <a href=\"http:\/\/edcint.co.nz\/checkwmiplus\/about\/cwpcontact\/\">Contact Page<\/a> stating that you understand the above bullet points.<\/p>\r\n<p><a name=\"goingpro\"><\/a>\r\n\r\n<\/p>\r\n<p>Once you have received confirmation that we are prepared to sell the Pro version to you please do the following:<\/p>\r\n<p><a name=\"goingpro\"><\/a>\r\n\r\n<\/p>\r\n<ul class=\"wp-block-list\">\r\n<li>Download and review the <a href=\"http:\/\/edcint.co.nz\/checkwmiplus\/download\/pro-eula\/\">EULA<\/a>.<\/li>\r\n<li>Send us an email from an appropriately authorised person in your company with their contact details, the EULA attached, saying that they agree to the EULA.<\/li>\r\n<li>Tell us the number of Nagios servers you wish to install it on.<\/li>\r\n<\/ul>\r\n<p><a name=\"goingpro\"><\/a>\r\n\r\n<\/p>\r\n<p>Check WMI Plus Pro is $250AUD per Nagios server that it is installed on with a $50AUD\/year support contract. The support contract entitles you to free Pro version upgrades for one year.<\/p>\r\n<p><a name=\"goingpro\"><\/a>\r\n\r\n<\/p>\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Sample_Usage_Stats\"><\/span>Sample Usage Stats<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p><a name=\"goingpro\"><\/a>\r\n\r\n<\/p>\r\n<p>Using:<code>sqlite3 -header -column \r\n\/opt\/nagios\/bin\/plugins\/check_wmi_plus.data\/check_wmi_plus.usagedb   \r\n\"SELECT mode,count() as count,round(sum(totalcpu)\/count(),3) as \r\navgcpu,round(sum(elapsedtime)\/count(),3) as avgelapsed,sum(wmiccalls) as\r\n WMIC,sum(wmiclibrarycalls) as WMIC_LIB FROM usage GROUP BY mode ORDER \r\nBY avgcpu DESC\"<\/code><\/p>\r\n<p><a name=\"goingpro\"><\/a>\r\n\r\n<\/p>\r\n<pre class=\"wp-block-preformatted\">mode        count       avgcpu      avgelapsed  WMIC        WMIC_LIB  \r\n----------  ----------  ----------  ----------  ----------  ----------\r\ncheckcpuq   8107        0.317       4.259       161762      0          \r\ninfo        10924       0.08        0.764       10912       3         \r\ncheckfilea  13587       0.077       0.48        13576       1         \r\ncheckio     5451        0.068       0.43        5447        0         \r\ncheckproc   21976       0.068       0.509       21964       2         \r\ncheckts     13520       0.068       0.351       13516       0         \r\ncheckprint  5524        0.067       0.408       5523        0         \r\ncheckeachc  5456        0.066       0.446       5450        0         \r\ntest        10907       0.066       0.406       10900       1         \r\ncheckcpu    5561        0.058       0.417       5536        21        \r\ncheckservi  16561       0.058       0.994       16549       3         \r\nchecknetwo  5468        0.057       0.721       6306        0         \r\ncheckevent  10905       0.055       0.371       10897       2         \r\ncheckproce  16363       0.055       0.416       16347       2         \r\ncheckpage   8068        0.054       0.366       8529        0         \r\ncheckdrive  5457        0.053       0.553       5452        1         \r\ncheckmem    5458        0.053       0.36        5456        0         \r\ncheckuptim  5518        0.053       0.357       5513        1         \r\ncheckfiles  5454        0.052       0.353       5454        0  \r\n<\/pre>\r\n<p><a name=\"goingpro\"><\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>Check WMI Plus Pro improves performance in a couple of different ways (first 2 items in the feature list) as well as some functional improvements:&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","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":[12],"tags":[],"class_list":["post-124","post","type-post","status-publish","format-standard","hentry","category-pro"],"_links":{"self":[{"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/posts\/124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/types\/post"}],"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=124"}],"version-history":[{"count":14,"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/posts\/124\/revisions"}],"predecessor-version":[{"id":657,"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/posts\/124\/revisions\/657"}],"wp:attachment":[{"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/media?parent=124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/categories?post=124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edcint.co.nz\/checkwmiplus\/wp-json\/wp\/v2\/tags?post=124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}