Monitor Windows via WMI from Cacti on Linux

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

Moderators: Developers, Moderators

Post Reply
Thomas.Pacce
Posts: 23
Joined: Wed Apr 15, 2009 5:19 am
Location: Amsterdam

Post by Thomas.Pacce »

I am having issues with graph values i think.

My IIS graph is showing:

IIS Request Statistics - Get Requests per sec
Current 303,59m
Average 400,58m
Maximum 697,02m

But when i run from the command line:
GetRequestsPersec:62911
GetRequestsPersec:62996
...
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

That would be correct.

The graph is showing rate of change, the command line is showing you what the actual value is for the counter (perfmon counter) you are monitoring via WMI.

It means you number of get requests per second is less than 1. Keeping in mind cacti polls by default every 5 minutes so basically over the course of 5 minutes the number of get requests worked out as an average to lower than 1 per second.
Thomas.Pacce
Posts: 23
Joined: Wed Apr 15, 2009 5:19 am
Location: Amsterdam

Post by Thomas.Pacce »

Ok understood.

I have no graph for db performance, the rrd file is created but query doesnt succeed.

root@amsterdam-sm09:~# /usr/bin/wmic --namespace='root\CIMV2' --authentication-file=/usr/share/cacti/site/scripts/cactiwmi.pw //amsterdam-ms01 "SELECT ActiveClientLogons,MessagesDelivered,MessagesSent,MessagesSubmitted,ReceiveQueueSize,SendQueueSize,TotalCountofRecoverableItems,TotalSizeofRecoverableItems FROM Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox WHERE Name="
ERROR: Retrieve result data.
NTSTATUS: NT code 0xc0041017 - NT code 0xc0041017
root@amsterdam-sm09:~# /usr/bin/php -q /usr/share/cacti/site/scripts/wmi.php -h 'amsterdam-ms01' -u '/usr/share/cacti/site/scripts/cactiwmi.pw' -w 'Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox' -n '' -k 'Name' -v '' -c 'ActiveClientLogons,MessagesDelivered,MessagesSent,MessagesSubmitted,ReceiveQueueSize,SendQueueSize,TotalCountofRecoverableItems,TotalSizeofRecoverableItems'
NTSTATUS: NT code 0xc0041017 - NT code 0xc0041017


Return code non-zero, debug mode enabled!



/usr/bin/wmic --namespace='root\CIMV2' --authentication-file=/usr/share/cacti/site/scripts/cactiwmi.pw //amsterdam-ms01 "SELECT ActiveClientLogons,MessagesDelivered,MessagesSent,MessagesSubmitted,ReceiveQueueSize,SendQueueSize,TotalCountofRecoverableItems,TotalSizeofRecoverableItems FROM Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox WHERE Name="
Exec Status: 1

root@amsterdam-sm09:~# /usr/bin/wmic --namespace='root\CIMV2' --authentication-file=/usr/share/cacti/site/scripts/cactiwmi.pw //amsterdam-ms01 "SELECT ActiveClientLogons,MessagesDelivered,MessagesSent,MessagesSubmitted,ReceiveQueueSize,SendQueueSize,TotalCountofRecoverableItems,TotalSizeofRecoverableItems FROM Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox WHERE Name="
ERROR: Retrieve result data.
NTSTATUS: NT code 0xc0041017 - NT code 0xc0041017
root@amsterdam-sm09:~#
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

Does the class exist if you run scriptomatic2 on the box itself? Exchange and SQL are notorious for not registering the WMI classes properly. This is where wmiadap /f comes into plan. There are further details earlier in the thread about this.
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

Final release of 0.0.6

Been using this at work for over a month without issue.

Please see original post for updated versions.
Thomas.Pacce
Posts: 23
Joined: Wed Apr 15, 2009 5:19 am
Location: Amsterdam

Post by Thomas.Pacce »

claymen wrote:Does the class exist if you run scriptomatic2 on the box itself? Exchange and SQL are notorious for not registering the WMI classes properly. This is where wmiadap /f comes into plan. There are further details earlier in the thread about this.
I can retrieve succesfully the values from scriptomatic so the classes are ok.
ActiveClientLogons: 60
AverageDeliveryTime: 2318
Caption:
CategorizationCount: 112
ClientLogons: 152
...
..
.

Permissions are ok, i use an admin account.
The query looks odd though:
root@amsterdam-sm09:~# /usr/bin/php -q /usr/share/cacti/site/scripts/wmi.php -h 'amsterdam-ms01' -u '/usr/share/cacti/site/scripts/cactiwmi.pw' -w 'Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox' -n '' -k 'Name' -v '' -c 'ActiveClientLogons,MessagesDelivered,MessagesSent,MessagesSubmitted,ReceiveQueueSize,SendQueueSize,TotalCountofRecoverableItems,TotalSizeofRecoverableItems'
NTSTATUS: NT code 0xc0041017 - NT code 0xc0041017


Return code non-zero, debug mode enabled!



/usr/bin/wmic --namespace='root\CIMV2' --authentication-file=/usr/share/cacti/site/scripts/cactiwmi.pw //amsterdam-ms01 "SELECT ActiveClientLogons,MessagesDelivered,MessagesSent,MessagesSubmitted,ReceiveQueueSize,SendQueueSize,TotalCountofRecoverableItems,TotalSizeofRecoverableItems FROM Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox WHERE Name="Exec Status: 1
Name= Isnt it missing something?
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

You need a filter value mate.

Apologies for missing it ealier.

Code: Select all

root@amsterdam-sm09:~# /usr/bin/php -q /usr/share/cacti/site/scripts/wmi.php -h 'amsterdam-ms01' -u '/usr/share/cacti/site/scripts/cactiwmi.pw' -w 'Win32_PerfRawData_MSExchangeIS_MSExchangeISMailbox' -n '' -k 'Name' -v '' -c 'ActiveClientLogons,MessagesDelivered,MessagesSent,MessagesSubmitted,ReceiveQueueSize,SendQueueSize,TotalCountofRecoverableItems,TotalSizeofRecoverableItems'
NTSTATUS: NT code 0xc0041017 - NT code 0xc0041017
I'm guessing you didn't enter in a filter value on your datasource in cacti? E.g. you specified -k but didn't specify anything to search on.
Thomas.Pacce
Posts: 23
Joined: Wed Apr 15, 2009 5:19 am
Location: Amsterdam

Post by Thomas.Pacce »

Cool!
I found the correct value Name for the mailboxes using Scriptomatic.

So what would happen if i would not use the -k switch, no filter would mean i would get stats for all the Information store in one graph?

Thanks again.
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

Thomas.Pacce wrote:Cool!
I found the correct value Name for the mailboxes using Scriptomatic.

So what would happen if i would not use the -k switch, no filter would mean i would get stats for all the Information store in one graph?

Thanks again.
No in that case it would fail because the script is expecting a filter value to be passed. E.g. you passed half the equation. You've told it to filter on Name but not what Name is equal to, to find the match.
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

The filter could be _Total though (IIRC) which should pass total traffic back...
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 »

True but a value for the filter is still required :)
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

It seems as if my remote site issues were actually caused by the remote Servers Network port being exceedingly busy all the time.

They are SQL servers communicating with Web Servers through a fire wall, which only has 100MB/s ports so running at 60-70% utilisation most of the time... The wmi requests got lost amongst the noise.

Switch the monitoring IP to another NIC on same servers, get good results...

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

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
kosta
Posts: 18
Joined: Fri May 06, 2005 12:55 pm

Post by kosta »

Is the graph template out for an 8 core machine yet?

Also, I have been getting these errors since I setup these templates. Some WMI queries work (4 core processors, SQL, memory, context switches, etc, but I get these errors on below templates:

04/20/2009 12:35:14 PM - SPINE: Poller[0] Host[76] ERROR: Empty result [10.x.x.x]: '/usr/local/bin/php -q /var/www/sites/cacti.4rnd.com/branches/cacti-8-7d/scripts/wmi.php 10.X.X.X credential Win32_PerfRawData_PerfProc_Process ThreadCount,HandleCount,PrivateBytes,VirtualBytes,PageFileBytes,PercentPrivilegedTime,PercentProcessorTime,PercentUserTime Name '
04/20/2009 12:35:13 PM - SPINE: Poller[0] Host[76] ERROR: Empty result [10.x.x.x]: '/usr/local/bin/php -q /var/www/sites/cacti.4rnd.com/branches/cacti-8-7d/scripts/wmi.php 10.X.X.X credential Win32_PerfRawData_PerfProc_Process ThreadCount,HandleCount,PrivateBytes,VirtualBytes,PageFileBytes,PercentPrivilegedTime,PercentProcessorTime,PercentUserTime Name '
04/20/2009 12:35:12 PM - SPINE: Poller[0] Host[76] ERROR: Empty result [10.x.x.x]: '/usr/local/bin/php -q /var/www/sites/cacti.4rnd.com/branches/cacti-8-7d/scripts/wmi.php 10.X.X.X credential Win32_PerfRawData_PerfDisk_LogicalDisk DiskWritesPersec,DiskWriteBytesPersec,DiskReadsPersec,DiskReadBytesPersec,CurrentDiskQueueLength Name C'
04/20/2009 12:35:11 PM - SPINE: Poller[0] Host[76] ERROR: Empty result [10.x.x.x]: '/usr/local/bin/php -q /var/www/sites/cacti.4rnd.com/branches/cacti-8-7d/scripts/wmi.php 10.X.X.X credential Win32_LogicalDisk Size,FreeSpace DeviceID C'

Anyone have an idea why?


kosta
st3rling
Posts: 20
Joined: Thu Mar 16, 2006 12:17 pm

WMIC

Post by st3rling »

Hello Claymen,
Would you be so kind to upload or give link to the compiled version of wmic that works with 0.0.6? I tried to compile it myself but failed since I'm very new to linux. I still can't run 4 and 8 CPU templates. Running CentOS (Linux 2.6.9-78.0.13.plus.c4smp)
Thank you!
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

I'll post my working one (for Centos) when I can get to my work PC. If that helps.
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 4 guests