Article title: naigos implements monitoring of SMS alarms. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
1. install nagios on the server
# Vim nagios-install
#! /Bin/bash
#### For nagios client installation, note the install nagios section ###
# Install nagios
Tar zxvf nagios-3.0.6.tar.gz cd nagios-3.0.6./configure -- prefix =/usr/local/nagios -- with-nagios-user = nagios -- with-nagios-group = nagios
Make all
Make install
Make install-init
Make install-config
Make install-commandmode
Make install-webconf
Cd ..
# Install nagios-plugins
Tar zxvf nagios-plugins-1.4.13.tar.gz cd nagios-plugins-1.4.13./configure -- prefix =/usr/local/nagios
Make
Make install
Cd ..
# Install nrpe
Tar zxvf nrpe-2.12.tar.gz cd nrpe-2.12./configure -- enable-ssl -- enable-command-args
Make all
Mkdir-p/usr/local/nagios/etc
Mkdir-p/usr/local/nagios/bin
Cp sample-config/nrpe. cfg/usr/local/nagios/etc/
Cp src/nrpe/usr/local/nagios/bin/
Sed-I's/127.0.0.1/127.0.0.1, 192.168.1.253/'/usr/local/nagios/etc/nrpe. cfg sed-I's/usr \/local/nagios/g'/usr/local/nagios/etc/nrpe. cfg
II. start nrpe
#/Usr/local/nagios/bin/nrpe-c/usr/local/nagios/etc/nrpe. cfg-d if you need to restart nrpe, killall-9 nrpe and then start
3. configure nagios
After Nagios is successfully installed, there are several directories in/usr/local/nagios:
Bin etc libexec sbin share var
1. create a linux directory under/usr/local/nagios/etc and create a hosts. cfg file.
The content in this file is divided into three major parts: (1) define the host, that is, host (2), define the monitoring group, that is, hostgroup (3), and define the services of the monitoring host, server
Example:
# Define webgroup host for the testers machine # Define a host
Define host {
Host_name web01
Alias web01.com address 192.168.1.10
Check_command check-host-alive
Max_check_attempts 10
Check_period 24x7
Icationication_interval 20
Icationication_period 24x7
Notification_options d, r
Contact_groups admins
Name web01
}
Define host {
Host_name web02
Alias web02.com address 192.168.1.20
Check_command check-host-alive
Max_check_attempts 10
Check_period 24x7
Icationication_interval 20
Icationication_period 24x7
Notification_options d, r
Contact_groups admins
Name web02
}
Define host {
Host_name web03
Alias web03.com address 192.168.1.20
Check_command check-host-alive
Max_check_attempts 10
Check_period 24x7
Icationication_interval 20
Icationication_period 24x7
Notification_options d, r
Contact_groups admins
Name web02
}
[1] [2] [3] Next page