Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ CentOS 6.7 install Nagios Tutorials     - Python type way of comparison (Programming)

- CentOS 6.6 source compiler GCC upgrade to 4.8.2 (Linux)

- libnet list of functions (Programming)

- Analysis of Java keyword final (Programming)

- Ubuntu install Eclipse can not find JAVA_HOME problem (Linux)

- Linux software firewall ACL match point optimization (Linux)

- Ubuntu install driver manager Mint Driver Manager and Device Driver Manager (Linux)

- Linux Detailed instructions alias settings (Linux)

- Git Getting Started tutorial (Linux)

- PHP 7.0 Upgrade Notes (Linux)

- Thinking in Java study notes - initialization and cleanup (Programming)

- The simple multi-threaded Python (Programming)

- Docker: Mirroring and container operations (Server)

- Java development environment to build under Ubuntu (Linux)

- Build Golang development environment configuration on Ubuntu 14.04 (Linux)

- Ubuntu 15.10 How to install TeamViewer 11 (Linux)

- Use FirewallD build dynamic firewall (Linux)

- Eclipse, Tomcat configuration JNDI connection Oracle data source example (Server)

- Ubuntu amend resolv.conf restart failure problem (Linux)

- Depth understanding of C language (Programming)

 
         
  CentOS 6.7 install Nagios Tutorials
     
  Add Date : 2018-11-21      
         
       
         
  CentOS 6.7 install Nagios Tutorials
Reference document: https: //assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/quickstart-Fedora.html

A. Installing dependencies

[Root @ Nagios ~] # yum install -y httpd php
[Root @ Nagios ~] # yum install -y gcc glibc glibc-common
[Root @ Nagios ~] # yum install -y gd gd-devel
[Root @ Nagios ~] # yum install -y perl ntp unzip
[Root @ Nagios ~] # yum install -y openssl-devel

[Root @ Nagios ~] # /etc/init.d/ntpd start
[Root @ Nagios ~] # chkconfig ntpd on

[Root @ Nagios ~] # / usr / sbin / useradd -m nagios
[Root @ Nagios ~] # passwd nagios

[Root @ Nagios ~] # / usr / sbin / groupadd nagcmd
[Root @ Nagios ~] # / usr / sbin / usermod -a -G nagcmd nagios
[Root @ Nagios ~] # / usr / sbin / usermod -a -G nagcmd apache
[Root @ Nagios ~] # id nagios
uid = 500 (nagios) gid = 500 (nagios) groups = 500 (nagios), 501 (nagcmd)
[Root @ Nagios ~] # id apache
uid = 48 (apache) gid = 48 (apache) groups = 48 (apache), 501 (nagcmd)

Two .nagios installation

[Root @ Nagios ~] # cd / usr / local / src
[Root @ Nagios src] # wget http://nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz
[Root @ Nagios src] # wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.1.1.tar.gz
[Root @ Nagios src] # tar zxvf nagios-4.1.1.tar.gz
[Root @ Nagios src] # cd nagios-4.1.1
[Root @ Nagios nagios-4.1.1] # ./configure --prefix = / usr / local / nagios --with-comand-group = nagcmd
[Root @ Nagios nagios-4.1.1] # make all
[Root @ Nagios nagios-4.1.1] # make install
[Root @ Nagios nagios-4.1.1] # make install-init
[Root @ Nagios nagios-4.1.1] # make install-config
[Root @ Nagios nagios-4.1.1] # make install-commandmode
[Root @ Nagios nagios-4.1.1] # make install-webconf
[Root @ Nagios nagios-4.1.1] # cp -rf contrib / eventhandlers / usr / local / nagios / libexec /
[Root @ Nagios nagios-4.1.1] # chown -R nagios: nagios / usr / local / nagios / libexec / eventhandlers

Three .nagios plugins installed

[Root @ Nagios src] # tar xzf nagios-plugins-2.1.1.tar.gz
[Root @ Nagios src] # cd nagios-plugins-2.1.1
[Root @ Nagios nagios-plugins-2.1.1] # ./configure --prefix = / usr / local / nagios --with-nagios-user = nagios --with-nagios-group = nagios
[Root @ Nagios nagios-plugins-2.1.1] # make && make install

Four .nrpe plug-in installation

[Root @ Nagios src] # wget http://nchc.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
[Root @ Nagios src] # tar zxf nrpe-2.15.tar.gz
[Root @ Nagios src] # cd nrpe-2.15
[Root @ Nagios nrpe-2.15] # ./configure --prefix = / usr / local / nagios
[Root @ Nagios nrpe-2.15] # make all
[Root @ Nagios nrpe-2.15] # make install-plugin
[Root @ Nagios nrpe-2.15] # make install-daemon
[Root @ Nagios nrpe-2.15] # make install-daemon-config


# Test start
# / Usr / local / nagios / bin / nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

# Comes with a startup script
[Root @ Nagios nrpe-2.15] # cp -rf init-script.in /etc/init.d/nrpe
[Root @ Nagios nrpe-2.15] # chmod a + x /etc/init.d/nrpe
[Root @ Nagios ~] # /etc/init.d/nrpe start

Note: In fact, access to information are relying on nagios / usr / local / nagios / libexec / check_nrpe script initiative to obtain information on the service side nrpe

V. configure and start the service

[Root @ Nagios ~] # vi /usr/local/nagios/etc/objects/contacts.cfg
define contact {
        contact_name nagiosadmin
        use generic-contact
        alias Nagios Admin
        email ca0gu0@126.com
        }

[Root @ Nagios ~] # vi /usr/local/nagios/etc/objects/commands.cfg
define command {
        command_name check_nrpe
        command_line $ USER1 $ / check_nrpe -H "$ HOSTADDRESS $" -c "$ ARG1 $"
}
        
[Root @ Nagios ~] # htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

# Check the configuration file is correct
[Root @ Nagios ~] # / usr / local / nagios / bin / nagios -v /usr/local/nagios/etc/nagios.cfg

[Root @ Nagios ~] # chkconfig nagios on
[Root @ Nagios ~] # service nagios start

[Root @ Nagios ~] # chkconfig nrpe on
[Root @ Nagios ~] # /etc/init.d/nrpe start

[Root @ Nagios ~] # chkconfig httpd on
[Root @ Nagios ~] # service httpd start
[Root @ Nagios ~] # touch /var/www/html/index.html

VI. Configuring Mail send

[Root @ Nagios ~] # yum -y install mailx
[Root @ Nagios ~] # echo "mail test" | mail -s test ca0gu0@126.com

# If not specified, the default will send mail mail.rc local postfix
#email send tools
#nano /etc/mail.rc
#set from=s0lence@126.com smtp = smtp.126.com
#set smtp-auth-user = xx @ oo smtp-auth-password = xxoo
#set smtp-auth = login
     
         
       
         
  More:      
 
- How to install Go1.5 source development environment on Mac (Server)
- open V switch port mirror in OpenStack neutron (Server)
- Go powerful development server simple example (Server)
- Git 2.5 increase in the working tree, triangle improved workflow performance (Linux)
- Add a custom encryption algorithm in OpenSSL (Linux)
- Linux see whether there is a hacker program (Linux)
- Install Ruby on Rails in Ubuntu 15.04 in (Linux)
- Linux server security settings to close unused ports (Linux)
- CentOS 7.0 local address and configure yum source address priority (Linux)
- Hadoop1.2.1 plug compilation (Server)
- pscp use Detailed Windows and Linux each file transfer tool (Linux)
- Android components series Activity (Programming)
- Linux character device - user mode and kernel mode data transfer data (Linux)
- Boost notes --Asio - (1) a simple small example of synchronous communication (Programming)
- Linux ban single-user mode to enhance system security (Linux)
- Oracle 11g modify MEMORY_TARGET (Database)
- Linux yum command Detailed (Linux)
- Linux data recovery software efficiently practical application extundelete (Linux)
- Diagnose and resolve the SSH connection slow (Linux)
- Camera-based face recognition OpenCV crawl and storage format (Python) (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.