Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Check SQL Database Size (with NRPE)
v1.0
2015-04-29
- Nagios 4.x
GPL
17807
File | Description |
---|---|
check_sqldbsize.vbs | check_sqldbsize.vbs |
check_sqldbsize v1.1.vbs | check_sqldbsize v1.1.vbs |
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!
As I couldn't find a script/plugin that did exactly what I needed I put this VB script together to check the size of a SQL database with NRPE and NS Client++.
The sizes are all in MB.
Usage:
cscript check_sqldbsize.vbs SERVERINSTANCE DATABASE WARNING CRITICAL
eg.
cscript check_sqldbsize.vbs localhostsqlexpress edgesight 5000 9000
Nagios Command Definition Example
define command {
command_name check_sqldbsize
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_sqldbsize -a $ARG1$ $ARG2$ $ARG3$ $ARG4$
}
Nagios Service Definition Example (Note the double back slash () before the instance name)
define service {
use generic_passive_service
service_description SQL DB Size
host_name server1
check_command check_sqldbsize!localhostsqlexpress!edgesight!8000!9500
}
NS Client++ (nsclient.ini) Example
[/settings/external scripts/scripts]
check_sqldbsize = cscript.exe //T:5 //NoLogo "C:Program FilesNSCLient++scriptscheck_sqldbsize.vbs" $ARG1$ $ARG2$ $ARG3$ $ARG4$
Tested with:
-Nagios Core 4.0.8
-NSClient++ v0.4.1.105
-SQL Server 2008 Express
Change Log
v1.1: Exclude Log from DB size
Any comments/suggestions appreciated.
The sizes are all in MB.
Usage:
cscript check_sqldbsize.vbs SERVERINSTANCE DATABASE WARNING CRITICAL
eg.
cscript check_sqldbsize.vbs localhostsqlexpress edgesight 5000 9000
Nagios Command Definition Example
define command {
command_name check_sqldbsize
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_sqldbsize -a $ARG1$ $ARG2$ $ARG3$ $ARG4$
}
Nagios Service Definition Example (Note the double back slash () before the instance name)
define service {
use generic_passive_service
service_description SQL DB Size
host_name server1
check_command check_sqldbsize!localhostsqlexpress!edgesight!8000!9500
}
NS Client++ (nsclient.ini) Example
[/settings/external scripts/scripts]
check_sqldbsize = cscript.exe //T:5 //NoLogo "C:Program FilesNSCLient++scriptscheck_sqldbsize.vbs" $ARG1$ $ARG2$ $ARG3$ $ARG4$
Tested with:
-Nagios Core 4.0.8
-NSClient++ v0.4.1.105
-SQL Server 2008 Express
Change Log
v1.1: Exclude Log from DB size
Any comments/suggestions appreciated.
Reviews (1)
bymac1959, October 30, 2016
Where are you suppose to place the script on the client or the nagios server? I mean where does it run from?