Skip to content

Setup Additional Monitoring Plugins

Garðar Þorsteinsson edited this page Jan 23, 2023 · 14 revisions

Install MySQL / MariaDB health plugin - check_mysql_health

https://labs.consol.de/nagios/check_mysql_health/index.html

yum install -y perl-DBI perl-DBD-MySQL make gcc-c++
wget https://labs.consol.de/assets/downloads/nagios/check_mysql_health-2.2.2.tar.gz
tar -zxvf check_mysql_health-2.2.2.tar.gz
cd check_mysql_health-2.2.2
./configure --prefix=/usr/lib64/nagios/ --with-nagios-user=nagios --with-nagios-group=nagios --with-perl=/usr/bin/perl
make
make install
cp -p /usr/lib64/nagios/libexec/check_mysql_health /usr/lib64/nagios/plugins/.

Install Microsoft SQL server health plugin - check_mssql_health

https://labs.consol.de/nagios/check_mssql_health/index.html

yum install -y make gcc-c++ cpan freetds-devel freetds
export SYBASE="/usr"
cpan -fi DBD::Sybase
wget https://labs.consol.de/assets/downloads/nagios/check_mssql_health-2.7.2.1.tar.gz
tar -zxvf check_mssql_health-2.7.2.1.tar.gz
cd check_mssql_health-2.7.2.1
./configure --prefix=/usr/lib64/nagios/ --with-nagios-user=nagios --with-nagios-group=nagios --with-perl=/usr/bin/perl
make
make install
cp -p /usr/lib64/nagios/libexec/check_mssql_health /usr/lib64/nagios/plugins/.

Another method - Build RPM for DBD-Sybase (for EL7 when using check_mssql_health)

Requirements

  • dev tools installed
  • cpanspec installed
  • freedts & freetds-devel installed
yum install -y freetds-devel freetds cpanspec gcc-c++

Create the SPEC file and build RPM

sudo yum install cpanspec rpm-build
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}

vim .rpmmacros
%packager Gardar <[email protected]>
%vendor OK
%_topdir %(echo $HOME)/rpmbuild
%__perl_requires %{nil}

cpanspec DBD::Sybase
cp perl-DBD-Sybase.spec ~/rpmbuild/SPECS/
cp DBD-Sybase-1.22.tar.gz ~/rpmbuild/SOURCES/

# Remove test from spec file if you dont have a runnning sybase database
sed -i '/^%check/d' ~/rpmbuild/SPECS/perl-DBD-Sybase.spec
sed -i '/^make test/d' ~/rpmbuild/SPECS/perl-DBD-Sybase.spec

# unset PERL_LOCAL_LIB_ROOT
# unset PERL_MM_OPT
# unset INSTALL_BASE
# unset PERL_MB_OPT

cd ~/rpmbuild
SYBASE=/usr rpmbuild -ba SPECS/perl-DBD-Sybase.spec

Install the newly created rpm from ~/rpmbuild/RPMS/x86_64/

Clone this wiki locally