How To Install Nagvis On Centos 7

Posted By admin On 06/06/19

The Industry Standard in IT Infrastructure Monitoring Purpose This document describes how to install Nagios Core 4.1.1 and Nagios Plugins 2.1.1 on Centos 7 minimal. Install Nagios on Linux. How to Setup Nagios Monitoring Server on CentOS/RHEL 7/6/5. Nagios is an open source, powerful monitoring system. In this tutorial, we will cover the installation of Nagios 4, a very popular open source monitoring system, on CentOS 7 or RHEL 7. We will cover some basic configuration, so you will be able to monitor host resources via the web interface. We will also utilize the Nagios Remote Plugin Executor (NRPE), that will be installed as an agent on remote hosts, to monitor their local resources.

Learning has never been so easy!
Sign Up

Nagios,Pnp4Nagios & Nagvis installation on centos

20 Steps total

Step 1: Installation of apache

sudo yum install httpd
sudo service httpd start
sudo yum install php php-mysql

Step 2: Download packages & extract

wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.3.2.tar.gz
wget https://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz

tar -xzf nagios-4.3.2.tar.gz
tar -xzf nagios-plugins-2.2.1.tar.gz
rm -rf *.tar.gz

Step 3: install required packages

yum install httpd php gcc glibc glibc-common gd gd-devel perl unzip -y

Step 4: add users and give rights

/usr/sbin/useradd -m nagios
passwd nagios
/usr/sbin/groupadd nagcmd # Used for Web Interface
/usr/sbin/usermod -a -G nagcmd nagios
/usr/sbin/usermod -a -G nagcmd apache

Step 5: compile the extracted code

./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf

now setup security for the front end
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
systemctl restart nagios && systemctl restart httpd

Step 6: Install nagios plugins

tar xzf nagios-plugins-2.1.1.tar.gz
cd nagios-plugins-2.1.1

./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install

Add Nagios services
chkconfig --add nagios
chkconfig nagios on

Verify the sample Nagios configuration files.
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
service nagios start

Step 7: Disable selinux

nano /etc/sysconfig/selinux

and set SELINUX=disabled
reboot the machine

Step 8: Add firewall rules

firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=444/tcp --permanent
firewall-cmd --zone=public --add-port=25/tcp --permanent
firewall-cmd --reload

systemctl restart nagios
systemctl restart httpd

Step 9: Installation NRPE

yum groupinstall 'Development Tools'
download http://downloads.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
tar -xzf nrpe
cd nrpe
yum install -y gcc glibc glibc-common openssl openssl-devel perl wget
./configure --enable-command-args --with-nagios-user=nagios --with-nagios-group=nagios --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/x86_64-linux-gnu
make all
make install
make install-xinetd
make install-daemon-config Adobe after effects cc 2015 crack torrent.

nano /etc/xinetd.d/nrpe
and add only_from = your interal ip
service xinetd restart

Step 10: Installation pnp4nagios

yum install rrdtool perl-Time-HiRes rrdtool-perl php-gd
download pnp4 nagios
extract
cd

(https://downloads.sourceforge.net/project/pnp4nagios/PNP-0.6/pnp4nagios-0.6.26.tar.gz)
./configure
make
make all
make fullinstall
chkconfig --add npcd && chkconfig --level 35 npcd on
systemctl reload httpd
mv /usr/local/pnp4nagios/share/install.php /usr/local/pnp4nagios/share/install.php-ori

Step 11: edit nagios.cfg

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

add / edit
# Bulk / NPCD mode
process_performance_data=1
service_perfdata_file=/usr/local/pnp4nagios/var/service-perfdata
service_perfdata_file_template=DATATYPE::SERVICEPERFDATAtTIMET::$TIMET$tHOSTNAME::$HOSTNAME$tSERVICEDESC::$SERVICEDESC$tSERVICEPERFDATA::$SERVICEPERFDATA$tSERVICECH$
service_perfdata_file_mode=a
service_perfdata_file_processing_interval=15
service_perfdata_file_processing_command=process-service-perfdata-file

Install

How To Install Nagvis On Centos 7

host_perfdata_file=/usr/local/pnp4nagios/var/host-perfdata
host_perfdata_file_template=DATATYPE::HOSTPERFDATAtTIMET::$TIMET$tHOSTNAME::$HOSTNAME$tHOSTPERFDATA::$HOSTPERFDATA$tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$tHOSTSTATE::$
host_perfdata_file_mode=a
host_perfdata_file_processing_interval=15
host_perfdata_file_processing_command=process-host-perfdata-file

Step 12: edit commands.cfg

# 'process-host-perfdata' command definition
define command{
command_name process-host-perfdata
command_line /usr/bin/printf '%b' '$LASTHOSTCHECK$t$HOSTNAME$t$HOSTSTATE$t$HOSTATTEMPT$t$HOSTSTATETYPE$t$HOSTEXECUTIONTIME$t$HOSTOUTPUT$t$HOSTPERFDATA$$
}

# 'process-service-perfdata' command definition
define command{
command_name process-service-perfdata
command_line /usr/bin/printf '%b' '$LASTSERVICECHECK$t$HOSTNAME$t$SERVICEDESC$t$SERVICESTATE$t$SERVICEATTEMPT$t$SERVICESTATETYPE$t$SERVICEEXECUTIONTIME$$
}

define command{
command_name process-service-perfdata-file
command_line /bin/mv /usr/local/pnp4nagios/var/service-perfdata /usr/local/pnp4nagios/var/spool/service-perfdata.$TIMET$
}

define command{
command_name process-host-perfdata-file
command_line /bin/mv /usr/local/pnp4nagios/var/host-perfdata /usr/local/pnp4nagios/var/spool/host-perfdata.$TIMET$
}

Step 13: edit templates.cfg

define host {
name host-pnp
action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_'s domain
my $opt_token = 'yoursecret'; # The token from your Nagios services page

Yum Install Nagios

Step 19: edit contacts

define contact {
contact_name slack
alias Slack
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-service-by-slack
host_notification_commands notify-host-by-slack
}

Step 20: additional packages

for some script you need these packages

yum install cpan
cpan : install Net::DNS
yum install php-gd
yum install gd-progs

1 Comment

Nagios Configuration

  • Sonora
    dmle Feb 27, 2019 at 10:33pm

    First thank you for great how-to, second, this tutorial will work with CentOS 7 (lastest)?