<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Parkingdenied &#187; PHP</title>
	<atom:link href="http://www.parkingdenied.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.parkingdenied.com</link>
	<description>Redline is just a suggestion</description>
	<lastBuildDate>Wed, 26 Oct 2011 14:15:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PHP WMI Library for Linux</title>
		<link>http://www.parkingdenied.com/2010/02/24/php-wmi-library-linux/</link>
		<comments>http://www.parkingdenied.com/2010/02/24/php-wmi-library-linux/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 04:39:33 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/?p=220</guid>
		<description><![CDATA[I&#8217;ve just released a WMI/PHP library which will allow you to easily WMI query Windows machines from your Linux server via PHP. It is somewhat of an extension of the CactiWMI project as it used that code base as a reference for the query and processing of the returned data. Whilst there are a number [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just released a WMI/PHP library which will allow you to easily WMI query Windows machines from your Linux server via PHP. It is somewhat of an extension of the CactiWMI project as it used that code base as a reference for the query and processing of the returned data. Whilst there are a number of libraries in existence for this purpose on Windows there appeared to be none for when running PHP on Linux.</p>
<p>So why has this all come about. In my job I&#8217;ve been working on a small helpdesk type application written in PHP. The idea being that it presents all the information about the user, computer and helpdesk ticket that we are working on in one place. It also provides a quicker interface for searching information than the existing systems on their own. For this I needed to be able to hook into Active Directory, the MSSQL job tracking DB and of course WMI data for the remote PC. All this from the Linux based server.</p>
<p>So I branched off some code from the CactiWMI project and initially wrote it as a simple wmi() type function to run basic queries against remote machines. This quickly became a bit of a pain as I needed to add more arguments to allow filters and then more code to decide if a filter had been supplied or not etc so dumped it and rewrote it into a WMI object.</p>
<p>Now what we have is a reasonably simple library which you can include into your project, create the WMI object and throw some queries at hosts. The data returned at the moment is a little rough as its just a numerically indexed multi dimensional array but should make iteration very easy. I&#8217;ll be looking for suggestions as to what I can improve as it&#8217;s the first library like this I have had to write and I&#8217;ve probably made plenty of rookie mistakes.</p>
<p>I&#8217;ve attached a copy of the current stable release and an example file which should get people started until I can add some documentation. I may look at releasing the helpdesk app as well as it&#8217;s come in quite useful <img src='http://www.parkingdenied.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>SVN Repository is located here <a href="http://svn.parkingdenied.com/PHPWMILib/">http://svn.parkingdenied.com/PHPWMILib/</a></p>
Note: There is a file embedded within this post, please visit this post to download the file.
]]></content:encoded>
			<wfw:commentRss>http://www.parkingdenied.com/2010/02/24/php-wmi-library-linux/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>0.0.6 Release of CactiWMI</title>
		<link>http://www.parkingdenied.com/2009/05/21/006-release-of-cactiwmi/</link>
		<comments>http://www.parkingdenied.com/2009/05/21/006-release-of-cactiwmi/#comments</comments>
		<pubDate>Thu, 21 May 2009 11:35:25 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Cacti]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/2009/05/21/006-release-of-cactiwmi/</guid>
		<description><![CDATA[I posted this on the forums some time ago and realised I had not posted here. This is the latest version, the mini change log is below. Update templates to suit new input method Backwards compatibility for old argument input method Overhaul how arguments are passed to wmi.php Debug mode via console option Add support [...]]]></description>
			<content:encoded><![CDATA[<p>I posted this on the forums some time ago and realised I had not posted here. This is the latest version, the mini change log is below.</p>
<ul>
<li>Update templates to suit new input method</li>
<li>Backwards compatibility for old argument input method</li>
<li>Overhaul how arguments are passed to wmi.php</li>
<li>Debug mode via console option</li>
<li>Add support for alternate namespaces</li>
<li>Use isset() instead of is not null</li>
<li>Prevent passwords from showing up in process list</li>
<li>Fix data template MIN &amp; MAX</li>
<li>Enterprise Vault Templates</li>
</ul>
<p>I have added support for additional namespaces and overhauled how  input arguments are passed to support this. As you can see below the cmd line help details how input is now passed.</p>
<blockquote><p>Usage:<br />
-h &lt;hostname&gt;         Hostname of the server to query.<br />
-u &lt;credential path&gt;  Path to the credential file. See format below.<br />
-n &lt;namespace&gt;        What namespace to use. (optional, defaults to root\CIMV2)<br />
-w &lt;wmi class&gt;        WMI Class to be used.<br />
-c &lt;columns&gt;          What columns to select. (optional, defaults to *)<br />
-k &lt;filter key&gt;       What key to filter on. (optional, default is no filter)<br />
-v &lt;filter value&gt;     What value for the key. (required, only when using filter key)<br />
-d &lt;debug level&gt;      Debug level. (optional, default is none, levels are 1 &amp; 2)</p>
<p>All special characters and spaces must be escaped or enclosed in single quotes!</p>
<p>Example: wmi.php -h 10.0.0.1 -u /etc/wmi.pw -w Win32_ComputerSystem -c PrimaryOwnerName,NumberOfProcessors -n &#8216;root\CIMV2&#8242;</p>
<p>Password file format: Plain text file with the following 3 lines replaced with your details.</p>
<p>username=&lt;your username&gt;<br />
password=&lt;your password&gt;<br />
domain=&lt;your domain&gt; (can be WORKGROUP if not using a domain)</p></blockquote>
<p>In addition to this there is now no longer any need for additional PHP files. The passwords are stored in a separate file and called via passing the path. This prevents passwords showing up in your process list and allows you to secure it further by limiting access to the password file to the cacti user.</p>
<p>To ease the upgrade process backwards compatibility has been maintained however there is one gotcha. You will still need to update your templates to point to the new password file instead of the reference to the key pair in wmi-logins.php. Aside from this the old templates will all work.</p>
<p>So basically this version is a bit cleaner, adds a few key features, improves security and lays the foundation for further feature upgrades. As per usual the download is attached to this post and any fault tickets can be lodged on my Mantis bug tracker page (<a href="http://mantis.parkingdenied.com" target="_blank">Link</a>) and the subversion repository in the usual spot (<a href="http://svn.parkingdenied.com/CactiWMI" target="_blank">Link</a>).</p>
Note: There is a file embedded within this post, please visit this post to download the file.
]]></content:encoded>
			<wfw:commentRss>http://www.parkingdenied.com/2009/05/21/006-release-of-cactiwmi/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>0.0.5 Release of CactiWMI</title>
		<link>http://www.parkingdenied.com/2009/02/23/005-release-of-cactiwmi/</link>
		<comments>http://www.parkingdenied.com/2009/02/23/005-release-of-cactiwmi/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 09:33:41 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Cacti]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/?p=133</guid>
		<description><![CDATA[It&#8217;s been a while since I released an update and there have been a number of templates since 0.0.4 so packaged them up ready for consumption Below are some examples of what we now have! So we have some standard Windows stats such as system calls, context switches and process/processor stats. We can now also [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I released an update and there have been a number of templates since 0.0.4 so packaged them up ready for consumption <img src='http://www.parkingdenied.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Below are some examples of what we now have!</p>
<p>So we have some standard Windows stats such as system calls, context switches and process/processor stats.</p>
<p><img class="alignnone size-full wp-image-139" title="windows-processes" src="http://www.parkingdenied.com/wp-content/uploads/2009/02/windows-processes.png" alt="windows-processes" width="603" height="227" /></p>
<p><img class="alignnone size-full wp-image-138" title="windows-contextswitches" src="http://www.parkingdenied.com/wp-content/uploads/2009/02/windows-contextswitches.png" alt="windows-contextswitches" width="603" height="227" /></p>
<p><img class="alignnone size-full wp-image-137" title="windows-processorqueuelength" src="http://www.parkingdenied.com/wp-content/uploads/2009/02/windows-processorqueuelength.png" alt="windows-processorqueuelength" width="603" height="227" /></p>
<p><img class="alignnone size-full wp-image-136" title="windows-systemcalls" src="http://www.parkingdenied.com/wp-content/uploads/2009/02/windows-systemcalls.png" alt="windows-systemcalls" width="603" height="227" /></p>
<p>We can now also monitor processes themselves on an individual basis.</p>
<p><img class="alignnone size-full wp-image-141" title="processstats-memory" src="http://www.parkingdenied.com/wp-content/uploads/2009/02/processstats-memory.png" alt="processstats-memory" width="587" height="241" /></p>
<p><img class="alignnone size-full wp-image-142" title="processstats-general" src="http://www.parkingdenied.com/wp-content/uploads/2009/02/processstats-general.png" alt="processstats-general" width="587" height="241" /></p>
<p>And some new Exchange graphs including the much requested SMTP graphs.</p>
<p><img class="alignnone size-full wp-image-144" title="smtp-performance" src="http://www.parkingdenied.com/wp-content/uploads/2009/02/smtp-performance.png" alt="smtp-performance" width="603" height="255" /></p>
<p><img class="alignnone size-full wp-image-145" title="smtp-queue" src="http://www.parkingdenied.com/wp-content/uploads/2009/02/smtp-queue.png" alt="smtp-queue" width="603" height="241" /></p>
<p><img class="alignnone size-full wp-image-143" title="exchange-clientrpclatency" src="http://www.parkingdenied.com/wp-content/uploads/2009/02/exchange-clientrpclatency.png" alt="exchange-clientrpclatency" width="953" height="243" /></p>
<p>And here is the download. Any questions or suggestions let me know and feel free to stop by the thread on the Cacti forums (<a href="http://forums.cacti.net/viewtopic.php?t=30438" target="_blank">Link!</a>).</p>
Note: There is a file embedded within this post, please visit this post to download the file.
]]></content:encoded>
			<wfw:commentRss>http://www.parkingdenied.com/2009/02/23/005-release-of-cactiwmi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New release with Exchange Monitoring!</title>
		<link>http://www.parkingdenied.com/2009/01/16/new-release-with-exchange-monitoring/</link>
		<comments>http://www.parkingdenied.com/2009/01/16/new-release-with-exchange-monitoring/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 14:24:04 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Cacti]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/?p=104</guid>
		<description><![CDATA[It’s been a little while since I have released anything but after a bit of work I have a new version which now supports monitoring Exchange! Previously I had monitored Exchange myself via WMI using a custom PHP script but now this can all be done with a reasonably straight forward set of templates and [...]]]></description>
			<content:encoded><![CDATA[<p>It’s been a little while since I have released anything but after a bit of work I have a new version which now supports monitoring Exchange! Previously I had monitored Exchange myself via WMI using a custom PHP script but now this can all be done with a reasonably straight forward set of templates and the generic wmi.php <img src='http://www.parkingdenied.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Aside from just supporting Exchange here are the changes below:</p>
<ul>
<li>Now parses out spaces and replaces with an underscore (needed for anything that has a name with spaces in it)</li>
<li>Included new debug mode which logs detailed information to a per host text file</li>
<li>Code cleanup, should make it a bit easier to configure</li>
<li>General tweaking</li>
</ul>
<p>The biggest issue with Exchange that I encountered was that the store names could have spaces which would throw off Cacti when it interpreted the data being passed to it. But as you can see from below the changes have fixed this issue and allow for some useful monitoring.</p>
<p><img class="alignnone size-full wp-image-105" title="004-exchange-activelogons" src="http://www.parkingdenied.com/wp-content/uploads/2009/01/004-exchange-activelogons.png" alt="004-exchange-activelogons" width="837" height="313" /></p>
<p><img class="alignnone size-full wp-image-106" title="004-exchange-messages-per-sec" src="http://www.parkingdenied.com/wp-content/uploads/2009/01/004-exchange-messages-per-sec.png" alt="004-exchange-messages-per-sec" width="853" height="299" /></p>
<p>The templates are included in the attached tar file, please note however that the active client logons will need tweaking to suit your system. For me I created two graphs based on the template then removed the template so that the name of each store could be displayed on the graph. You can do this or alternatively do per store graphs however I found it to be overkill and used two graphs of 5 stores each.</p>
<p>The new debug mode logs by default to /tmp but you can adjust this to wherever you like so long as it has the correct permissions. Effectively what you will end up with is a log file per host of the filename dbug_xx.xx.xx.xx where the x&#8217;s are your IP. Inside it will contain basically all the variables being passed in and out as well as the direct output from wmic etc. With this you should be able to track whats going on and debug any issues.</p>
<p>So there you have it everything you need to get started. I will have some additional Exchange templates over the next few weeks so stay tuned! For now if you need help leave a message or drop by the Cacti forums. Also one last note you can browse the latest code and check out any build you like from the web based Subversion repository. Check it out at <a href="http://svn.parkingdenied.com/">http://svn.parkingdenied.com/</a></p>
Note: There is a file embedded within this post, please visit this post to download the file.
]]></content:encoded>
			<wfw:commentRss>http://www.parkingdenied.com/2009/01/16/new-release-with-exchange-monitoring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First CactiWMI release! (0.0.3)</title>
		<link>http://www.parkingdenied.com/2008/12/24/first-cactiwmi-release-003/</link>
		<comments>http://www.parkingdenied.com/2008/12/24/first-cactiwmi-release-003/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 10:25:39 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Cacti]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/?p=98</guid>
		<description><![CDATA[Yer yer I know it&#8217;s not the first actual release but it&#8217;s the first one I am posting up publicly. CactiWMI is the project I have been working on as a method to monitor Windows servers and applications such as Exchange and SQL from a Linux based Cacti install. To do this it uses a [...]]]></description>
			<content:encoded><![CDATA[<p>Yer yer I know it&#8217;s not the first actual release but it&#8217;s the first one I am posting up publicly.</p>
<p>CactiWMI is the project I have been working on as a method to monitor Windows servers and applications such as Exchange and SQL from a Linux based Cacti install. To do this it uses a combination of some PHP scripting and the WMI client for Linux which just so happens to be available as a Debian package <img src='http://www.parkingdenied.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Anyway I&#8217;ve posted up some previous examples of what can be done and they were pretty rough. So here are a few examples of what can be done and what templates are available in the package.</p>
<p>Here we can monitor memory usage, this one showing the physical memory usage compared against the commit limit and the current commited bytes.</p>
<p><img class="alignnone size-full wp-image-97" title="002-windows-memory" src="http://www.parkingdenied.com/wp-content/uploads/2008/12/002-windows-memory.png" alt="002-windows-memory" width="703" height="241" /></p>
<p>Simple disk space monitor. It also does not suffer from the SNMP remapping problem where when you add a new disk the OID&#8217;s are remapped and thus your stats break.</p>
<p><img class="alignnone size-full wp-image-96" title="002-windows-diskspace" src="http://www.parkingdenied.com/wp-content/uploads/2008/12/002-windows-diskspace.png" alt="002-windows-diskspace" width="703" height="227" /></p>
<p>Pretty straight forward, disk I/O so you can see what is really going on when you have load problems.</p>
<p><img class="alignnone size-full wp-image-95" title="002-windows-diskio" src="http://www.parkingdenied.com/wp-content/uploads/2008/12/002-windows-diskio.png" alt="002-windows-diskio" width="703" height="241" /></p>
<p>CPU usage, available with templates for 1, 2 and 4 core machines. I will do one for an 8 core machine shortly.</p>
<p><img class="alignnone size-full wp-image-94" title="002-windows-cpu" src="http://www.parkingdenied.com/wp-content/uploads/2008/12/002-windows-cpu.png" alt="002-windows-cpu" width="703" height="255" /></p>
<p>SQL performance. Tested against SQL 2005.</p>
<p><img class="alignnone size-full wp-image-93" title="002-sql-performance" src="http://www.parkingdenied.com/wp-content/uploads/2008/12/002-sql-performance.png" alt="002-sql-performance" width="703" height="227" /></p>
<p>Domain controller LDAP stats. If you use a lot of query based distribution groups or use LDAP for external authentication this can be invaluable to see when there are performance problems.</p>
<p><img class="alignnone size-full wp-image-92" title="002-ntds-ldap-connections" src="http://www.parkingdenied.com/wp-content/uploads/2008/12/002-ntds-ldap-connections.png" alt="002-ntds-ldap-connections" width="703" height="255" /></p>
<p><img class="alignnone size-full wp-image-91" title="002-ntds-ldap" src="http://www.parkingdenied.com/wp-content/uploads/2008/12/002-ntds-ldap.png" alt="002-ntds-ldap" width="687" height="269" /></p>
<p>NT Domain Controller stats. Both authentications per second as well as the read/write/searches against your domain. Good for performance troubleshooting and detecting rogue applications.</p>
<p><img class="alignnone size-full wp-image-90" title="002-ntds-ds" src="http://www.parkingdenied.com/wp-content/uploads/2008/12/002-ntds-ds.png" alt="002-ntds-ds" width="703" height="255" /></p>
<p><img class="alignnone size-full wp-image-89" title="002-ntds-auth" src="http://www.parkingdenied.com/wp-content/uploads/2008/12/002-ntds-auth.png" alt="002-ntds-auth" width="703" height="241" /></p>
<p>Pretty useful no?</p>
<p>So how to set them up&#8230; Grab the package attached to this post. It will contain two PHP scripts and a number of templates. Extract the two files to your Cacti scripts folder and then start editing the wmi-logins.php file. In this file are listed the username/password pairs which are referenced by the script. This separates the credential itself from Cacti meaning your Cacti admins don&#8217;t actually need to know your WMI user which you are using to pull the stats. In any case add the credential as per the file which should be pretty self explanitory.</p>
<p>Before we go too much further there are some gotcha&#8217;s that need to be taken care of regarding the user you have selected to do the WMI queries. This user needs to both have access to remotely query WMI but also to be able to query the subsystems from WMI. What this means in our case is that the user needs have remote access to WMI, be allowed to remote query and then also to be allowed to access perfmon. From my understanding this is due to perfmon being a subsystem which WMI is accessing and thus the credential being used must also have access to the perfmon counters in order to be able to graph anything. For the WMI portion of things you can get most of the information from this MSDN link <a href="http://msdn2.microsoft.com/en-us/library/aa393266.aspx" target="_blank">http://msdn2.microsoft.com/en-us/library/aa393266.aspx</a>. The basics are you grant the user permission to remote WMI as discussed, you then need to grant the user access to the appropriate WMI namespace, in our case this is CIMV2 and then add the user to the perfmon group which by default the 2003 server and up machines should have. This should grant it all the permission it requires, however if you do have problems test with an admin credential and see if you get results. If you do get results as admin but not as your non-admin user then you have a permission issue.</p>
<p>Ok so thats out of the way now you may need to update the wmi.php file to ensure the correct path to your wmic binary so edit that and ensure it is correct. Additionally you can redirect the location of the wmi-logins.php by editing the appropriate variable. Most of the code should be commented to help explain what it is doing, basically its acting as the glue between Cacti and the wmic results. So everything is in place, all that you need to do is import the templates included and attach them to the hosts you want to graph. The slack way I have been doing things is simply adding the graph to the device or the host template which will auto generate the required data sources when you add the graph however your more than welcome to do the the manual way by adding the data source and then the graph and linking the two. Make sure if you used a different credential name to update the data templates as I have not set them to be a per data source credential reference, you will understand once you take a look. It&#8217;s up to you if you need the ability to do per data source credentials for different servers but the option is there should it need to be enabled.</p>
<p>So that should cover everything, add your graphs and start monitoring those hosts! If there are any questions feel free to leave a comment or drop me a PM on the Cacti forums <img src='http://www.parkingdenied.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
Note: There is a file embedded within this post, please visit this post to download the file.
]]></content:encoded>
			<wfw:commentRss>http://www.parkingdenied.com/2008/12/24/first-cactiwmi-release-003/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>WMI Monitoring with Cacti</title>
		<link>http://www.parkingdenied.com/2008/12/11/wmi-monitoring-with-cacti/</link>
		<comments>http://www.parkingdenied.com/2008/12/11/wmi-monitoring-with-cacti/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 08:32:32 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Cacti]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/?p=59</guid>
		<description><![CDATA[Monitoring machines with Cacti is easy when using SNMP but when you start adding Windows servers into the mix it can become a little more difficult. SNMP is available for Windows but it’s quite limited without the use of the old and unsupported perf2mib or the costly SNMP Informant (at least in regards to SQL [...]]]></description>
			<content:encoded><![CDATA[<p>Monitoring machines with Cacti is easy when using SNMP but when you start adding Windows servers into the mix it can become a little more difficult. SNMP is available for Windows but it’s quite limited without the use of the old and unsupported perf2mib or the costly SNMP Informant (at least in regards to SQL and Exchange).</p>
<p>Advantages</p>
<ul>
<li>Built in.</li>
<li>Plenty of documentation available.</li>
<li>Supports most if not all performance counters (Exchange + SQL etc)</li>
<li>Reliable.</li>
<li>Possibly more secure.</li>
</ul>
<p>Disadvantages</p>
<ul>
<li>RPC is required which could cause problems with firewalls.</li>
<li>Requires an account with access to read WMI data.</li>
</ul>
<p>The main problem with SNMP is that without spending a substantial amount of money on SNMP Informant or using the unreliable perf2mib it’s quite hard to get any useful results out of it. With WMI you can pull all sorts of information and monitor most performance counters across the system. And there are plenty of example power shell and vbscripts which can be used to monitor and access WMI information, so it’s relatively straightforward to monitor this data if you’re using a Windows server…</p>
<p>But if you’re not running Cacti on Windows you can’t use these scripts or the more common Perl:OLE. However we can rejoice for there is a WMI client available for Linux/Unix operating systems which can be used to harness the power of WMI and of course use Cacti to monitor these machines.</p>
<p>Now there is a plugin available for Cacti which allows you to query WMI whick looks promising but it does require manual patching of your Cacti install with the plugin architecture which is not always a viable option. Instead I have written up some scripts which will wrap around wmic and allow you to easily graph your windows hosts.</p>
<p>Some example graphs.</p>
<p>Disk I/O</p>
<p><img class="alignnone size-full wp-image-42" title="diskio" src="http://www.parkingdenied.com/wp-content/uploads/2008/11/diskio.png" alt="" width="581" height="211" /></p>
<p>CPU Usage</p>
<p><img class="alignnone size-full wp-image-41" title="cpu" src="http://www.parkingdenied.com/wp-content/uploads/2008/11/cpu.png" alt="" width="595" height="225" /></p>
<p>Disk Usage</p>
<p><img class="alignnone size-full wp-image-43" title="diskusage" src="http://www.parkingdenied.com/wp-content/uploads/2008/11/diskusage.png" alt="" /></p>
<p>As you can see they are quite useful and it can only get better as more scripts are made available. For now the PHP scripts and documentation (what little there is at the moment) can be found on my Subversion repository linked below, if you would like to help and expand this project swing me a message. At this stage there is no packaged release but ideally when they are stable and a lot cleaner packages will be made available.</p>
<p><a href="http://svn.parkingdenied.com/CactiWMI" target="_blank">http://svn.parkingdenied.com/CactiWMI</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.parkingdenied.com/2008/12/11/wmi-monitoring-with-cacti/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

