Monitor Windows via WMI from Cacti on Linux

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

Moderators: Developers, Moderators

Post Reply
hapklaar
Posts: 38
Joined: Tue May 31, 2005 10:06 am

Post by hapklaar »

claymen wrote:The most stable is the latest version. Without it you can't do some of the graphs and it also means less hassle with escaping input.

0.0.6 is the latest "stable" version, not sure why you would have problems with it unless your templates were not setup properly or you were migrating from an older version without taking into account a few of the changes.
The included templates in the 0.0.6 package work like a charm on 0.8.7b, which is absolutely great. Only the EVA templates from http://forums.cacti.net/about29895.html don't seem to work on 0.0.6. Could be because I've converted the templates from 0017 to 0016 (0.8.7c to 0.8.7b) though. If someone has adapted these templates or can create EVA performance templates to work for cacti-wmi 0.0.6 and cacti 0.8.7b please let us know.

It would be so cool to be able to have an option to select the EVA, disk group and stats to graph.

Would make this myself, but wouldn't know where to start...
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Post by stormonts »

I need some help getting this configured to read some SQL data. If I run the command:

Code: Select all

/usr/bin/php -q /usr/local/cacti-0.8.7b/scripts/wmi.php -h 'hawk.omni.imsweb.com' -u '/etc/cacti/cactiwmi.pw' -w 'Win32_PerfRawData_MSSQLENTVAULT_MSSQLENTVAULTDatabk '' -v '' -c 'DataFilesSizeKB,LogFilesSizeKB,LogFilesUsedSizeKB' -d1
I get:

Code: Select all

/usr/local/bin/wmic --namespace='root\CIMV2' --authentication-file=/etc/cacti/cactiwmi.pw //hawk.omni.imsweb.com "SELECT DataFilesSizeKB,LogFilesSizeKB,LogFilesUsedSizeKB FROM Win32_PerfRawData_MSSQLENTVAULT_MSSQLENTVAULTDatabases"
Exec Status: 0

DataFilesSizeKB0:3264
LogFilesSizeKB0:1784
LogFilesUsedSizeKB0:598
Name0:ReportServer$EntVaultTempDB
DataFilesSizeKB1:847616
LogFilesSizeKB1:30528
LogFilesUsedSizeKB1:3854
Name1:EVIMSVaultStore
DataFilesSizeKB2:600512
LogFilesSizeKB2:92344
LogFilesUsedSizeKB2:6495
Name2:EnterpriseVaultAudit
DataFilesSizeKB3:464320
LogFilesSizeKB3:69752
LogFilesUsedSizeKB3:8516
Name3:MSDB
DataFilesSizeKB4:136192
LogFilesSizeKB4:145272
LogFilesUsedSizeKB4:137978
Name4:EVVSGIMSVaultStoreGroup_1_1
DataFilesSizeKB5:8384
LogFilesSizeKB5:10168
LogFilesUsedSizeKB5:2661
Name5:ReportServer$EntVault
DataFilesSizeKB6:37824
LogFilesSizeKB6:82744
LogFilesUsedSizeKB6:9909
Name6:EnterpriseVaultDirectory
DataFilesSizeKB7:102400
LogFilesSizeKB7:198264
LogFilesUsedSizeKB7:10882
Name7:EnterpriseVaultMonitoring
DataFilesSizeKB8:19456
LogFilesSizeKB8:2040
LogFilesUsedSizeKB8:929
Name8:tempdb
DataFilesSizeKB9:1216
LogFilesSizeKB9:18232
LogFilesUsedSizeKB9:4148
Name9:MODEL
DataFilesSizeKB10:39360
LogFilesSizeKB10:504
LogFilesUsedSizeKB10:280
Name10:mssqlsystemresource
DataFilesSizeKB11:2264640
LogFilesSizeKB11:663976
LogFilesUsedSizeKB11:189278
Name11:_Total
DataFilesSizeKB12:4096
LogFilesSizeKB12:12344
LogFilesUsedSizeKB12:3028
Name12:master
How do I modify that command (via namespace, filter, filter value) so that it only returns DataFilesSizeKB1, LogFilesSizeKB1, and LogFilesUsedSizeKB1 for graphing?
hapklaar
Posts: 38
Joined: Tue May 31, 2005 10:06 am

Post by hapklaar »

stormonts wrote:
How do I modify that command (via namespace, filter, filter value) so that it only returns DataFilesSizeKB1, LogFilesSizeKB1, and LogFilesUsedSizeKB1 for graphing?
I believe you can use the -k option to specify the variable you want to select on and with -v the contents of that variable like this:

Code: Select all

/usr/bin/php -q /usr/local/cacti-0.8.7b/scripts/wmi.php -h 'hawk.omni.imsweb.com' -u '/etc/cacti/cactiwmi.pw' -w 'Win32_PerfRawData_MSSQLENTVAULT_MSSQLENTVAULTDatabk '' -k 'name' -v 'ReportServer$EntVaultTempDB' -c 'DataFilesSizeKB,LogFilesSizeKB,LogFilesUsedSizeKB' -d1
If that doesn't work for you, you should be able to extract your syntax from this working example:

Code: Select all

/usr/bin/php -q /usr/share/cacti/site/scripts/wmi.php -h 'andpm01' -u '/etc/cacti/auth.txt' -w 'Win32_PerfFormattedData_EVAPMEXT_HPEVAPhysicalDiskGroup' -n '' -k 'Name' -v 'ANEVA101 - DiskGroup 1' -c 'ReadLatencyus,WriteLatencyus'
Gives:
Name:ANEVA101_-_DiskGroup_1 ReadLatencyus:10743 WriteLatencyus:23023
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

You are correct, by not specifying which actual value you are filtering for it simply returns everything. Which can work it just means your data input method is going to be gigantic. However this can also be useful in a couple of cases ;)

Code: Select all

Usage:
       -h <hostname>         Hostname of the server to query.
       -u <credential path>  Path to the credential file. See format below.
       -n <namespace>        What namespace to use. (optional, defaults to root\CIMV2)
       -w <wmi class>        WMI Class to be used.
       -c <columns>          What columns to select. (optional, defaults to *)
       -k <filter key>       What key to filter on. (optional, default is no filter)
       -v <filter value>     What value for the key. (required, only when using filter key)
       -d <debug level>      Debug level. (optional, default is none, levels are 1 & 2)

                             All special characters and spaces must be escaped or enclosed in single quotes!
Ideally you would structure your data input and data template such that you specify the DB name and it returns only the DataFilesSizeKB,LogFilesSizeKB,LogFilesUsedSizeKB for that one database. That way your data input method will always see the same set of values and you can then simply bang the template onto your host and add each DB as a data source. You could also go the step further and allow the actual class to be specified per data source (with a default set of course) so that your template can be reused on other hosts where the namespace is different ;)
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Post by stormonts »

Another related question is regarding the SQL graph.

We are running MSSQL 2005 on a 64 bit Windows server. The template is trying to use this:

Code: Select all

/usr/bin/php -q /usr/local/cacti-0.8.7b/scripts/wmi.php -h 'rock.omni.imsweb.com' -u '/etc/cacti/cactiwmi.pw' -w 'Win32_PerfRawData_MSSQLSERVER_SQLServerTransactions' -n '' -k '' -v '' -c 'Transactions' 
The problem is, Scriptomatic doesn't find a Win32_PerfRawData_MSSQLSERVER... class on the server. I tried to run wmiadap /f and then rebooted the server, but it didn't fix it.
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

stormonts wrote:Another related question is regarding the SQL graph.

We are running MSSQL 2005 on a 64 bit Windows server. The template is trying to use this:

Code: Select all

/usr/bin/php -q /usr/local/cacti-0.8.7b/scripts/wmi.php -h 'rock.omni.imsweb.com' -u '/etc/cacti/cactiwmi.pw' -w 'Win32_PerfRawData_MSSQLSERVER_SQLServerTransactions' -n '' -k '' -v '' -c 'Transactions' 
The problem is, Scriptomatic doesn't find a Win32_PerfRawData_MSSQLSERVER... class on the server. I tried to run wmiadap /f and then rebooted the server, but it didn't fix it.
Does Scriptomatic find any SQL classes? They can use a different name if using named instances. Or just different installs etc.
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Post by stormonts »

It finds a number of SQL classes for each instance. I wanted the SQL performance graph to show the total performance across all instances and not just on a instance by instance basis.
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

stormonts wrote:It finds a number of SQL classes for each instance. I wanted the SQL performance graph to show the total performance across all instances and not just on a instance by instance basis.
Is that even possible in perfmon? If not then I doubt WMI can do it as its calling the same data.
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Post by stormonts »

claymen wrote:
stormonts wrote:It finds a number of SQL classes for each instance. I wanted the SQL performance graph to show the total performance across all instances and not just on a instance by instance basis.
Is that even possible in perfmon? If not then I doubt WMI can do it as its calling the same data.
Was the template/graph written assuming people would only have 1 default instance?
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

stormonts wrote:
claymen wrote:
stormonts wrote:It finds a number of SQL classes for each instance. I wanted the SQL performance graph to show the total performance across all instances and not just on a instance by instance basis.
Is that even possible in perfmon? If not then I doubt WMI can do it as its calling the same data.
Was the template/graph written assuming people would only have 1 default instance?
Sort of, we only really had one instance per server. So for us its not too much of an issue, but to support extra instances you just need to tick the box to make the class user adjustable. Then when you add it to hosts you can edit the class if its a different instance.
renrom
Posts: 6
Joined: Tue May 12, 2009 12:31 pm

Post by renrom »

I (still) have the same issue with SQL. Could it be windows 64bit related?. my difference is that we use SQL2008.

Perfmon is showing the counter, but wmi doesnt.
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

No idea mate it shouldn't make any difference. We use SQL 2008 64bit and it works fine, I would say something is broken to do with the WMI classes not being registered correctly.
renrom
Posts: 6
Joined: Tue May 12, 2009 12:31 pm

Post by renrom »

Probebly this wil help.

The SQL 2008 servers arent patched yet. and i did stumble across this KB:

Maybe its also some help for others:

http://support.microsoft.com/kb/969653
stormonts
Cacti User
Posts: 349
Joined: Tue Mar 31, 2009 10:05 am

Post by stormonts »

Why the (m) after some of the numbers in the CPU graphs?
Attachments
Untitled.jpg
Untitled.jpg (45.16 KiB) Viewed 4679 times
Igloo
Posts: 22
Joined: Fri Dec 01, 2006 8:24 am

Post by Igloo »

Has anyone got a graph for network usage?

That'd be fantastic :D
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests