Monitor Windows via WMI from Cacti on Linux

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

Moderators: Developers, Moderators

Post Reply
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

Right, its not passing anything that isn't defined in the data template for some reason... Its working on other graphs..

Even those that are using the old templates....

Groan.. will try removing the single quotes...
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 »

Which template is that exactly? Can you check its data input method.

Make sure the script command its running is

Code: Select all

/usr/bin/php -q <your cacti scripts path>/wmi-svn.php -h '<host>' -u '<credential>' -w '<class>' -n '<namespace>' -k '<filter>' -v '<filterval>' -c '<columns>'
And then also double check the host/hostname input field has the "Special Type Code" set to hostname. From there check the data template itself to make sure its not got something funky set because it should be set to take its hostname from the host its attached to.

It would look like somewhere along those lines its broken, it could have been my template export but they look ok to my tired eyes (so I could have missed it...).

You need the single quotes in the script command so that you don't have to escape it in your data templates or anywhere else. E.g. no more having to escape : and spaces etc cause the single quotes in the script command take care of that.
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

OK, it works for new Graphs....

<groan>

Only 189 graphs to recreate!
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

claymen wrote:Which template is that exactly? Can you check its data input method.
Windows - CPU Usage - 4CPU (WMI)
claymen wrote: Make sure the script command its running is

Code: Select all

/usr/bin/php -q <your cacti scripts path>/wmi-svn.php -h '<host>' -u '<credential>' -w '<class>' -n '<namespace>' -k '<filter>' -v '<filterval>' -c '<columns>'
And then also double check the host/hostname input field has the "Special Type Code" set to hostname. From there check the data template itself to make sure its not got something funky set because it should be set to take its hostname from the host its attached to.
Yup its running that. Special Type set as expected.Nothing set in data template. And Hostname field, as long as its blank, takes its value from the host (its not set to "take value from hostname" by its tick box, but then neither are the others that are working.
claymen wrote: It would look like somewhere along those lines its broken, it could have been my template export but they look ok to my tired eyes (so I could have missed it...).

You need the single quotes in the script command so that you don't have to escape it in your data templates or anywhere else. E.g. no more having to escape : and spaces etc cause the single quotes in the script command take care of that.
Single quotes made no difference. When I recreated a graph on a host I know wmi works to, it works first time...

Strange....[/quote]
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
st3rling
Posts: 20
Joined: Thu Mar 16, 2006 12:17 pm

How to show multiple drives

Post by st3rling »

Hi,
Is there a way to show multiple hard drives from one server either on the same or separate graph? For example, using Available Disk Space template.
Thank you.
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

Yup, you just have to create the graph multiple times, with a different drive letter for each one - works very well, better than the snmp templates, IMHO.
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

OK, now this is odd....

And I don't know exactly what is happening here...

None of my WMI graphs were working...

These are the actions I have taken, which seem to have made a difference.

1) Duplicated the Data Source Templates.
2) set the new template to Inherit the Credentials
3) Changed Data Template for all my wmi disk i/o and available disk graphs to the duplicates, and then back again.
4) Left it (nothing happened)
5) Duplicated my Host Template taking out and re-adding the disk i/o and availability graphs
6) Changed my hosts to this new template.


And Availabe Disk, Disk i/o and CPU now work....
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 »

That's some trippy symptoms you are seeing... I have seen some weird stuff with disk i/o and available space on some of our cluster nodes which I couldn't explain :(
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

The Actions above seem to get all the graphs working. Except System Stats graphs...

Although I've yet to prove this, - in the process...

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

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

System Stats graphs seem to be a bit hit and miss.

most of my graphs are now working...

BUT...

Polling time has gone up from ~ 30 s to 55+ seconds - I've had to disable several hosts just to be able to complete polling within the allowable window....
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 »

How many hosts are you polling with WMI? e.g. how many WMI data sources do you have and additionally what sort of spec box are you using. We have about 400~ separate WMI data sources now on top of our other 14 thousand data sources (taken from poller cache) and still poll in about 30seconds each time.

Can you identify which ones are taking too long to run? Are you using IP's or hostnames for machiens as this can alter how it tries to authenticate (e.g. if you used a fqdn it will try kerberos but an IP it will go straight to NTLM) and some methods take longer or more so having to try and timeout takes longer...
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

now, about 45 hosts, ip address only.

trying to id the "slow" hosts, but no joy so far...

spec of server - its a Dell 620 workstation with 2 gb of ram - always been more than enough in the past. and doing the same graphs - using wmi, gave 25-30s polling time prior to the upgrade.

May well just disable all windows hosts and re enable one by one...
No longer a n00by, probably, by now an 0ldby

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
argon0
Cacti User
Posts: 460
Joined: Fri Mar 12, 2004 1:22 pm

Post by argon0 »

OK, I think I've identified the troublesome hosts, - all at another site, all SQL servers.

The disk Space graphs seem particularly troubling to them...

To Check - when specifying a disk what do you put:

C:
C\:
or just
C

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

Now Head of Technology at RSCH, back to the prickly subject of Monitorring....
User avatar
amccool
Posts: 17
Joined: Mon Apr 18, 2005 4:27 pm

Repair Issues

Post by amccool »

I found I needed to do some repair work to "older" servers.

on the server you want to pull data from do the following

1. run mofcomp

C:\Program Files\Microsoft SQL Server\90\Shared>mofcomp "c:\Program Files\Microsoft SQL Server\90\Shared\sqlmgmproviderxpsp2up.mof"
Microsoft (R) 32-bit MOF Compiler Version 5.2.3790.3959
Copyright (c) Microsoft Corp. 1997-2001. All rights reserved.
Parsing MOF file: c:\Program Files\Microsoft SQL Server\90\Shared\sqlmgmprovider
xpsp2up.mof
MOF file has been successfully parsed
Storing data in the repository...
Done!


2. run wmiadap /f (wow...great output here Microsoft)
This re-parses the performance counters into wmi counters

3. restart "Windows Management Instrumentation" service
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

argon0 wrote:OK, I think I've identified the troublesome hosts, - all at another site, all SQL servers.

The disk Space graphs seem particularly troubling to them...

To Check - when specifying a disk what do you put:

C:
C\:
or just
C

???
If you are using the new templates in 0.0.6 you can use either C: or C\:

Technically in the new version it should just be C: but I added a quick check to strip out the older C\: for backward compatibility.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest