This plugin currently has no documentation (unless you want to write some!) but I am here to help you as much as I can.
What this plugin does.
---------------------------------------------------------------------------------------------
This plugin adds an integration layer between Cacti and the WMIC Linux binary (GPLv3 License, based upon Samba) , which allows communication directly to the native Windows 2000, XP, 2003 "WMI" client (current source has Vista support, but I can not get it to compile correctly).
Source
---------------------------------------------------------------------------------------------
I provide binaries for 32bit and 64bit CentOS 4.X, but you are free to compile your own from source provided here. I have not modified the source in any way shape or form, so no changes are required from the original.
http://mirror.cactiusers.org/wmi-source.zip
or from the original SVN.
http://dev.zenoss.org/svn/trunk/wmi/
How To
---------------------------------------------------------------------------------------------
Install the plugin the normal PA v1.0 way, by editing the global.php file. I will add v2.0 compatibility shortly. You will need to rename the wmic32 or wmic64 binary to wmic depending on your OS.
This first thing you will notice is a new link under the console, so click it.
The next thing you will need to do is setup an account that has access to the Windows box. So under the Authentication tab, click the Add button. Then fill out the form as so. This information is stored in a semi-encrypted fashion in the database (we have to be able to decrypt it to send it to the Windows box) so be careful about who has access to your database.
Next comes the WMI Query, we will need to build it. Using this builder, we can setup a WMI query to pull the exact information we are needing. To do so you will need to know a bit of information. This is the Class Name, the Keys (Columns), and the Index Key (Unique Column that identifies the item).
I have provided a sample query with the plugin, which I use to pull the number of Exchange emails being sent and received from my Exchange server. I also have one for the SMTP queues if someone wants it.
The Description is the display name for this WMI Query, it holds no other importance. The Query Name is the name that will be used to call this query. It must be unique, and it must contain no spaces. As for the rest, it is taken directly out of the WMI Query you would normally build.
In the example, your WMI query would be like
Code: Select all
SELECT Name, MessagesDelivered, MessagesSent FROM Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox
Associating Accounts to Hosts
---------------------------------------------------------------------------------------------
One of the advantages of direct integration, is that we can tell Cacti to use a specific account for a host, and then every WMI query you set will always use that account without you having to do anything. To do this, just goto the Host, and you will find a new drop down listing the Account you previously setup. Just select it, and you are done!
The Data Query, Graph Template, etc....
---------------------------------------------------------------------------------------------
Now that your WMI Query is setup. Now we need to setup a Data Query to properly tell Cacti how to get this information. I currently have some code that will do most of these next parts for you, but they are not ready for prime time just yet, so you will be doing it by hand.
We will be using the script server to do our work, so we will need to first setup a resource XML. I have attached the one used in the example, you can use it as a template to make your own until the plugin does it for you. The important thing to notice is that the script name will never change, nor will you have to write your own script to pull this. The WMI script provided is generic enough to do everything for you.
Then you will need to import the Graph/DataQuery Template provided, or create your own (you can use mine as an example).
You will need to place the wmi-script.php into the /scripts/ directory, and the resource XML (exchange_messages.xml in the example) into the /resource/script_server/ directory.
Missing Exchange Counters
---------------------------------------------------------------------------------------------
Most likely your WMI Exchange Performance counters will not be avaliable (mine were not) until you run the "wmiadap" command from the command line on your Exchange box.
SQL
---------------------------------------------------------------------------------------------
You will need to import the wmi.sql file, but another thing I forgot is that you will need to add a column to your host table. You can do so with this SQL command
ALTER TABLE `host` ADD `wmi_account` INT( 12 ) NOT NULL ;
Download
---------------------------------------------------------------------------------------------
Because of attachment size limits, you can download the plugin here.
http://mirror.cactiusers.org/wmi.zip
The template is included in the zip.