SQL Server 2005 Templates
Moderators: Developers, Moderators
-
- Posts: 5
- Joined: Fri Jun 11, 2010 10:33 am
SQL Server 2005 Templates
Hi!
Im running Cacti Version 0.8.7e under Red Hat Enterprise Linux Server release 5.4 (Tikanga).
Is there a Template to create graphics for SQL Server 2005?
I've read that Microsoft SQL Server 2005 doesnt have SNMP support anymore so i need to monitor it with WMI.
I've found only:
http://forums.cacti.net/about5225.html
http://forums.cacti.net/about5265.html
Is there something else? Cause it say there that those are for SQL Server 2000.
Thanks in advance.
Regards.
Im running Cacti Version 0.8.7e under Red Hat Enterprise Linux Server release 5.4 (Tikanga).
Is there a Template to create graphics for SQL Server 2005?
I've read that Microsoft SQL Server 2005 doesnt have SNMP support anymore so i need to monitor it with WMI.
I've found only:
http://forums.cacti.net/about5225.html
http://forums.cacti.net/about5265.html
Is there something else? Cause it say there that those are for SQL Server 2000.
Thanks in advance.
Regards.
-
- Posts: 23
- Joined: Wed May 26, 2010 9:13 pm
SQL Server graphs
I don't have a graph specifically for blocked processes, but it should be easy to modify my script to provide the right information, and then make the graph from there.
These graphs/data sources don't use WMI, but instead rely on the Script Server and PHP's mssql functions to connect directly to the SQL service and get the performance counters.
Since I don't use FQDNs as hostnames in my installation of Cacti, I connect to the IP and port of the SQL instance instead of hostname/instance name. The port is set to 1433 as the default, but it can be overwritten on a per-data source basis when you create the graph. I've also setup the script to have a hard-coded username/password, but like the port number, it can be overwritten on a per-graph basis.
The login that these graphs use can be either an SQL account, or an NT account with rights on the SQL server. Attached are a couple of SQL scripts (for the 2000, the other for 2005/2008) that will create an SQL login and grant the appropriate permissions to poll the performance counters.
The only other thing to note is that I'm using MemCache to speed up the polling process of the graphs for a given host. The first time the function runs, it fetches the data from the SQL server and stores it in the cache. Subsequent calls to the function will use the data in the cache if it exists. I'll admit that there's no 'lock' process to make sure that only 1 function call at a time polls the server, but I don't think it's needed. In any event, it should be easy to implement.
These graphs/data sources don't use WMI, but instead rely on the Script Server and PHP's mssql functions to connect directly to the SQL service and get the performance counters.
Since I don't use FQDNs as hostnames in my installation of Cacti, I connect to the IP and port of the SQL instance instead of hostname/instance name. The port is set to 1433 as the default, but it can be overwritten on a per-data source basis when you create the graph. I've also setup the script to have a hard-coded username/password, but like the port number, it can be overwritten on a per-graph basis.
The login that these graphs use can be either an SQL account, or an NT account with rights on the SQL server. Attached are a couple of SQL scripts (for the 2000, the other for 2005/2008) that will create an SQL login and grant the appropriate permissions to poll the performance counters.
The only other thing to note is that I'm using MemCache to speed up the polling process of the graphs for a given host. The first time the function runs, it fetches the data from the SQL server and stores it in the cache. Subsequent calls to the function will use the data in the cache if it exists. I'll admit that there's no 'lock' process to make sure that only 1 function call at a time polls the server, but I don't think it's needed. In any event, it should be easy to implement.
- Attachments
-
- cacti_host_template_windows_-_sql_server.xml
- Host Template for the SQL Server. Exported from Cacti 0.8.7e.
- (150.74 KiB) Downloaded 2355 times
-
- ss_win_mssql.txt
- Script Server script. Change the extension to 'php' and place in the scripts folder on your server.
CHANGE USERNAME AND PASSWORD - (6.26 KiB) Downloaded 2730 times
-
- sql_server_2000.txt
- SQL 2000 script to create a login and grant it the permissions needed for the graphs.
CHANGE USERNAME AND PASSWORD - (373 Bytes) Downloaded 1183 times
-
- sql_server_2005-2008.txt
- SQL 2005/2008 script to create a login and grant it the permissions needed for the graphs.
CHANGE USERNAME AND PASSWORD - (433 Bytes) Downloaded 2664 times
Examples of the graphs the templates create.
- Attachments
-
- Backup/Restore I/O
Buffer Cache
Connections - example_1.PNG (66.63 KiB) Viewed 27644 times
- Backup/Restore I/O
-
- Log Cache
Log Flushes
Log Flush I/O - example_2.PNG (69.67 KiB) Viewed 27644 times
- Log Cache
-
- Memory
Page I/O
Page Splits - example_3.PNG (71.23 KiB) Viewed 27644 times
- Memory
-
- Procedure Cache
SQL Compliations
Table Scans - example_4.PNG (79.38 KiB) Viewed 27644 times
- Procedure Cache
-
- Temporary Tables
Transactions - example_5.PNG (49.36 KiB) Viewed 27644 times
- Temporary Tables
-
- Posts: 23
- Joined: Wed May 26, 2010 9:13 pm
Re: SQL Server graphs
great job lints.huge thanks for making these scripts.lints wrote:I don't have a graph specifically for blocked processes, but it should be easy to modify my script to provide the right information, and then make the graph from there.
These graphs/data sources don't use WMI, but instead rely on the Script Server and PHP's mssql functions to connect directly to the SQL service and get the performance counters.
Since I don't use FQDNs as hostnames in my installation of Cacti, I connect to the IP and port of the SQL instance instead of hostname/instance name. The port is set to 1433 as the default, but it can be overwritten on a per-data source basis when you create the graph. I've also setup the script to have a hard-coded username/password, but like the port number, it can be overwritten on a per-graph basis.
The login that these graphs use can be either an SQL account, or an NT account with rights on the SQL server. Attached are a couple of SQL scripts (for the 2000, the other for 2005/2008) that will create an SQL login and grant the appropriate permissions to poll the performance counters.
The only other thing to note is that I'm using MemCache to speed up the polling process of the graphs for a given host. The first time the function runs, it fetches the data from the SQL server and stores it in the cache. Subsequent calls to the function will use the data in the cache if it exists. I'll admit that there's no 'lock' process to make sure that only 1 function call at a time polls the server, but I don't think it's needed. In any event, it should be easy to implement.
anyway,what "sql_server_2005-2008.txt" is for? is it a query that we must execute on ms sql server?
sorry for the stupid question.
-
- Posts: 23
- Joined: Wed May 26, 2010 9:13 pm
Re: SQL Server graphs
that is a txt file with SQL command used to create an USER which is GRANTED right to the performance counters.denyingthetruth wrote:
great job lints.huge thanks for making these scripts.
anyway,what "sql_server_2005-2008.txt" is for? is it a query that we must execute on ms sql server?
sorry for the stupid question.
You need to import or execute those commands into every SQL server you want to monitor
Well the first you could have figured out yourselfdenyingthetruth wrote:also which username and password to change?
maybe you can make the fonts bold on which parts to change.
sorry i'm really new on cacti.
{snipped from the 2005/2008 txt file}
CREATE LOGIN [cactistats] WITH PASSWORD=N'CHANGEME', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
The second one is on line 21 & 22 ine ss_win_mssql_104 txt file.
{[snippet from mentioned file}
$password = ($password == NULL ? 'graphit' : $password);
Don't forget to change the extention to .php as its run by the scriptserver.
If you get a chance, please post these to the templates area of the Docs site:
http://docs.cacti.net/templates
http://docs.cacti.net/templates.guidelines
http://docs.cacti.net/templates
http://docs.cacti.net/templates.guidelines
--
Live fast, die young
You're sucking up my bandwidth.
J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
Live fast, die young
You're sucking up my bandwidth.
J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
Well it seems my work here is done . Thanks dionvdc.dionvdc wrote:Well the first you could have figured out yourselfdenyingthetruth wrote:also which username and password to change?
maybe you can make the fonts bold on which parts to change.
sorry i'm really new on cacti.
{snipped from the 2005/2008 txt file}
CREATE LOGIN [cactistats] WITH PASSWORD=N'CHANGEME', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
The second one is on line 21 & 22 ine ss_win_mssql_104 txt file.
{[snippet from mentioned file}
$password = ($password == NULL ? 'graphit' : $password);
Don't forget to change the extention to .php as its run by the scriptserver.
Done and done: http://docs.cacti.net/usertemplate:host ... :sqlserverLinegod wrote:If you get a chance, please post these to the templates area of the Docs site:
http://docs.cacti.net/templates
http://docs.cacti.net/templates.guidelines
Last edited by lints on Fri Jun 18, 2010 10:28 am, edited 1 time in total.
No, I'm running CentOS 5.4 x64. Besides, it should be platform independent as it relies on the PHP extension and not anything platform specific.
On my system it was just a matter of running 'yum install php-mssql', so it might be the same on Ubuntu (but with apt-get install) instead.
Edit: I just did a quick Google search for some ideas, and it looks like the 'php5-sybase' package has what you need: http://packages.ubuntu.com/lucid/php5-sybase
On my system it was just a matter of running 'yum install php-mssql', so it might be the same on Ubuntu (but with apt-get install) instead.
Edit: I just did a quick Google search for some ideas, and it looks like the 'php5-sybase' package has what you need: http://packages.ubuntu.com/lucid/php5-sybase
Who is online
Users browsing this forum: No registered users and 3 guests