Home Directory Plugins Databases SQLServer Check MSSQL Database Mirroring

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Check MSSQL Database Mirroring

Rating
2 votes
Favoured:
0
Hits
108835
Files:
FileDescription
check_dbmirroring.plmssql mirroring
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Perl script for checking database mirroring in Microsoft SQL Server 2005
This Perl script uses DBI to connect to a Microsoft SQL Server and checks the state of a mirrored database.
The script should be run on the PRINCIPAL because on the MIRROR the user needs to have SYSADMIN rights otherwise the script returns "NULL" (no data)
Reviews (2)
bysriniprog, August 28, 2016
Hi Team,

Couldn't able to complete the check..
Please refer below error and guide us to fix the same ASAP.

[root@segment-119-227 libexec]# ./check_dbmirroring.pl -H 192.168.52.219 -d HRPL_MDS_DB1 -u toolsadmin -p T00l@dm1N
install_driver(Sybase) failed: Can't locate DBD/Sybase.pm in @INC (@INC contains: /usr/local/nagios/libexec /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at (eval 3) line 3.
Perhaps the DBD::Sybase perl module hasn't been fully installed,
or perhaps the capitalisation of 'Sybase' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Oracle, Proxy, SQLite, Sponge, my
at ./check_dbmirroring.pl line 52
[root@segment-119-227 libexec]#

Rgds
Srini
My config on Ubuntu 12.04.5 LTS x86. I had to create a SQL Server authentication login.

wget "http://exchange.nagios.org/components/com_mtree/attachment.php?link_id=493&cf_id=24" -O /usr/lib/nagios/plugins/check_dbmirroring.pl
chmod 755 /usr/lib/nagios/plugins/check_dbmirroring.pl
apt-get install libdbd-sybase-perl
nano /etc/nagios3/resource.cfg
# MS SQL Server user/password
$USER7$=
$USER8$=

nano /etc/nagios3/commands.cfg
define command{
command_name check_dbmirroring
command_line $USER1$/check_dbmirroring.pl -H $HOSTADDRESS$ -d $ARG1$ -u $USER7$ -p $USER8$
}

nano /etc/nagios3/conf.d/sql4.cfg
define service {
host_name sql4
service_description ActivityLog Mirroring
check_command check_dbmirroring!ActivityLog
use generic-service
}