People who have used Zabbix will know that when you modify the configuration in Zabbix, you can quickly and intuitively understand the relationships that define each configuration by using a graphical interface, while in Nagios you can manage the configuration of Nagios on a graphical interface by installing configuration Nagiosql. Nagiosql is actually some PHP page through the page interactive data read and write database and configuration file, is also used in Nagios a common plug-in, today briefly said Nagiosql installation deployment, first of all, it is undoubtedly necessary to use Nagios must have PHP, So in PHP after the installation of a few PHP module plug-ins, here are recommended to use Yum installation, of course, if the installation can be compiled by compiling the source of the module to install, of course, because there is and database interaction so must also install the database, here is the choice of MySQL, The HTTP service chooses Apache,nagiosql to be found in the Nagios Open source community: Https://exchange.nagios.org/directory/Addons/Configuration/NagiosQL /details recommends downloading the latest stable version:
[[Email protected] src]# tar -zxvf nagiosql_330.tar.gz -c /usr/local/nagios /#为管理方便就解压到Nagios目录中 [[email protected] src]# cd /usr/local/nagios/[[email protected] nagios]# mv nagiosql33 nagiosql[[email protected] nagios]# yum -y install make gcc gcc-c++ zlib-devel libaio php-pear libssh2 libssh2-devel php-pecl-ssh2 php-session php-mysqli php-gettext php-filter php-ftp[[email protected] nagios]# pear install html_template_it# Dependent Package installation, If PHP is a compile-to-install module installation needs to be compiled and installed, but be aware that the Extension_dir path in php.ini must be specified to [[EMAIL&NBSP;PROTECTED]&NBSP;NAGIOS]#&NBSP;CD nagiosql/[[email protected] nagiosql]# mkdir -p etc/{hosts,services,backup/{, hosts,services}}[[email protected] nagiosql]# chmod 777 /usr/local/nagios/nagiosql/ config[[email protected] nagiosql]# chown -r nagios:nagios /usr/local/nagios/nagiosql/#创建文件夹及文件属组修改 [[email protected] nagiosql]# vim /etc/httpd/conf.d/nagios.conf# add nagiosql virtual path ... #add virture directory for nagiosqlAlias /nagiosql "/usr/local/nagios/nagiosql "<Directory "/usr/local/nagios/nagiosql "> # sslrequiressl options none AllowOverride None Order allow,deny Allow from all AuthName " Nagios access " AuthType Basic AuthUserFile /usr/local/nagios/etc/htpasswd.users Require valid-user</directory>
At this point, and then restart the httpd after the opening will appear a series of check options, according to the actual situation to fill in can be compared to the simple, which check some of the necessary configuration missing what to pack, which in PHP php.ini mysqli.default_ The socket variable fills in the actual MySQL socket file path, does not do the related explanation here, but the point to note is to end the installation or after the installation is modified, here the configuration path needs to fill in the absolute path:
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/A6/9B/wKioL1nU2Viz4-xrAAI5oZB-Psk749.png-wh_500x0-wm_ 3-wmp_4-s_2232075376.png "title=" Configuration "alt=" Wkiol1nu2viz4-xraai5ozb-psk749.png-wh_50 "/>
Where the path in Nagiosql is filled in before the configuration created in the folder, Nagios path according to the actual situation to fill in the installation process need to use the database super User password, this must remember, After the correct installation will be in the data into the relevant table data and assigned the relevant user rights, after the creation of the connection database to check the user password, the configuration file after the successful installation of the configuration will be in the production connection profile:/usr/local/nagios/nagiosql/config /settings.php, in which there is a record connection database user password, at this time the user rights should have to the Nagiosql database select,insert,update,delete,lock tables permissions, if not, please re-authorize, Because there is a large number of Nagios configuration data in the database read and write, so the table is used in the MySQL MyISAM engine, after the successful configuration, the last prompt to delete the initialization folder after the install can be completed through the tool configuration file Import database and new configuration file
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M02/07/E9/wKiom1nU4OCBhf3tAABrTuGFzug281.png-wh_500x0-wm_ 3-wmp_4-s_3963824432.png "title=" tool "alt=" Wkiom1nu4ocbhf3taabrtugfzug281.png-wh_50 "/>
Finally in the original NAGIOS.CFG configuration under the Cfg_dir or Cfg_file modified to Nagiosql, commented out the original configuration, can also be remotely modified by the "Nagios Configuration" option under the tool
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/A6/9B/wKioL1nU43eiOgWUAAGZZHCtWns125.png-wh_500x0-wm_ 3-wmp_4-s_2685690360.png "title=" Nagios Configuration "alt=" Wkiol1nu43eiogwuaagzzhctwns125.png-wh_50 "/>
Finally, the new configuration can be checked through the Nagios control in the tool
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/A6/9B/wKioL1nU4wCTWQUSAACUOs0Wmvw304.png-wh_500x0-wm_ 3-wmp_4-s_371683361.png "title=" Check "alt=" Wkiol1nu4wctwqusaacuos0wmvw304.png-wh_50 "/>
This article from "Jim's Technical Essay" blog, declined to reprint!
Nagiosql plug-in installation application