Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


SQL Server 2000 Connections via WMI
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
DevilSun
Cacti User


Joined: 16 Jul 2004
Posts: 166
Location: Oregon

PostPosted: Mon Oct 18, 2004 11:16 am    Post subject: SQL Server 2000 Connections via WMI Reply with quote

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.



screen.gif
 Description:
Screenshot
 Filesize:  6.47 KB
 Viewed:  23279 Time(s)

screen.gif



cacti_graph_template_sql_connections.xml
 Description:
Graph template

Download
 Filename:  cacti_graph_template_sql_connections.xml
 Filesize:  4.04 KB
 Downloaded:  1927 Time(s)


w32_sql_query_connections.pl.txt
 Description:
Perl script

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

PostPosted: Thu Dec 30, 2004 3:18 pm    Post subject: Reply with quote

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

PostPosted: Tue Jan 04, 2005 3:02 pm    Post subject: Reply with quote

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

PostPosted: Tue Jan 04, 2005 5:50 pm    Post subject: Reply with quote

Here is the data template, it should be included in the graph template though so I dunno...


cacti_data_template_sql_connections.xml
 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

PostPosted: Tue Jan 04, 2005 5:57 pm    Post subject: Reply with quote

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...



sql_di.gif
 Description:
Data Input screenshot
 Filesize:  10.76 KB
 Viewed:  22902 Time(s)

sql_di.gif


Back to top
pshankland
Cacti User


Joined: 31 Dec 2004
Posts: 224
Location: UK

PostPosted: Wed Jan 05, 2005 4:11 am    Post subject: Reply with quote

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



WMI SQL - Data Input Methods.jpg
 Description:
Data Input Method Screen-Shot
 Filesize:  91.05 KB
 Viewed:  22878 Time(s)

WMI SQL - Data Input Methods.jpg



WMI SQL - Graph Template.jpg
 Description:
Graph Template Screen-Shot
 Filesize:  164.69 KB
 Viewed:  22878 Time(s)

WMI SQL - Graph Template.jpg


Back to top
DevilSun
Cacti User


Joined: 16 Jul 2004
Posts: 166
Location: Oregon

PostPosted: Wed Jan 05, 2005 4:21 pm    Post subject: Reply with quote

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

PostPosted: Thu Jan 06, 2005 9:09 am    Post subject: This only works if cacti is on windows -right? Reply with quote

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

PostPosted: Fri Jan 07, 2005 5:59 am    Post subject: Reply with quote

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

PostPosted: Mon Jan 10, 2005 7:58 pm    Post subject: Reply with quote

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

PostPosted: Tue Jan 11, 2005 5:16 am    Post subject: Reply with quote

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

PostPosted: Tue Jan 11, 2005 10:27 am    Post subject: Reply with quote

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

PostPosted: Tue Jan 11, 2005 4:24 pm    Post subject: Reply with quote

Riceman, check these links, they might help...
http://support.microsoft.com/default.aspx?scid=kb;en-us;827260
http://support.microsoft.com/default.aspx?scid=kb;en-us;820847
Back to top
Riceman



Joined: 14 Oct 2004
Posts: 21

PostPosted: Tue Jan 11, 2005 4:46 pm    Post subject: Reply with quote

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

PostPosted: Fri Aug 12, 2005 8:08 pm    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 



Powered by phpBB © 2001, 2005 phpBB Group