Here is a simple POB script to help you check the health of your MSSQL or MYSQL server.
If you want alerts you could just cron the script and on failure you will get an error in the email address configured in the MAILTO option however a more sophisticated and better approach (for one you will receive the alert just once and after corrected you will get feedback about the issue been solved) is to call the script from Monit for example as in:
################################################################# #REMOTE MSSQL CHECK ################################################################ check program ssql-heartbeat with path "/bin/sql-heartbeat.sh" if status != 0 then alertNaturally /bin/mssql-heartbeat.sh will need to have 700 permissions and owned by root as credentials will be kept inside. Here is an example of such wrapper:
#!/bin/bash -e /bin/sql-heartbeat.sh MSSQL myserver.mydomain.com heartbeatUser heartbeatPasswordFeel free to modify the heartbeat script to customize the database for example in case you want to be sure a specific db is available.
No comments:
Post a Comment