Abstract
This document describes how you can monitor a Mssql server such as:
- Connection time
- A recent restart
- The number of connections
- Cache hit
- Dead locks
- etc...
These instructions assume that you’ve installed Shinken according to the Installation tutorial. The sample configuration entries below reference objects that are defined in the sample config files (“commands.cfg”, “templates.cfg”, etc.) that are installed if you follow the quickstart.
Note
TODO: draw a check_mssql diag
Monitoring a Mssql server need the plugin check_mssql_health available at labs.consol.de/lang/en/nagios/check_mssql_health/ and a mssql user account for the connection.
There are some steps you’ll need to follow in order to monitor a new database machine. They are:
- Install check plugins
- setup the mssql user account
- Update your windows server host definition for mysql monitoring
- Restart the Shinken daemon
To make your life a bit easier, a few configuration tasks have already been done for you:
- Some check_mssql_ commands definition has been added to the “commands.cfg” file.
- A Mssql host template (called “mssql”) has already been created in the “templates.cfg” file.
The above-mentioned config files can be found in the ///etc/shinken/// directory (or c:shinkenetc under windows). You can modify the definitions in these and other definitions to suit your needs better if you’d like. However, I’d recommend waiting until you’re more familiar with configuring Shinken before doing so. For the time being, just follow the directions outlined below and you’ll be monitoring your Mssql boxes in no time.
Tip
We are supposing here that the Mssql machine you want to monitor is named srv-win-1. Please change the above lines and commands with the real name of your server of course.
First connect as root under you Shinken server (or all poller servers for a multi-box setup)
Note
Todo: Use shinken.sh for this
Look at the labs.consol.de/lang/en/nagios/check_mssql_health/ page about how to conigure your user connection.
Then you will need to configure your user/password in the macros file so the plugins will have the good values for the connction. So update the /etc/shinken/resource.cfg file or c:shinkenetcresource.cfg file to setup the new password:
$MSSQLUSER$=shinken
$MSSQLPASSWORD$=shinkenpassword
To see if the connection is ok, just launch:
::
/var/lib/nagios/plugins/check_mssql_health –hostname srv-win-1 –username shinken –password shinkenpassword –mode connection-time
It should not return errors.
All you need to get all the Msql service checks is to add the mssql template to this host. We suppose you already monitor the OS for this host, and so you already got the host configuration file for it.
Under Linux:
::
linux:~ # vi /etc/shinken/hosts/srv-win-1.cfg
Or Windows:
::
c:wordpad c:shinkenetchostssrv-win-1.cfg
You need to add the mysql template in the use line. It’s better to follow the more precise template to the less one, like here mssql first, and then windows.
::
- define host{
- use mssql,windows host_name srv-win-1 address srv-win-1.mydomain.com
}
You’re done with modifying the Shiknen configuration, so you’ll need to verify your configuration files and restart Shinken.
If the verification process produces any errors messages, fix your configuration file before continuing. Make sure that you don’t (re)start Shinken until the verification process completes without any errors!