Linux serverNETWORK ADMINISTRATIONS

Installing Nconf in Centos 7 Part II

Nconf installation.

yum install mysql-server perl-DBI perl-DBD-MySQL php-mysql sudo -y
yum install mariadb-server
systemctl start mariadb
systemctl enable mariadb
systemctl status mariadb
mysql_secure_installation

systemctl restart httpd
mkdir /usr/local/src/nagios
cd /usr/local/src/nagios
wget https://sourceforge.net/projects/nconf/files/nconf/1.3.0-0/nconf-1.3.0-0.tgz -O nconf.tgz
tar zxvf nconf.tgz

mv nconf /usr/local/nagios/share/nconf
chown -R apache:apache /usr/local/nagios/share/nconf
chmod 775 /usr/local/nagios/share/nconf/bin/*

mysql -u root -p

CREATE DATABASE nconf;
CREATE USER nconfadmin@localhost IDENTIFIED BY ‘12345’;
GRANT ALL PRIVILEGES ON nconf.* TO nconfadmin@localhost;
FLUSH PRIVILEGES;
exit

http://ip_address/nagios/nconf/INSTALL.php

cd /usr/local/nagios/share/nconf
rm -rf INSTALL INSTALL.php UPDATE UPDATE.php
ln -s /usr/local/nagios/bin/nagios /usr/local/nagios/share/nconf/bin/nagios

http://ip_address/nagios/nconf/INSTALL.php

Configure Nagios to work with Nconf

vi /usr/local/nagios/etc/nagios.cfg

# You can specify individual object config files as shown below:
#cfg_file=/usr/local/nagios/etc/objects/commands.cfg
#cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
#cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
#cfg_file=/usr/local/nagios/etc/objects/templates.cfg
# Definitions for monitoring the local (Linux) host
#cfg_file=/usr/local/nagios/etc/objects/localhost.cfg
# Definitions for monitoring a Windows machine
#cfg_file=/usr/local/nagios/etc/objects/windows.cfg
# Definitions for monitoring a router/switch
#cfg_file=/usr/local/nagios/etc/objects/switch.cfg
# Definitions for monitoring a network printer
#cfg_file=/usr/local/nagios/etc/objects/printer.cfg
# You can also tell Nagios to process all config files (with a .cfg
# extension) in a particular directory by using the cfg_dir
# directive as shown below:
cfg_dir=/usr/local/nagios/etc/global
cfg_dir=/usr/local/nagios/etc/Default_collector

vi /usr/local/nagios/share/nconf/config/deployment.ini

;; LOCAL deployment ;;
[deploy config]
type = local
source_file = “/usr/local/nagios/share/nconf/output/NagiosConfig.tgz”
target_file = “/usr/local/nagios/etc/”
action = extract
reload_command = sudo -u root /etc/rc.d/init.d/nagios reload

visudo

#Defaults !visiblepw

apache ALL = (root) NOPASSWD: /etc/init.d/nagios reload

cp -a /usr/local/nagios/share/images/logos /tmp/base
mv /tmp/base /usr/local/nagios/share/images/logos/base

http://192.168.100.23/nagios/nconf/index.php

source

centos 7

Leave a Reply

Your email address will not be published. Required fields are marked *