Cacti 監控 SQL Server
模板下載:
(1)可以直接下載本站發布的 Cnyunwei-Cacti+Nagios 集成全自動安裝ISO進行安裝,已集成此模板及更多的使用插件模板
(2)可以直接去官方論壇下載最新的模板 http://forums.cacti.net/viewtopic.php?f=12&t=38135
php-mssql配置:
cacti的機器上必須有php-mssql驅動
php -m | grep mssql 查看是否有mssql,如沒有安裝的話,直接yum安裝即可
yum install php-mssql -y
Cacti配置:
1、導入增加ms sql監控模板 Console – Import Templates \ 瀏覽 選擇
cacti_host_template_windows_-_sql_server.xml save
導入后graph templates包含:
Windows - SQL Server - Backup/Restore I/O
Windows - SQL Server - Buffer Cache
Windows - SQL Server - Connections
Windows - SQL Server - Log Cache
Windows - SQL Server - Log Flush I/O
Windows - SQL Server - Log Flushes
Windows - SQL Server - Memory
Windows - SQL Server - Page I/O
Windows - SQL Server - Page Splits
Windows - SQL Server - Procedure Cache
Windows - SQL Server - Processes Blocked
Windows - SQL Server - SQL Compilations
Windows - SQL Server - Table Scans
Windows - SQL Server - Temp Tables
Windows - SQL Server - Transactions
2、上傳ss_win_mssql.php到 cacti目錄下的scripts目錄里,并賦予權限
3、sqlserver 執行語句 給予監控權限,還有防護墻要給予1433端口對應的ip訪問權限
USE master
CREATE LOGIN cactistats WITH PASSWORD=N'www.cnyunwei.com', DEFAULT_DATABASE= master,DEFAULT_LANGUAGE=us_english, CHECK_EXPIRATION=OFF,CHECK_POLICY=OFF
EXEC sys.sp_addsrvrolemember @loginame = N'cactistats', @rolename = N'processadmin'
CREATE USER cactistats FOR LOGIN cactistats WITH DEFAULT_SCHEMA=dbo
GRANT SELECT ON sys.dm_os_performance_counters TO cactistats
4、在要監控的MS SQL服務器上,創建相應的用戶,注意密碼設置后,修改ss_win_mssql.php里的密碼與之對應
function ss_win_mssql ($hostname, $cmd, $username = NULL, $password = NULL) {
list($host, $port) = explode(':', $hostname);
$port = ($port == '' ? '1433' : $port);
$username = ($username == NULL ? ' cactistats' : $username);
$password = ($password == NULL ? ' www.cnyunwei.com' : $password);
5、在添加監控設備時,Host Template 選擇 ”Windows – SQL Server”
腳本測試:
/usr/bin/php -q /var/www/html/scripts/ss_win_mssql.php 122.xxx.xxx.xxx scans cactistats www.cnyunwei.com
fullscans:114947 rangescans:4428184 probescans:4228710 indexsearches:8975892
php /usr/local/cacti/scripts/ss_win_mssql.php 122.xxx.xxx.xxx connections
userconnections:10
部分監控圖片展示:
來自群組: 北京運維圈
(1)可以直接下載本站發布的 Cnyunwei-Cacti+Nagios 集成全自動安裝ISO進行安裝,已集成此模板及更多的使用插件模板
(2)可以直接去官方論壇下載最新的模板 http://forums.cacti.net/viewtopic.php?f=12&t=38135
php-mssql配置:
cacti的機器上必須有php-mssql驅動
php -m | grep mssql 查看是否有mssql,如沒有安裝的話,直接yum安裝即可
yum install php-mssql -y
Cacti配置:
1、導入增加ms sql監控模板 Console – Import Templates \ 瀏覽 選擇
cacti_host_template_windows_-_sql_server.xml save
導入后graph templates包含:
Windows - SQL Server - Backup/Restore I/O
Windows - SQL Server - Buffer Cache
Windows - SQL Server - Connections
Windows - SQL Server - Log Cache
Windows - SQL Server - Log Flush I/O
Windows - SQL Server - Log Flushes
Windows - SQL Server - Memory
Windows - SQL Server - Page I/O
Windows - SQL Server - Page Splits
Windows - SQL Server - Procedure Cache
Windows - SQL Server - Processes Blocked
Windows - SQL Server - SQL Compilations
Windows - SQL Server - Table Scans
Windows - SQL Server - Temp Tables
Windows - SQL Server - Transactions
2、上傳ss_win_mssql.php到 cacti目錄下的scripts目錄里,并賦予權限
3、sqlserver 執行語句 給予監控權限,還有防護墻要給予1433端口對應的ip訪問權限
USE master
CREATE LOGIN cactistats WITH PASSWORD=N'www.cnyunwei.com', DEFAULT_DATABASE= master,DEFAULT_LANGUAGE=us_english, CHECK_EXPIRATION=OFF,CHECK_POLICY=OFF
EXEC sys.sp_addsrvrolemember @loginame = N'cactistats', @rolename = N'processadmin'
CREATE USER cactistats FOR LOGIN cactistats WITH DEFAULT_SCHEMA=dbo
GRANT SELECT ON sys.dm_os_performance_counters TO cactistats
4、在要監控的MS SQL服務器上,創建相應的用戶,注意密碼設置后,修改ss_win_mssql.php里的密碼與之對應
function ss_win_mssql ($hostname, $cmd, $username = NULL, $password = NULL) {
list($host, $port) = explode(':', $hostname);
$port = ($port == '' ? '1433' : $port);
$username = ($username == NULL ? ' cactistats' : $username);
$password = ($password == NULL ? ' www.cnyunwei.com' : $password);
5、在添加監控設備時,Host Template 選擇 ”Windows – SQL Server”
腳本測試:
/usr/bin/php -q /var/www/html/scripts/ss_win_mssql.php 122.xxx.xxx.xxx scans cactistats www.cnyunwei.com
fullscans:114947 rangescans:4428184 probescans:4228710 indexsearches:8975892
php /usr/local/cacti/scripts/ss_win_mssql.php 122.xxx.xxx.xxx connections
userconnections:10
部分監控圖片展示:



來自群組: 北京運維圈
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!