SQL Server 2000 Connections via WMI

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

Moderators: Developers, Moderators

chewy009
Posts: 38
Joined: Wed Jun 15, 2005 1:18 pm
Location: Washington State, USA

Post by chewy009 »

I am trying to get this to work on a W2k/SQL2k box but am getting the following error when I run the script from the CMD line:

Check the computer and class name.
No information was found on the specified class!

The cacti log says this:

10/11/2005 10:09:56 AM - CACTID: Poller[0] Host[59] DS[554] SCRIPT: perl D:\Apache2\htdocs\cacti/scripts/w32_sql_query_connections.pl SQLServer get UserConnections,LoginsPersec,LogoutsPersec, output: U
10/11/2005 10:09:56 AM - CACTID: Poller[0] Host[59] DS[554] WARNING: Result from SCRIPT not valid. Partial Result: ...

I ran winmgmt /resyncperf from the cmd line as well with no luck.

Any help would be appreciated.
chewy009
Posts: 38
Joined: Wed Jun 15, 2005 1:18 pm
Location: Washington State, USA

Post by chewy009 »

Anyone have any ideas on my previous post? Still being dogged by the boss on this. :evil:

Thanks in advance for any help!!! :D

Posted: Tue Oct 11, 2005 12:12 pm Post subject:

--------------------------------------------------------------------------------

I am trying to get this to work on a W2k/SQL2k box but am getting the following error when I run the script from the CMD line:

Check the computer and class name.
No information was found on the specified class!

The cacti log says this:

10/11/2005 10:09:56 AM - CACTID: Poller[0] Host[59] DS[554] SCRIPT: perl D:\Apache2\htdocs\cacti/scripts/w32_sql_query_connections.pl SQLServer get UserConnections,LoginsPersec,LogoutsPersec, output: U
10/11/2005 10:09:56 AM - CACTID: Poller[0] Host[59] DS[554] WARNING: Result from SCRIPT not valid. Partial Result: ...

I ran winmgmt /resyncperf from the cmd line as well with no luck.

Any help would be appreciated.
DevilSun
Cacti User
Posts: 166
Joined: Fri Jul 16, 2004 1:59 pm
Location: Oregon

Post by DevilSun »

Turn output on to "DEBUG" for once cycle, and post what the actual response is.

"Partial Response:..." doesn't help much...

Or, even better, run the query from the command line
quastr
Posts: 1
Joined: Tue Dec 07, 2004 11:36 am

Post by quastr »

He did say he was running it from command line
but am getting the following error when I run the script from the CMD line:

Check the computer and class name.
No information was found on the specified class!
I am also getting this error. Does anything else need to be installed on the mssql box?
DevilSun
Cacti User
Posts: 166
Joined: Fri Jul 16, 2004 1:59 pm
Location: Oregon

Post by DevilSun »

Well, if you're sure WMI is up and running and it's not firewall or permissions related, I'd suggest using Microsoft's WMI Tools (Link) to browse to the computer and browse through the classes to see if it's there on your box. Also, don't forget about "wmiadap /f" to force WMI to update itself.
chewy009
Posts: 38
Joined: Wed Jun 15, 2005 1:18 pm
Location: Washington State, USA

Post by chewy009 »

I've downloaded the WMI Tool but can't seem to find what I am looking for. Does anyone know what the instance is and where to find it. I am new to WMI. Thanks.
DevilSun
Cacti User
Posts: 166
Joined: Fri Jul 16, 2004 1:59 pm
Location: Oregon

Post by DevilSun »

Use the WMI Object Browser. When it opens and says "Connect to namespace:", click the Icon next to the drop down list to browse for a namespace. Change the machine name to the remote machine, and click Connect, open "root" and highlight "CIMV2" and press "OK". When you do that successfully, it'll connect to "\\<remotemachine>\root\CIMV2". Now click the binocular button to find a class -- you'll get a TON of classes returned -- you're looking for a class called "Win32_PerfFormattedData_MSSQLSERVER_SQLServerGeneralStatistics", the problem however is the box list isn't wide enough to see the full classes...but you should have quite a few that start with "Win32_PerfFormattedData_MSSQLSERVER...", if you have none, the SQL WMI classes didn't get registered or something, and you probably need to run "wmiadap /f" to fix it.
chewy009
Posts: 38
Joined: Wed Jun 15, 2005 1:18 pm
Location: Washington State, USA

Post by chewy009 »

OK, so i got it working. I am assuming DevilSun ( :evil: ) :D that you are running SQL 2000 on Wk3 server. I am running SQL2000 on W2k server, which has a different class. Modified the class in the script to be "Win32_PerfRawData_MSSQLSERVER_SQLServerGeneralStatistics" and it started working right away.

Thanks again for your help! :P
cactus_jack
Posts: 29
Joined: Mon Apr 11, 2005 9:31 am

Post by cactus_jack »

Hello,

I am getting the following results from my install, I am using cacti on Redhat to monitor a windows server.

Code: Select all

11/14/2005 01:25:21 PM - CMDPHP: Poller[0] Host[21] DS[920] CMD: perl /var/www/cacti/scripts/nt_perfmon.pl uhdadw09.uhd.campus "\\SQLServer:General Statistics\User Connections", output: U  
11/14/2005 01:25:21 PM - CMDPHP: Poller[0] Host[21] DS[920] WARNING: Result from CMD not valid. Partial Result:  
If anyone could shed some light as to what i need to do that would be greatly appreciated.

Vince
jengstro
Cacti User
Posts: 156
Joined: Tue Nov 15, 2005 12:14 pm

Post by jengstro »

Any time I hit the binocular button the thing locks up... any ideas?
[size=75]Cacti - 0.8.6h + patches
PHP - 5.1.2
ZendOptimizer - 2.6.2
FastCGI - 0.6
MySQL - 4.1.15
Cactid - 0.8.6g
rrdtool - 1.2.x
IIS6[/size]
jengstro
Cacti User
Posts: 156
Joined: Tue Nov 15, 2005 12:14 pm

Post by jengstro »

Ok... after a few trys... it came up and there are around 15 or so mssql items there. But when I run the script from a command line as the user used above, it cannot pull the information. :(

It complains that it cant talk to the WMI server.

I should also mention that I can pull processor data via WMI...
[size=75]Cacti - 0.8.6h + patches
PHP - 5.1.2
ZendOptimizer - 2.6.2
FastCGI - 0.6
MySQL - 4.1.15
Cactid - 0.8.6g
rrdtool - 1.2.x
IIS6[/size]
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

If your running the cacti scheduled task with the SYSTEM user account, this would be the cause of the problem. You need to use a real user account or specify a username/password in your WMI script(s).
jengstro
Cacti User
Posts: 156
Joined: Tue Nov 15, 2005 12:14 pm

Post by jengstro »

I am using a domain created account that has been added to the local adminisrators group on the server and client machines.
[size=75]Cacti - 0.8.6h + patches
PHP - 5.1.2
ZendOptimizer - 2.6.2
FastCGI - 0.6
MySQL - 4.1.15
Cactid - 0.8.6g
rrdtool - 1.2.x
IIS6[/size]
jengstro
Cacti User
Posts: 156
Joined: Tue Nov 15, 2005 12:14 pm

Post by jengstro »

This user does not require any access to the SQL database itself I would assume?
[size=75]Cacti - 0.8.6h + patches
PHP - 5.1.2
ZendOptimizer - 2.6.2
FastCGI - 0.6
MySQL - 4.1.15
Cactid - 0.8.6g
rrdtool - 1.2.x
IIS6[/size]
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

I haven't looked at the script, but I doubt not since this is being done via WMI.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests