<?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; Computers</title>
	<atom:link href="http://www.parkingdenied.com/category/computers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.parkingdenied.com</link>
	<description>Redline is just a suggestion</description>
	<lastBuildDate>Mon, 14 Jun 2010 12:50:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.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>2</slash:comments>
		</item>
		<item>
		<title>Automated VirtualBox + LVM Snapshot VM Provisioning</title>
		<link>http://www.parkingdenied.com/2009/07/12/automated-virtualbox-lvm-snapshot-vm-provisioning/</link>
		<comments>http://www.parkingdenied.com/2009/07/12/automated-virtualbox-lvm-snapshot-vm-provisioning/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 09:14:32 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[LVM]]></category>
		<category><![CDATA[Snapshots]]></category>
		<category><![CDATA[Virtualbox]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/2009/07/12/automated-virtualbox-lvm-snapshot-vm-provisioning/</guid>
		<description><![CDATA[Just a quick follow-up to my previous post about using LVM to clone logical volumes to create new VM’s. I’ve written up a quick script to help automate the process which allows you to rapidly deploy a fleet of test VM’s without having to mess about. The script is attached below and requires PHP. Configure [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick follow-up to my previous post about using LVM to clone logical volumes to create new VM’s. I’ve written up a quick script to help automate the process which allows you to rapidly deploy a fleet of test VM’s without having to mess about.</p>
<p>The script is attached below and requires PHP. Configure the config options within the script and then to provision a new VM you simply sudo ./makevm.php &lt;vmname&gt; and it will take care of everything.</p>
<ul>
<li>Creates the snapshot of the original logical volume</li>
<li>Sets the permissions on the device so that the user can access it</li>
<li>Creates the raw VMDK file and registers it with VirtualBox</li>
<li>Creates the base VM with the name provided</li>
<li>And finally it configures the VM to use the correct disk and network setting etc</li>
</ul>
<p>That’s all there is to it <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/2009/07/12/automated-virtualbox-lvm-snapshot-vm-provisioning/feed/</wfw:commentRss>
		<slash:comments>0</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>19</slash:comments>
		</item>
		<item>
		<title>Cloning VM’s with VirtualBox, LVM and Snapshots!</title>
		<link>http://www.parkingdenied.com/2009/05/15/cloning-vm%e2%80%99s-with-virtualbox-lvm/</link>
		<comments>http://www.parkingdenied.com/2009/05/15/cloning-vm%e2%80%99s-with-virtualbox-lvm/#comments</comments>
		<pubDate>Fri, 15 May 2009 15:10:30 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[LVM]]></category>
		<category><![CDATA[Snapshots]]></category>
		<category><![CDATA[Virtualbox]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/?p=205</guid>
		<description><![CDATA[Recently I wanted to setup a development environment to test some Active Directory setups. Basically I wanted a whole stack of domain controllers and client machines across multiple sites, domains and forests to see how they tick and replicate between each other. Easy enough to do, just create a bunch of virtual machines using your [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I wanted to setup a development environment to test some Active Directory setups. Basically I wanted a whole stack of domain controllers and client machines across multiple sites, domains and forests to see how they tick and replicate between each other. Easy enough to do, just create a bunch of virtual machines using your favourite virtualization package, I prefer VirtualBox but you could do the same with VirtualPC or VMWare. But say you want to quickly deploy this and be able to easily tear down machines and bring new ones up, again easy enough just clone the disks and create new VM’s. All pretty straight forward. However there is a much neater and more elegant way of doing this which allows you to quickly snapshot a VM and redeploy in a matter of a seconds rather than minutes to hours copying full disk images around.</p>
<p>So how does one accomplish this task, well it’s really quite simple, LVM snapshots. If you have never heard or used LVM before it is a logical volume manager. It’s job is to take a bunch of physical volumes such as hard disks or raid arrays and combine them into a storage group. From this storage group you can then create multiple logical volumes (similar to luns in the Netapp world) which act like standard disk devices allowing you to easily carve up your storage in a more logical way. Now LVM is really quite a powerful tool and has many extra features which are outside of the scope of this article but see my links at the end to find out more on the specifics.</p>
<p>Anyway the feature we are going to use as I already mentioned is snapshots, what these are is an instantaneous snapshot of a volume which we can then mount separate to the real volume and use as a normal disk. The beauty of this is that your original volume remains completely untouched and any changes that are written to the snapshot are stored as just that changes or differences between that and the original volume. This means for our VM’s that only a few hundred meg or so will change that our disk usage is significantly reduced. You can see now just how useful this can be. The other big advantage is that they are fast, you can create a snapshot in a matter of seconds whereas to copy a vmdk or vdi file it takes a lot longer for it to copy, especially if using a dynamic disk as it locates all the used blocks.</p>
<p>Now lets get down to using it in the real world.</p>
<p>First things first get your VM installed using a raw device mapping.</p>
<blockquote><p>lvcreate -L20G -nvbox_win2003std_base storage /dev/md2<br />
Logical volume &#8220;vbox_win2003_base&#8221; created</p></blockquote>
<p>In this instance I have created a 20gb volume called “vbox_win2003_base” on my storage volume group and forced it to allocate all its extents on /dev/md2. I prefer to do this just to make sure no logical volumes cross over physical volumes unless absolutely needed.</p>
<p>Now you have your volume ready you will need to create a disk for VirtualBox to use.</p>
<blockquote><p>VBoxManage internalcommands createrawvmdk -filename &#8220;win2003_base.vmdk&#8221; -rawdisk /dev/storage/vbox_win2003std_base -register<br />
VirtualBox Command Line Management Interface Version 2.2.2<br />
(C) 2005-2009 Sun Microsystems, Inc.<br />
All rights reserved.</p>
<p>RAW host disk access VMDK file win2003_base.vmdk created successfully.</p></blockquote>
<p>This creates a vmdk file with a raw mapping to the logical volume and automatically registers it for use within VirtualBox.</p>
<p>Now prepare your VM like you would any other Windows machine being cloned. Preinstall all your OS, applications, software, any patches or tweaks and get it configured just the way you like. However try to keep things reasonably simple, this means don’t promote the machine to a DC or any other service which when cloned will break. For my builds I have been testing with Windows 2003 Standard edition. So this means you need to extract the deploy.cab from your Windows 2003 CD to c:\sysprep and run the setupmgr.exe app to generate a sysprep.inf. If you want to avoid problems don’t set a password for the admin account in the sysprep if you have already set one for the machine as it appears to fail when updating it. So you have generated your sysprep.inf, do a quick check to ensure everything is in it’s place and run sysprep.exe –reseal –mini –pnp. The machine will do its bit and then shut down meaning it is ready to be cloned.</p>
<p>Now the fun part, time to make a snapshot of your logical volume.</p>
<blockquote><p>lvcreate -L5G -s -nvbox_vodka_dc /dev/storage/vbox_win2003std_base<br />
Logical volume &#8220;vbox_vodka_dc&#8221; created</p></blockquote>
<p>Now in the blink of an eye it has created a snapshot of your base VM’s logical volume with a maximum growth of 5gb. This means the VM can have a maximum of 5gb of changes before it runs out of space. You will need to fine tune this depending on your VM’s and workload. To keep an eye on it simply use lvdisplay as per normal.</p>
<blockquote><p>lvdisplay storage/vbox_vodka_dc<br />
&#8212; Logical volume &#8212;<br />
LV Name                /dev/storage/vbox_vodka_dc<br />
VG Name                storage<br />
LV UUID                IOFUF4-Bxze-Xpij-Qd5b-nH7k-FeEx-k6936B<br />
LV Write Access        read/write<br />
LV snapshot status     active destination for /dev/storage/vbox_win2003std_base<br />
LV Status              available<br />
# open                 0<br />
LV Size                20.00 GB<br />
Current LE             5120<br />
COW-table size         5.00 GB<br />
COW-table LE           1280<br />
Allocated to snapshot  0.00%<br />
Snapshot chunk size    4.00 KB<br />
Segments               1<br />
Allocation             inherit<br />
Read ahead sectors     auto<br />
- currently set to     256<br />
Block device           253:4</p></blockquote>
<p>Now that we have the snapshot volume all we need to do is create another raw device vmdk.</p>
<blockquote><p>VBoxManage internalcommands createrawvmdk -filename &#8220;Vodka_DC.vmdk&#8221; -rawdisk /dev/storage/vbox_vodka_dc<br />
VirtualBox Command Line Management Interface Version 2.2.2<br />
(C) 2005-2009 Sun Microsystems, Inc.<br />
All rights reserved.</p>
<p>RAW host disk access VMDK file Vodka_DC.vmdk created successfully.</p></blockquote>
<p>And that’s it, you now have a complete clone of that machine ready to load into a new VM within VirtualBox and boot. It will run through the mini-setup as per normal for any cloned machine and that’s it. All done!</p>
<p>With a few batch commands you can quickly automate the creating of a whole fleet of VM’s ready to plug into your dev environment.</p>
<p>Hope this helps a few people out there <img src='http://www.parkingdenied.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Links:</p>
<ul>
<li><a href="http://tldp.org/HOWTO/LVM-HOWTO/index.html" target="_blank">LVM</a> (<a href="http://en.wikipedia.org/wiki/Logical_Volume_Manager_%28Linux%29" target="_blank">wiki</a>)<a href="http://tldp.org/HOWTO/LVM-HOWTO/index.html" target="_blank"><br />
</a></li>
<li><a href="http://www.virtualbox.org" target="_blank">VirtualBox</a> (<a href="http://en.wikipedia.org/wiki/VirtualBox" target="_blank">wiki</a>)<a href="http://www.virtualbox.org" target="_blank"><br />
</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.parkingdenied.com/2009/05/15/cloning-vm%e2%80%99s-with-virtualbox-lvm/feed/</wfw:commentRss>
		<slash:comments>4</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>Monitoring a Speedstream 4200</title>
		<link>http://www.parkingdenied.com/2008/12/17/monitoring-a-speedstream-4200/</link>
		<comments>http://www.parkingdenied.com/2008/12/17/monitoring-a-speedstream-4200/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 12:00:29 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[ADSL]]></category>
		<category><![CDATA[Cacti]]></category>
		<category><![CDATA[SNMP]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/?p=78</guid>
		<description><![CDATA[Due to a recent ADSL fault I began monitoring the stats from my Speedstream 4200 DSL modem. I figured the Cacti graphs might be handy for anyone else out there in a similar situation. Example graphs are below As you can see there was a pretty bad line fault! Attached below are the templates required, [...]]]></description>
			<content:encoded><![CDATA[<p>Due to a recent ADSL fault I began monitoring the stats from my Speedstream 4200 DSL modem. I figured the Cacti graphs might be handy for anyone else out there in a similar situation. Example graphs are below <img src='http://www.parkingdenied.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  As you can see there was a pretty bad line fault!</p>
<p><img class="alignnone size-full wp-image-79" title="syncrate" src="http://www.parkingdenied.com/wp-content/uploads/2008/12/syncrate.png" alt="syncrate" width="595" height="239" /></p>
<p><img class="alignnone size-full wp-image-80" title="upstream" src="http://www.parkingdenied.com/wp-content/uploads/2008/12/upstream.png" alt="upstream" width="595" height="239" /></p>
<p><img class="alignnone size-full wp-image-81" title="downstream" src="http://www.parkingdenied.com/wp-content/uploads/2008/12/downstream.png" alt="downstream" width="595" height="239" /></p>
<p>Attached below are the templates required, all that is really needed is a few Get SNMP data sources and away you go <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. Note: There is a file embedded within this post, please visit this post to download the file.
<p>For reference here are the SNMP OID&#8217;s required to pull the stats.</p>
<p><strong>Down</strong><br />
Attenuation    .1.3.6.1.2.1.10.94.1.1.2.1.5.2<br />
Sync        .1.3.6.1.2.1.10.94.1.1.4.1.2.2<br />
SNR        .1.3.6.1.2.1.10.94.1.1.2.1.4.2</p>
<p><strong>Up</strong><br />
Attenuation    .1.3.6.1.2.1.10.94.1.1.3.1.5.2<br />
Sync        .1.3.6.1.2.1.10.94.1.1.5.1.2.2<br />
SNR        .1.3.6.1.2.1.10.94.1.1.3.1.4.2</p>
<p>One last thing&#8230; I have attached to this post the latest open version of the firmware. As these modems were always branded when sold you may require the open version to get around the VOIP block and also enable a few of the hidden features that were turned off by some resellers.</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/17/monitoring-a-speedstream-4200/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improved Cacti Traffic Graphs</title>
		<link>http://www.parkingdenied.com/2008/12/11/improved-cacti-traffic-graphs/</link>
		<comments>http://www.parkingdenied.com/2008/12/11/improved-cacti-traffic-graphs/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 08:59:55 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Cacti]]></category>

		<guid isPermaLink="false">http://www.parkingdenied.com/?p=62</guid>
		<description><![CDATA[Traffic graphs in Cacti are alright to begin with but there are a few modifications you can make to both improve the look and usefulness of them. Something like this&#8230; Now this isn&#8217;t my idea, a member of the Cacti forums put up a rough guide to get people going. You can view this here [...]]]></description>
			<content:encoded><![CDATA[<p>Traffic graphs in Cacti are alright to begin with but there are a few modifications you can make to both improve the look and usefulness of them.</p>
<p>Something like this&#8230;</p>
<p><img class="alignnone size-full wp-image-63" title="sexycactigraph" src="http://www.parkingdenied.com/wp-content/uploads/2008/12/sexycactigraph.png" alt="sexycactigraph" width="595" height="211" /></p>
<p><img class="alignnone size-full wp-image-64" title="sexycactigraphzoom" src="http://www.parkingdenied.com/wp-content/uploads/2008/12/sexycactigraphzoom.png" alt="sexycactigraphzoom" width="595" height="239" /></p>
<p>Now this isn&#8217;t my idea, a member of the Cacti forums put up a rough guide to get people going. You can view this here <a href="http://forums.cacti.net/about25415.html" target="_blank">http://forums.cacti.net/about25415.html</a>. However to make things simple I have attached a template which should take care of the graph template, CDEF and also includes a few other changes. I have split the graph into positive for inbound and negative for outbound traffic and added a total traffic item to the graph which I use to monitor my ADSL traffic over a period of time.</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/11/improved-cacti-traffic-graphs/feed/</wfw:commentRss>
		<slash:comments>0</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[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>0</slash:comments>
		</item>
	</channel>
</rss>
