Install Icinga1.8.4 in Linux
1. System Environment
The operating system is CentOS 6.4 64-bit. It was previously used as a basic unused server with 2 GB memory and 250 GB hard disk.
The installation system is relatively simple. I installed it with PXE. I chose to minimize the server mode for the installation components. Other required software was installed with yum.
Ii. Software Download
Icinga Chinese edition in http://sourceforge.net/projects/icinga-cn/files? Source = navbar download. I downloaded the integrated pnp4 version. You can use rrd to plot and display the data collected by Icinga. in addition, you also need to download the corresponding Plugins package, which is required for Icinga monitoring/check. without Plugins, Icinga is an empty shelf. you should know that Nagios kids shoes have been installed.
Iii. Software Installation
3.1 necessary system components
A. Compile the required tools and Class Libraries
Yum install gcc glibc-common gd-devel
Yum install libjpeg-devel libpng-devel
Yum install rrdtool-devel perl-rrdtool perl-devel
B. LAMP Kit
Yum install httpd mysql-server libdbi-devel libdbi-drivers libdbi-dbd-mysql php-gd php-mysql
Php components can be added as needed. After all, it is a waste of time to install a machine for the Icinga service.
3.2 start Icinga Installation
A. Create an Icinga user and a user group.
/Usr/sbin/groupadd icinga
/Usr/sbin/useradd-m icinga
Passwd icinga
/Usr/sbin/usermod-a-G icinga apache
B .decompress the downloaded icinga-pnp4-cn-1.8.4.tar.bz2, enter the decompressed directory, and execute:
. /Configure -- prefix =/usr/local/icinga -- with-icinga-user = icinga-with-icinga-group = icinga -- with-command-user = icinga -- with-command- group = icinga -- e nable-idoutils -- with-httpd-conf =/etc/httpd/conf. d -- enable-nanosleep -- enable-event-broker
The configure program automatically detects the system environment and whether all the dependent packages are installed. If no error is reported, perform the following operations:
Make all
If no error is reported for make, the following make commands will be prompted, which can be executed in sequence.
Make install
Make install-init
Make install-config
Make install-eventhandlers
Make install-commandmode
Make install-idoutils
Make install-processperfdata
Make install-plugins
In the preceding command, the last two packages are unique to those that contain the pnp component. If you download a package that does not contain the pnp component, you do not need to execute the package.
I am using 1.8.4 in Chinese. It may be the negligence of the Chinese author. In the make all stage, there is a small bug, that is, when compiling cgi, an error is reported, it is said that no ruler is used to compile statuswml. cgi. After comparing the Makefile in the English version 1.8.4cgi directory with the Makefile in the Chinese version, we found that there is a line in cgi/Makefile:
CGIS = avail. cgi cmd. cgi config. cgi extinfo. cgi history. cgi events. cgi outages. cgi showlog. cgi status. cgi statusmap. cgi statuswml. cgi summary. cgi tac. cgi $ (CGIEXTRAS)
Use the editor to modify cgi/Makefile, remove statuswml. cgi from the line, and re-Execute make all to continue. Use the original English version to proceed smoothly.
The icinga official website provides a convenient make command, as shown below:
Make fullinstall
Make install-config
It can also be installed, but I have not tested it.
If the compilation process goes smoothly, the main program of Icinga will be installed. Use the command
Chkconfig -- add icinga
Chkconfig -- add ido2db
Chkconfig icinga on
Chkconfig ido2db on
Enable the icinga service to automatically run when the server is started the next time. You can use service Icinga [start | stop | restart] To start/disable the icinga service later, which is convenient.
C. database creation and IDOUtils
Idoutils supports mysql, PGsql, Oracle, and other databases. mysql is supported by default.
Start mysql, run the following command to create the icinga database, and authorize the icinga database user.
Mysql-u root-p
Create database icinga;
Grant usage on icinga. * TO 'icinca' @ 'localhost'
Identified by 'icinca'
WITH MAX_QUERIES_PER_HOUR 0
MAX_CONNECTIONS_PER_HOUR 0
MAX_UPDATES_PER_HOUR 0;
Grant select, INSERT, UPDATE, DELETE, DROP, create view, INDEX, EXECUTE
ON icinga. * TO 'icinga '@ 'localhost ';
Flush privileges;
Quit
2 ~ Step 11: operate at the mysql> prompt, not at the shell prompt.
Enter the module/idoutils/db/mysql in the icinga source code directory and run
Mysql-u root-p icinga <mysql. SQL
To import the database.
D. Install the plug-in.
Secret, and then execute the following command. Note that \ (and \) must be used to escape () in the file name. I directly renamed the file name mv and decompressed it with tar.
./Configure -- prefix =/usr/local/icinga -- with-cgiurl =/icinga/cgi-bin -- with-icinga-user = icinga -- with-icinga-group = icinga
Make
Make install
In addition, a new addinins-20130428.tar.gz package is added to the plugins- 30428.tar.gz program of icinga. there are many new check components in the package. We recommend you download the package and unzip the package to the decompress directory.
After installing the Icinga plug-in, you can start apache, ido2db, and icinga services.
Run the following command to access icinga in a browser:
Htpasswd-c/usr/local/icinga/etc/htpasswd. users icingaadmin
To add a web authenticated user, the command prompts you to enter the password and asks you to enter a confirmation message again.
After the preceding command is executed, you can access it in a browser. enter http: // yourserverip/icinga in the browser. The authentication dialog box is displayed. Enter the icingaadmin user name and your password created by the htpasswd command to view the Icinga interface.
Because there is a linux configuration in the default icinga configuration that uses Nrpe for detection, I have not installed it here, so I will/usr/local/icinga/etc/icinga. in cfg, export _file =/usr/local/icinga/etc/objects/linux. the cfg line commented. restart the icinga service and you can see that there is only one localhost.
Wait for a piece of data, icinga will run some service detection. If everything goes well, you will see that the services in the service details are green and normal words.
Because I installed a small number of packages during installation, there was a service check_iostat error in localhost. after research, it is found that the system does not install the iostat and bc commands, install the sysstat package and the bc package, and the service will be normal.
How to deploy the Icinga Client
How to deploy the Icinga Server
This article permanently updates the link address: