WMI Microsoft SQL (MSSQL) Profile
This profile monitors a Microsoft SQL Server using Windows Management Instrumentation (WMI). Nagios Remote Plugin Executor (NRPE) is used by the Nagios server to communicate with the WMI proxy server. This proxy server queries the monitored Windows server for measurements and status using WMI.
Additionally, you may want to refer to the WMI documentation. This project consists of a collection of script monitors (.vbs for starters) that use the Microsoft .Net Framework and WMI to retrieve performance data from remote Windows hosts without the need for agents on the remote hosts.
Services Configuration
- Service - Definitions in Monarch are stored under this name.
- Command Line - Service command name with arguments to be passed to the plugin.
- Plugin Command Line - Plugin script called by Nagios for this Service.
- Extended Info - The Extended Service Info definition, typically used for generating graphs.
Command lines displayed below are intended to be single line commands. Service Command Line Plugin Command Line Extended Info wmi_mssql_buffer_cache_hits check_wmi_mssql_buffer_cache_hits!
80!50$USER1$/check_nrpe -t 60 -H $USER21$ -c get_mssql_buf_cache_hit -a "$HOSTADDRESS$" "$ARG1$" "$ARG2$" percent_graph wmi_mssql_deadlocks check_wmi_mssql_deadlocks!
Name=_Total!50!100$USER1$/check_nrpe -t 60 -H $USER21$ -c get_mssql_deadlocks -a "$HOSTADDRESS$" "$ARG1$" "$ARG2$" "$ARG3$" percent_graph wmi_mssql_full_scans check_wmi_mssql_full_scans!
10!20$USER1$/check_nrpe -t 60 -H $USER21$ -c get_mssql_fullscans -a "$HOSTADDRESS$" "$ARG1$" "$ARG2$" percent_graph wmi_mssql_lock_wait_time check_wmi_mssql_lock_wait_time!
Name=_Total!1000!1500$USER1$/check_nrpe -t 60 -H $USER21$ -c get_mssql_lock_wait_time -a "$HOSTADDRESS$" "$ARG1$" "$ARG2$" "$ARG3$" percent_graph wmi_mssql_lock_waits check_wmi_mssql_lock_waits!
Name=_Total!4!6$USER1$/check_nrpe -t 60 -H $USER21$ -c get_mssql_lock_waits -a "$HOSTADDRESS$" "$ARG1$" "$ARG2$" "$ARG3$" percent_graph wmi_mssql_log_growths check_wmi_mssql_log_growths!
Name=_Total!5!8$USER1$/check_nrpe -t 60 -H $USER21$ -c get_mssql_log_growth -a "$HOSTADDRESS$" "$ARG1$" "$ARG2$" "$ARG3$" percent_graph wmi_mssql_log_used check_wmi_mssql_log_used!
Name=_Total!80!90$USER1$/check_nrpe -t 60 -H $USER21$ -c get_mssql_log_used -a "$HOSTADDRESS$" "$ARG1$" "$ARG2$" "$ARG3$" percent_graph wmi_mssql_memory_grants_pending check_wmi_mssql_memory_
grants_pending!1!5$USER1$/check_nrpe -t 60 -H $USER21$ -c get_mssql_memgrantspending -a "$HOSTADDRESS$" "$ARG1$" "$ARG2$" percent_graph wmi_mssql_transactions check_wmi_mssql_transactions!
Name=_Total!10!20$USER1$/check_nrpe -t 60 -H $USER21$ -c get_mssql_transactions -a "$HOSTADDRESS$" "$ARG1$" "$ARG2$" "$ARG3$" percent_graph wmi_mssql_users check_wmi_mssql_users!1!5 $USER1$/check_nrpe -t 60 -H $USER21$ -c get_mssql_users -a "$HOSTADDRESS$" "$ARG1$" "$ARG2$" "$ARG3$" percent_graph wmi_service_DcomLaunch check_wmi_service!DcomLaunch $USER1$/check_nrpe -H $USER21$ -t 60 -c get_service -a "$HOSTADDRESS$" "$ARG1$" percent_graph wmi_service_Dfs check_wmi_service!Dfs $USER1$/check_nrpe -H $USER21$ -t 60 -c get_service -a "$HOSTADDRESS$" "$ARG1$" percent_graph wmi_service_msftesql check_wmi_service!msftesql $USER1$/check_nrpe -H $USER21$ -t 60 -c get_service -a "$HOSTADDRESS$" "$ARG1$" percent_graph wmi_service_MSSQLServerADHelper check_wmi_service!
MSSQLServerADHelper$USER1$/check_nrpe -H $USER21$ -t 60 -c get_service -a "$HOSTADDRESS$" "$ARG1$" percent_graph wmi_service_SQLBrowser check_wmi_service!SQLBrowser $USER1$/check_nrpe -H $USER21$ -t 60 -c get_service -a "$HOSTADDRESS$" "$ARG1$" percent_graph
Profile Package
This package includes the following files:
Profile Definitions
- service_profile_wmi_MSSQL.xml
- perfconfig_wmi_MSSQL.xml
Plugins Scripts on the GroundWork Server
- check_nrpe
NRPE Scripts on the WMI Proxy Server
- nrpe_nt.zip
Performance Graphing Programs
- percent_graph.cgi
Installation
GroundWork Monitor includes many monitoring profiles for a variety of devices, systems and applications. Profiles already imported on a new GroundWork installation include Service Ping, SNMP Network, and SSH UNIX. The GroundWork Monitor Configuration tool is used to import updated Profiles and Profiles that require additional setup; the Profile XML file and its companion Performance Configuration definition file. Services can also be imported in addition to Service Profiles in the Profile Importer. The import process is documented under GROUNDWORK PROFILES > How to import profiles.
Implementation
This section contains detail settings used by this Profile. These parameters can be altered with the Configuration tool.
Command Parameters
Command parameters are in the Configuration Services section with the following names and default values.
wmi_mssql_buffer_cache_hits
- Uses check_nrpe plugin to connect to NRPE on $USER21$ and execute the get_mssql_buf_cache_hit command as defined in nrpe.cfg against the host $HOSTADDRESS$.
- $ARG1$ - Database Instance, default is _Total
- $ARG2$ - Warning threshold, default is 80
- $ARG3$ - Critical threshold, default is 160
wmi_mssql_deadlocks
- Uses check_nrpe plugin to connect to NRPE on $USER21$ and execute the get_mssql_deadlocks command as defined in nrpe.cfg against the host $HOSTADDRESS$.
- $ARG1$ - Database Instance, default is _Total
- $ARG2$ - Warning threshold, default is 50
- $ARG3$ - Critical threshold, default is 100
wmi_mssql_full_scans
- Uses check_nrpe plugin to connect to NRPE on $USER21$ and execute the get_mssql_fullscans command as defined in nrpe.cfg against the host $HOSTADDRESS$.
- $ARG1$ - Warning threshold, default is 10
- $ARG2$ - Critical threshold, default is 20
wmi_mssql_lock_wait_time
- Uses check_nrpe plugin to connect to NRPE on $USER21$ and execute the get_mssql_lock_wait_time command as defined in nrpe.cfg against the host $HOSTADDRESS$.
- $ARG1$ - Database Instance, default is _Total
- $ARG2$ - Warning threshold, default is 1000
- $ARG3$ - Critical threshold, default is 1500
wmi_mssql_lock_waits
- Uses check_nrpe plugin to connect to NRPE on $USER21$ and execute the get_mssql_lock_waits command as defined in nrpe.cfg against the host $HOSTADDRESS$.
- $ARG1$ - Database Instance, default is _Total
- $ARG2$ - Warning threshold, default is 4
- $ARG3$ - Critical threshold, default is 6
wmi_mssql_log_growths
- Uses check_nrpe plugin to connect to NRPE on $USER21$ and execute the get_mssql_log_growth command as defined in nrpe.cfg against the host $HOSTADDRESS$.
- $ARG1$ - Database Instance, default is _Total
- $ARG2$ - Warning threshold, default is 5
- $ARG3$ - Critical threshold, default is 8
wmi_mssql_log_used
- Uses check_nrpe plugin to connect to NRPE on $USER21$ and execute the get_mssql_log_used command as defined in nrpe.cfg against the host $HOSTADDRESS$.
- $ARG1$ - Database Instance, default is _Total
- $ARG2$ - Warning threshold, default is 80
- $ARG3$ - Critical threshold, default is 90
wmi_mssql_memory_grants_pending
- Uses check_nrpe plugin to connect to NRPE on $USER21$ and execute the get_mssql_memgrantspending command as defined in nrpe.cfg against the host $HOSTADDRESS$.
- $ARG1$ - Warning threshold, default is 1
- $ARG2$ - Critical threshold, default is 5
wmi_mssql_transactions
- Uses check_nrpe plugin to connect to NRPE on $USER21$ and execute the get_mssql_transactions command as defined in nrpe.cfg against the host $HOSTADDRESS$.
- $ARG1$ - Database Instance, default is _Total
- $ARG2$ - Warning threshold, default is 10
- $ARG3$ - Critical threshold, default is 20
wmi_mssql_users
- Uses check_nrpe plugin to connect to NRPE on $USER21$ and execute the get_mssql_users command as defined in nrpe.cfg against the host $HOSTADDRESS$.
- $ARG1$ - Database Instance, default is _Total
- $ARG2$ - Warning threshold, default is 1
- $ARG3$ - Critical threshold, default is 5
wmi_service
- Uses check_nrpe plugin to connect to NRPE on $USER21$ and execute the get_service command as defined in the nrpe.cfg against the host $HOSTADDRESS$.
- $ARG1$ - Service Name (not Display Name!)
- OK if service is running
- CRITICAL is service is stopped.
- UNKNOWN is service is not installed.
Performance Graphing Parameters
The following parameters are used to generate performance charts. These parameters are set using the Configuration>Performance tool in GroundWork Monitor.
wmi_mssql_buffer_cache_hits
- Graphs the buffer cache hit ratio for the database server.
- Nagios service description must contain the string "mssql_buffer_cahce_hits".
wmi_mssql_deadlocks
- Graphs the number of deadlocks per second for a specified database.
- Nagios service description must contain the string "mssql_deadlocks".
wmi_mssql_full_scans
- Graphs the number of full table scans per second for the database server.
- Nagios service description must contain the string "mssql_full_scans".
wmi_mssql_lock_wait_time
- Graphs the average lock wait time in ms for a specified database.
- Nagios service description must contain the string "mssql_lock_wait_time".
wmi_mssql_lock_waits
- Graphs the number of lock waits per second for a specified database.
- Nagios service description must contain the string "mssql_lock_waits".
wmi_mssql_log_growths
- Graphs the number of log growths for a specified database.
- Nagios service description must contain the string "mssql_log_growths".
wmi_mssql_log_used
- Graphs the percentage log space used for the database "_Total".
- Nagios service description must contain the string "mssql_log_used".
wmi_mssql_memory_grants_pending
- Graphs the number of memory grants pending on the database server.
- Nagios service description must contain the string "mssql_memory_grants_pending".
wmi_mssql_transactions
- Graphs the number of transactions per second for a specified database.
- Nagios service description must contain the string "mssql_transactions".
wmi_mssql_users
- Graphs the number of users connected to a specified database.
- Nagios service description must contain the string "mssql_users".
Implementation Notes
- The nrpe.cfg file on the Windows server maps commands issued by the GroundWork server to scripts in the c:\nrpe_nt directory. Commands issued by this profile are installed with this package. If new NRPE commands are added, this file must be modified. Go to the GroundWork Support Portal - GroundWork Connect at www.groundworkconnect.com and search for Installing GroundWork WMI NRPE.
- The WMI proxy server must be in the same domain as target monitored Windows server, and must have administrator rights.