|
|
| Author |
Message |
DevilSun Cacti User
Joined: 16 Jul 2004 Posts: 166 Location: Oregon
|
Posted: Mon Oct 18, 2004 11:16 am Post subject: SQL Server 2000 Connections via WMI |
|
|
As the title says, SQL Server 2000 connections...
Usage: | Code: | | perl <path_cacti>/scripts/w32_sql_query_connections.pl <hostname> get UserConnections,LoginsPersec,LogoutsPersec |
*NOTE - I haven't found Logins/Logouts per sec to be very useful in my scenario so I am not graphing them.
Addendum - If you're using SQL 2000 on Windows 2000, you need to change the script class to "Win32_PerfRawData_MSSQLSERVER_SQLServerGeneralStatistics" to make it work. Thanks to chewy009 for this info.
| Description: |
|
| Filesize: |
6.47 KB |
| Viewed: |
23279 Time(s) |

|
| Description: |
|
 Download |
| Filename: |
cacti_graph_template_sql_connections.xml |
| Filesize: |
4.04 KB |
| Downloaded: |
1927 Time(s) |
| Description: |
|
 Download |
| Filename: |
w32_sql_query_connections.pl.txt |
| Filesize: |
5.17 KB |
| Downloaded: |
2209 Time(s) |
Last edited by DevilSun on Mon Nov 28, 2005 2:12 pm; edited 1 time in total |
|
| Back to top |
|
 |
JVandermark
Joined: 14 Dec 2004 Posts: 11
|
Posted: Thu Dec 30, 2004 3:18 pm Post subject: |
|
|
I imported this template into cacti and go the following:
[success] SQL - Connections [update]
+ Unmet Dependency: (Data Template Item)
+ Found Dependency: (GPRINT Preset) Normal
+ Unmet Dependency: (Data Template Item)
+ Found Dependency: (GPRINT Preset) Exact Numbers
+ Unmet Dependency: (Data Template Item)
+ Unmet Dependency: (Data Template Item)
Looking in the data input methods section, there is nothing for SQL- Connections. I'm going to try and figure it out, but if you get a chance can you look into it?
|
|
| Back to top |
|
 |
pshankland Cacti User
Joined: 31 Dec 2004 Posts: 224 Location: UK
|
Posted: Tue Jan 04, 2005 3:02 pm Post subject: |
|
|
Think me thick but I have managed to import the XML via 'Import Templates' and I have copied the *.pl files into <cacti_install>\scripts\*.*
My question is.... what do I have to do then??
Thanks.
|
|
| Back to top |
|
 |
DevilSun Cacti User
Joined: 16 Jul 2004 Posts: 166 Location: Oregon
|
Posted: Tue Jan 04, 2005 5:50 pm Post subject: |
|
|
Here is the data template, it should be included in the graph template though so I dunno...
| Description: |
| Data template for SQL connections... |
|
 Download |
| Filename: |
cacti_data_template_sql_connections.xml |
| Filesize: |
5.48 KB |
| Downloaded: |
1279 Time(s) |
|
|
| Back to top |
|
 |
DevilSun Cacti User
Joined: 16 Jul 2004 Posts: 166 Location: Oregon
|
Posted: Tue Jan 04, 2005 5:57 pm Post subject: |
|
|
| pshankland wrote: | Think me thick but I have managed to import the XML via 'Import Templates' and I have copied the *.pl files into <cacti_install>\scripts\*.*
My question is.... what do I have to do then??
Thanks. |
Go create a Data Input Method, of type "Script/Command", input string like
| Code: | | perl <path_cacti>/scripts/w32_sql_query_connections.pl <hostname> get UserConnections,LoginsPersec,LogoutsPersec |
and setup the fields as shown. You gotta match up the fields and what not...
| Description: |
|
| Filesize: |
10.76 KB |
| Viewed: |
22902 Time(s) |

|
|
|
| Back to top |
|
 |
pshankland Cacti User
Joined: 31 Dec 2004 Posts: 224 Location: UK
|
Posted: Wed Jan 05, 2005 4:11 am Post subject: |
|
|
Cheers for the reply. I have done what you have said but the graph never gets generated - I just get the red-cross thingy.
I have imported the Graph Template OK and I have then created a Data Input Method as per your instructions but still get no graph. Any suggestions??
Thanks.
| Code: | | perl <path_cacti>/scripts/w32_sql_query_connections.pl <hostname> get UserConnections,LoginsPersec,LogoutsPersec |
| Description: |
| Data Input Method Screen-Shot |
|
| Filesize: |
91.05 KB |
| Viewed: |
22878 Time(s) |

|
| Description: |
| Graph Template Screen-Shot |
|
| Filesize: |
164.69 KB |
| Viewed: |
22878 Time(s) |

|
|
|
| Back to top |
|
 |
DevilSun Cacti User
Joined: 16 Jul 2004 Posts: 166 Location: Oregon
|
Posted: Wed Jan 05, 2005 4:21 pm Post subject: |
|
|
I see the problem. This is that data source disconnect problem that happened to me a version or two ago, a lot of my templates got hosted in that nature, and I've rebuilt quite a few, but some don't want to be fixed.
Here's what I believe you need to do. Go edit the graph template. See where it says "(No task)" next to each graph item under the Data Source column? That means, that graph item is not associated with the data source. My suggestion would be to delete the existing Graph Item input data source, and then go to each graph item itself, and select the Data Source. The reason I say to delete the existing Graph Item Input data source ("Data Source [user_count]") is because as soon as you add it again to the graph item, it'll duplicate the existing one and you won't know which to delete. For each graph item, set the data source to "SQL - Connections - (user_count)". That should work unless there is something else going on.
|
|
| Back to top |
|
 |
pbulteel Cacti User
Joined: 05 Sep 2003 Posts: 150 Location: London
|
Posted: Thu Jan 06, 2005 9:09 am Post subject: This only works if cacti is on windows -right? |
|
|
I'd like to use this, but I'd be polling from a linux host...
Would that mean I'd install activeperl on the sql server and ....
Hmm... I might have to do something like what's mentioned in
http://forums.cacti.net/about4670.html
-P
|
|
| Back to top |
|
 |
Thomas Cacti User
Joined: 09 Dec 2004 Posts: 112 Location: Austria
|
Posted: Fri Jan 07, 2005 5:59 am Post subject: |
|
|
If you want to monitor Windows Servers using WMI from Unix/Linux please have a look at http://forums.cacti.net/viewtopic.php?t=5842.
I have summarized all possible ways (as far as I know them) to get WMI information from Unix/Linux.
|
|
| Back to top |
|
 |
Riceman
Joined: 14 Oct 2004 Posts: 21
|
Posted: Mon Jan 10, 2005 7:58 pm Post subject: |
|
|
I have a set of clustered MSSQL 2000 \ Win2k servers that both respond to WMI queries for cpu and mem etc, but when I query using this perl script I get this.
Any ideas?
Check the computer and class name.
No information was found on the specified class!
Thanks in advance,
Nick
|
|
| Back to top |
|
 |
pshankland Cacti User
Joined: 31 Dec 2004 Posts: 224 Location: UK
|
Posted: Tue Jan 11, 2005 5:16 am Post subject: |
|
|
I know this script is for WMI but just as a word of caution if you want to monitor Microsoft SQL Servers that are clustered using SNMP...... DON'T!! It seems that the Intel SNMP agent can cause a load of problems that you really don't want in a clustered environment!
http://support.microsoft.com/default.aspx?scid=kb;en-us;811876
Cheers.
Pete.
|
|
| Back to top |
|
 |
Riceman
Joined: 14 Oct 2004 Posts: 21
|
Posted: Tue Jan 11, 2005 10:27 am Post subject: |
|
|
Roger that, I am just running the windows SNMP service on these machines. Thanks for the heads up.
I was wondering if I need to install the mof files for SQL since my machines think they don't have this class needed for this application.
Thanks,
Nick
|
|
| Back to top |
|
 |
DevilSun Cacti User
Joined: 16 Jul 2004 Posts: 166 Location: Oregon
|
|
| Back to top |
|
 |
Riceman
Joined: 14 Oct 2004 Posts: 21
|
Posted: Tue Jan 11, 2005 4:46 pm Post subject: |
|
|
Thanks for the help bro. Looks like it might be my problem.
Thanks again,
Nick
|
|
| Back to top |
|
 |
Jvona
Joined: 27 May 2005 Posts: 3
|
Posted: Fri Aug 12, 2005 8:08 pm Post subject: |
|
|
Did you ever figure anything out with this, niether of these solutions helped, I even reinstalled sql making sure snmp was enabled before install.
When running the script I get the same error as Riceman. Any suggestions are much appreciated.
Thanks!
Jason
|
|
| Back to top |
|
 |
|