I usedNagiosFor more than a year, he is competent in daily monitoring work. It is necessary to install a Nagios system. Let's take a look at the specific process of Nagios installation!
Figure-Nagios
Modify yum to upgrade the server[Root @ localhost ~] # Cd/etc/yum. repos. d [root @ localhost yum. repos. d] # cp CentOS-Base.repo CentOS-Base.repo.bak [root @ localhost yum. repos. d] # wget http://centos.ustc.edu.cn/CentOS-Base.repo
--- Update the software [root @ localhost yum. repos. d] # yum update
--- Install the following essential software [root @ localhost yum. repos. d] # yum install httpd [root @ localhost yum. repos. d] # yum install gcc [root @ localhost yum. repos. d] # yum install glibc-common [root @ localhost yum. repos. d] # yum install gd-devel
--- Add nagios users and nagcmd groups
- [root@localhost yum.repos.d]# cd [root@localhost ~]# useradd -m nagios[root@localhost ~]# passwd nagios ---nagios[root@localhost ~]# groupadd nagcmd[root@localhost ~]# usermod -a -G nagcmd nagios[root@localhost ~]# usermod -a -G nagcmd apache
-
--- Install nagios
- [Root @ localhost ~] # Mkdir-p ~ /Downloads [root @ localhost ~] # Cd ~ /Downloads [root @ localhost downloads] # wget unzip downloads] # tar xzf nagios-3.2.3.tar.gz [root @ localhost downloads] # cd nagios-3.2.3 [root @ localhost nagios-3.2.3] #. /configure -- with-command-group = nagcmd -- with-gd-lib =/usr/lib -- with-gd-inc =/usr/include [root @ localhost nagios-3.2.3] # make all [root @ localhost nagios-3.2.3] # make install [root @ localhost nagios-3.2.3] # make install-init [root @ localhost nagios-3.2.3] # make install-config [root @ localhost nagios-3.2.3] # make install-commandmode
-
- [Root @ localhost nagios-3.2.3] # cp/usr/local/nagios/etc/objects/contacts. cfg/usr/local/nagios/etc/objects/contacts. cfg. bak [root @ localhost nagios-3.2.3] # vi/usr/local/nagios/etc/objects/contacts. cfg --- modify nagiosadmin: email
-
- [Root @ localhost nagios-3.2.3] # make install-webconf [root @ localhost nagios-3.2.3] # htpasswd-c/usr/local/nagios/etc/htpasswd. users nagiosadmin --- nagios
-
- [Root @ localhost nagios-3.2.3] # service httpd restart
-
--- Install nagios-plugins
- [root@localhost nagios-3.2.3]# cd ~/downloads[root@localhost downloads]# tar xzf nagios-plugins-1.4.15.tar.gz[root@localhost downloads]# cd nagios-plugins-1.4.15[root@localhost nagios-plugins-1.4.15]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios[root@localhost nagios-plugins-1.4.15]# make[root@localhost nagios-plugins-1.4.15]# make install
-
--- Install nagios-snmp-plugins
- [root@localhost nagios-plugins-1.4.15]# cd ~/downloads[root@localhost downloads]# wget http://nagios.manubulon.com/nagios-snmp-plugins.1.1.1.tgz[root@localhost downloads]# tar xzf nagios-snmp-plugins.1.1.1.tgz[root@localhost downloads]# cd nagios_plugins[root@localhost nagios_plugins]# perl -MCPAN -e shell
-
- cpan> install Net::SNMP
-
- [root@localhost nagios_plugins]# ./install.sh
-