ICINGA2 installation configuration Check_oracle_health process 1. Installation
Because Check_oracle_health is written in the Perl language, before installing the plugin, you first install the client instance of Oracle, which is the Oracle plug-in (DBI and DBD) that BASIC,SQLPLUS,SDK includes Perl.
First step: Download Oracle Instant Client
Oracle Instant Client's home page in http://www.oracle.com/technology/tech/oci/instantclient/ index.html; the same software is divided into different downloadable packages according to the configuration, so that users can find the most appropriate part to download according to their own needs. To successfully configure Dbd::oracle, you need to instantclient-basic-xxx,instantclient-sdk-xxx,instantclient-sqlplus-xxx these three files to download a Zip package or RPM package , zip package using the unzip command in the current directory to extract the three zip files, will automatically generate the Instantclient_xxx directory, which contains all of the above three package files.
At this time these three zip files are useless, can be deleted, or can be backed up for later reuse.
Step Two: Install DBI
wget http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBI-1.609.tar.gz
Tar zxvf dbi-1.609.tar.gz
CD DBI-1.609
Perl makefile.pl
Make all
Make install
Step Three: Install DBD
wget http://mirrors.neusoft.edu.cn/cpan/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.52.tar.gz
Tar zxvf dbd-oracle-1.52.tar.gz
CD dbd-oracle-1.52
Perl makefile.pl
You will encounter an error at this time:
The workaround is to configure the appropriate environment variables:
Export Oracle_home=/usr/lib/oracle/11.2/client64
Note: This path is the directory where the instance is installed
Exportpath= $ORACLE _home/bin: $PATH;
Exportld_library_path= $ORACLE _home/lib:/lib:/usr/lib;
And then you can do Perl makefile.pl.
Make
Makeinstall
Fourth Step: Install Check_oracle_health
wget http://labs.consol.de/wp-content/uploads/2009/09/check_oracle_health-1.6.3.tar.gz
TARZXVF check_oracle_health-1.6.3.tar.gz
cdcheck_oracle_health-1.6.3
./configure--prefix=/usr/lib/nagios/plugins--with-nagios-user=nagios--with-nagios-group=nagios-- With-mymodules-dir=/usr/lib/nagios/plugins/libexec--with-mymodules-dyn-dir=/usr/lib/nagios/plugins/libexec
Makeall
Makeinstall
After the installation, enter the Libexec directory to see the plugin has already been.
Open the terminal in this directory, run the plug-in corresponding command, observe whether it can execute normally, return the corresponding result.
2. Configuration
ICINGA2 configuration file is very different from ICINGA1, ICINGA1 configuration files are in the object directory, respectively, Hosts.cfg,commands.cfg and Services.cfg. However, the ICINGA2 configuration file is divided into two parts, hosts.conf and services.conf files in the/ETC/ICINGA2/CONF.D directory, and the other part is located in/usr/share/icinga2/ The command-plugins.conf file under the Include directory. The correspondence between these three files and the Icinga1 file is
ICINGA1 ICINGA2
Hosts.cfg < ————— > hosts.conf
Services.cfg < ————— > services.conf
Commands.cfg < ————— > command-plugins.conf
Specific configuration examples:
host.conf File configuration:
To add a host:
Objecthost "Host_name" {
Import "Generic-host"
Address = "The host ' s IP"
}
command-plugins.conf File configuration:
Add Command:
Objectcheckcommand "Custom Command" {
Import "Plugin-check-command"
Command = [Plugindir + "/<filename stored in plugin directory>"]
/*define all require arguments*/
arguments= {
"--connect" = "$connection $"
"--username" = "$user _name$"
"--password" = "$pwd $"
"--mode" = "$Mode $"
"--warning" = "$W _arg$"
"--critical" = "$C _arg$"
}
Vars.connection = "The host ' s hostname or addressyou want to connect"
Vars.user_name= "User Name"
vars.pwd= "Password"
}
services.conf File configuration:
Add Service:
Apply Service "service Description" {
Import "Generic-service"
check_command= "Custom Command"
VARs. Mode= "Select mode want to Monitor"
VARs. W_arg= Beyond Parameter1 cause Warning
VARs. C_arg= Beyond Parameter2 cause Critical
Assign wherehost.name = = "Host_name"
}
When the corresponding host, command and service are well-matched,
Restart Icnga2:systemctl Restart ICINGA2
Open Browser, type: http://localhost/icingaweb2/
Log on to the ICINGAWEB2 monitoring page to view relevant monitoring information.
At this point, the configuration is complete.
ICINGAWEB2 monitoring the installation configuration process for Oracle databases