Monitor Windows via WMI from Cacti on Linux

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
pheezy
Cacti User
Posts: 61
Joined: Thu Oct 26, 2006 5:30 pm

Post by pheezy »

claymen wrote:Generally for objects that have names where you want specific ones I have got a filter value field on the data template. So for the Disk I/O and Disk Space ones there is a Filter Value field where the drive letter goes. All this is doing is basically creating a "select columns from class where row = blah" query when searching.

Which one did you need to adjust the filter for?
Actually I was hoping to make my own graphs using wmi.php that would get some stats on some in-house .NET applications my company has (things like Pipeline Instance Count, Requests Per Sec; perfmon type stuff basically), where the instance names are things like _LM_W3SVC_1892405102_ROOT. I'd assume that would be the filter name. But after doing some sleuthing it doesn't look this info is presented through WMI. :(
pheezy
Cacti User
Posts: 61
Joined: Thu Oct 26, 2006 5:30 pm

Post by pheezy »

argon0 wrote:Looks like good work Claymen

Before using this, and spending time getting it to work a couple of questions:
1) has it been confirmed to work on CactiEZ?
2) Assuming it has can/how do you assign different credentials for different machines?

Argon0
I don't see why it wouldn't work with CactiEZ, is it using 0.8.7b? As for the credentials you edit wmi-login.php and add whichever ones you want, and then specify the credential name (default is credential) when creating the graphs.
tipiaks
Posts: 17
Joined: Tue Feb 24, 2009 5:16 am

Error in poller-error.log

Post by tipiaks »

Hello,


I'm French so sorry for my language.

I have installed cacti 0.8.7b and i want graph Windows informations with wmi.

Default graph in cacti work but graph with WMI return "NAN" informations.

In my poller-error.log i have this line :

NTSTATUS: NT_STATUS_NET_WRITE_FAULT - NT_STATUS_NET_WRITE_FAULT.

I don't understand this error.

In command line wmi work perfectly...

Example : /usr/local/bin/wmic -U "Domain/exempleusers%password" //SERVEUR01 "SELECT * FROM Win32_service" return service on server...


Plz i need help
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Re: Error in poller-error.log

Post by claymen »

tipiaks wrote:Hello,


I'm French so sorry for my language.

I have installed cacti 0.8.7b and i want graph Windows informations with wmi.

Default graph in cacti work but graph with WMI return "NAN" informations.

In my poller-error.log i have this line :

NTSTATUS: NT_STATUS_NET_WRITE_FAULT - NT_STATUS_NET_WRITE_FAULT.

I don't understand this error.

In command line wmi work perfectly...

Example : /usr/local/bin/wmic -U "Domain/exempleusers%password" //SERVEUR01 "SELECT * FROM Win32_service" return service on server...


Plz i need help
What does your poller cache show for the host that is failing? E.g. what is the exact line that cacti is calling. The example you have given is with the wmic command not the wmi.php script which these all use (although the script does call wmic it formats input/output in a way suitable for cacti).
tipiaks
Posts: 17
Joined: Tue Feb 24, 2009 5:16 am

Post by tipiaks »

Where is the poller cache of the host ? On SERVER01 ?

The error is with Disk I/0 script and all others...


I'm beginner in cacti...sorry if i don't understand you... I try ! :oops:


i have changed in xml cacti_graph_template_windows_-_disk-io-wmi.xml this line :

/usr/bin/php -q /usr/share/cacti/site/scripts/wmi.php for indicate my script folder
Attachments
cacti.JPG
cacti.JPG (38.24 KiB) Viewed 8859 times
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

Within Cacti

Utilities -> System Utilities -> View Poller Cache

Filter it to show the host you are trying to graph and the bit we are interested in is the script portion

e.g.

Code: Select all

Script: /usr/bin/php -q /tmp/wmi.php x.x.x.x credential Win32_PerfFormattedData_PerfOS_Processor PercentProcessorTime
	RRD: /var/www/cacti/rra/server.rrd 
tipiaks
Posts: 17
Joined: Tue Feb 24, 2009 5:16 am

Post by tipiaks »

I obtain this line :

Script: /usr/bin/php -q /usr/share/cacti/site/scripts/wmi.php 192.168.19.3 credential Win32_PerfRawData_PerfDisk_LogicalDisk DiskWritesPersec,DiskWriteBytesPersec,DiskReadsPersec,DiskReadBytesPersec,CurrentDiskQueueLength Name C\:

RRD: /var/lib/cacti/rra/brive01_writespersec_970.rrd
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

tipiaks wrote:I obtain this line :

Script: /usr/bin/php -q /usr/share/cacti/site/scripts/wmi.php 192.168.19.3 credential Win32_PerfRawData_PerfDisk_LogicalDisk DiskWritesPersec,DiskWriteBytesPersec,DiskReadsPersec,DiskReadBytesPersec,CurrentDiskQueueLength Name C\:

RRD: /var/lib/cacti/rra/brive01_writespersec_970.rrd
That looks ok. Have you defined a login/password in the wmi-logins.php for the "credential" credential?
tipiaks
Posts: 17
Joined: Tue Feb 24, 2009 5:16 am

Post by tipiaks »

yes i have define an users in wmi-loggins with authorisation on wmi server..

I have copy wmi-loggins.php in wmi.php folder.

( /usr/share/cacti/site/scripts/wmi-loggins.php
/usr/share/cacti/site/scripts/wmi.php )

I have test the users in command line ... and command return good results so i think authorisation work...
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

Ok I think you havent configured something right with the auth.

The default login/password reference that the templates use is credential.

So unless you have updated that in the templates you will need to either create a reference login/password in your wmi-logins.php called "credential".

What you need to do or at least the easiest option is to add this to your wmi-logins.php and replace the bits in caps with your details.

Code: Select all

$logins = array();
$logins['credential'] = array('YOURDOMAIN/YOURUSERNAME','YOURPASSWORD');
wmi-logins.php just provides the main script with a reference so that you don't have your password printed all through your logs instead it refers to the "credential". e.g. credential is refering to the login/password pair defined in wmi-logins.php as per above. This also means you can configure multiple references for different domains or hosts.

So it sounds like you defined your own entry but didn't update the templates to use it.

When you say you tested it, if you used wmic to test then that's not actually testing the script cacti is using.
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

Thanks, I'm running .8.7d now...

Will try this later, wonder if it can run alongside cigamit/Jimmy's wmi plugin...
pheezy wrote:
argon0 wrote:Looks like good work Claymen

Before using this, and spending time getting it to work a couple of questions:
1) has it been confirmed to work on CactiEZ?
2) Assuming it has can/how do you assign different credentials for different machines?

Argon0
I don't see why it wouldn't work with CactiEZ, is it using 0.8.7b? As for the credentials you edit wmi-login.php and add whichever ones you want, and then specify the credential name (default is credential) when creating the graphs.
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

This will work fine with the plugin but the graph templates will need adjusting to suit the alternate data source from the plugin.
tipiaks
Posts: 17
Joined: Tue Feb 24, 2009 5:16 am

Post by tipiaks »

Thanks claymen...

Now script works... I capture informations ! :D
tipiaks
Posts: 17
Joined: Tue Feb 24, 2009 5:16 am

Post by tipiaks »

Re...

I have an another problem. Memory graph doesn't work...

I don't receive any information, i don't understand why ??

All others graph work...
Attachments
cacti.JPG
cacti.JPG (3.92 KiB) Viewed 8805 times
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

Right installed, looks like its going to work, but a couple of questions:

1) The Filter value for Drive graphs - should this be c\: as you mentioned on page one, or C as you have in the filter fields
2) the Exchange graph: 'Exchange - Database Performance (WMI)' do you put the name of the Database you want to look at in here - e.g. Directors.edb, or does it follow the format SG1-Directors as used by Cigamits plugin?

Argon0
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests