Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Check MSSQL DataBases, Jobs, Log Files, Time2Connect
1.1.2
2018-12-05
- Nagios 3.x
- Nagios 4.x
- Nagios XI
GPL
27790
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
The script get all sql instances in the server, and return status for eache instance
You can use check_mssql_config.ini to exclude DB or instance to check, read check_mssql_config.ini help.
## Description:
Script for nagios to check SQL DataBases, Connection Time, Jobs, TempDB Size, Log Size.
The script get all sql instances in the server, and return status for eache instance
You can use check_mssql_config.ini to exclude DB or instance to check, read check_mssql_config.ini help.
## Auther:
Yossi Bitton yosbit@gmail.com
Date: November 2018
Version 1.1.2
## PARAMETER DBStatus
Get the database status, return critical if one DB not in normal state.
## PARAMETER ConnectionTime
Get the time to connect to DB, include performance data.
## PARAMETER Jobs
Get the status off all jobs, the script check only Enabled and scheduled jobs.
## PARAMETER TempDBSize
Get the size of temp DB.
see values of warning and critical in check_mssql_config.ini config. needs dbowner permissions for user Service Account.
## PARAMETER LogSize
Get the size of Log file for eache DB.
see values of warning and critical in check_mssql_config.ini config. needs dbowner permissions for user Service Account.
## EXAMPLE
./check_nrpe -H -c check_mssql -a 'DBStatus'
./check_nrpe -H -c check_mssql -a 'ConnectionTime'
./check_nrpe -H -c check_mssql -a 'Jobs'
./check_nrpe -H -c check_mssql -a 'TempDBSize'
./check_nrpe -H -c check_mssql -a 'LogSize'
for Nagios NRPE edit NSC.ini or nsclient.ini and add the following line under section:
[Wrapped Scripts]
check_mssql=check_mssql.ps1 $ARG1$
[Script Wrappings]
ps1 = cmd /c echo scripts%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -ExecutionPolicy Bypass -command -
Script for nagios to check SQL DataBases, Connection Time, Jobs, TempDB Size, Log Size.
The script get all sql instances in the server, and return status for eache instance
You can use check_mssql_config.ini to exclude DB or instance to check, read check_mssql_config.ini help.
## Auther:
Yossi Bitton yosbit@gmail.com
Date: November 2018
Version 1.1.2
## PARAMETER DBStatus
Get the database status, return critical if one DB not in normal state.
## PARAMETER ConnectionTime
Get the time to connect to DB, include performance data.
## PARAMETER Jobs
Get the status off all jobs, the script check only Enabled and scheduled jobs.
## PARAMETER TempDBSize
Get the size of temp DB.
see values of warning and critical in check_mssql_config.ini config. needs dbowner permissions for user Service Account.
## PARAMETER LogSize
Get the size of Log file for eache DB.
see values of warning and critical in check_mssql_config.ini config. needs dbowner permissions for user Service Account.
## EXAMPLE
./check_nrpe -H
./check_nrpe -H
./check_nrpe -H
./check_nrpe -H
./check_nrpe -H
for Nagios NRPE edit NSC.ini or nsclient.ini and add the following line under section:
[Wrapped Scripts]
check_mssql=check_mssql.ps1 $ARG1$
[Script Wrappings]
ps1 = cmd /c echo scripts%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -ExecutionPolicy Bypass -command -
Reviews (3)
bysimob82, July 9, 2019
Hi!
I'm facing some trouble make it working, when I run the plugin from nagios server it works fine:
#---------------------------------------------------------------------------------------------------------------------------------------#
/usr/lib/nagios/plugins/check_nrpe -H 10.10.104.171 -t 30 -c check_mssql -a ConnectionTime
OK: Time to connect for all instances are OK. Total Instances=1.
MSSQLSERVER=0.0388237. |'MSSQLSERVER time to connect'=0.03882;3;5;0.03882
#------------------------------------------------------------------------------------------------------------------------------------------#
But I don't have any output, and I still have Status "unknow" and "no output returned from plugin".
As reported I've added these lines on my nsclient.ini
#---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
[/settings/external scripts/scripts]
; check_mssql = cmd /c echo scripts\\check_mssql.ps1 "$ARG1$" ; exit($lastexitcode) | powershell.exe -ExecutionPolicy Bypass -command -
; CheckExternalScripts.dll
[Script Wrappings]
; vbs=cscript.exe //T:30 //NoLogo scripts\lib\wrapper.vbs %SCRIPT% %ARGS%
; bat=scripts\%SCRIPT% %ARGS%
; ps1 = cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -ExecutionPolicy Bypass -command -
ps1 = cmd /c echo scripts%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -ExecutionPolicy Bypass -command -
; ps1=cmd /c echo scripts\\\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -
[Wrapped Scripts]
check_mssql=check_mssql.ps1 $ARG1$
[/settings/external scripts]
allow arguments = true
;use_file = 1
#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
I made a lot of try and as you can see I've commented in/out some lines =)
Could please give me any hint?? I'm without ideas!
Thank in advance
I'm facing some trouble make it working, when I run the plugin from nagios server it works fine:
#---------------------------------------------------------------------------------------------------------------------------------------#
/usr/lib/nagios/plugins/check_nrpe -H 10.10.104.171 -t 30 -c check_mssql -a ConnectionTime
OK: Time to connect for all instances are OK. Total Instances=1.
MSSQLSERVER=0.0388237. |'MSSQLSERVER time to connect'=0.03882;3;5;0.03882
#------------------------------------------------------------------------------------------------------------------------------------------#
But I don't have any output, and I still have Status "unknow" and "no output returned from plugin".
As reported I've added these lines on my nsclient.ini
#---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
[/settings/external scripts/scripts]
; check_mssql = cmd /c echo scripts\\check_mssql.ps1 "$ARG1$" ; exit($lastexitcode) | powershell.exe -ExecutionPolicy Bypass -command -
; CheckExternalScripts.dll
[Script Wrappings]
; vbs=cscript.exe //T:30 //NoLogo scripts\lib\wrapper.vbs %SCRIPT% %ARGS%
; bat=scripts\%SCRIPT% %ARGS%
; ps1 = cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -ExecutionPolicy Bypass -command -
ps1 = cmd /c echo scripts%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -ExecutionPolicy Bypass -command -
; ps1=cmd /c echo scripts\\\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -
[Wrapped Scripts]
check_mssql=check_mssql.ps1 $ARG1$
[/settings/external scripts]
allow arguments = true
;use_file = 1
#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#
I made a lot of try and as you can see I've commented in/out some lines =)
Could please give me any hint?? I'm without ideas!
Thank in advance
bysajid4u, May 15, 2019
It is excellent in pulling details of jobs, DB status at server and its respective instance level monitoring.
But I am facing challenges in configuring it cluster and instance level. Does this support such case? Please suggest.
But I am facing challenges in configuring it cluster and instance level. Does this support such case? Please suggest.
The script work but in Nagios while 1 database is stopped wont stay RED. Continue Green
Owner's reply
fixed in version 1.1.2