I. Experimental environment
OS
|
CentOS 6.8 x86_64
|
Nagios Main Program
|
Nagios-4.1.1.tar.gz
|
Nagios Plugin
|
Nagios-plugins-2.1.1.tar.gz
|
Two. Configure domestic sources
#备份系统自带的yum源并更新缓存mv/etc/yum.repos.d/centos-base.repo/etc/yum.repos.d/centos-base.repo.backup# Download Ali's network source Wget-o/ Etc/yum.repos.d/centos-base.repo http://mirrors.aliyun.com/repo/Centos-6.repo# Update Cache yum Makecache
Three. Install Nagios
#创建用户组名为nagcmd用于从Web接口执行外部命令, both Nagios users and Apache users are added to this group.
Groupadd nagcmduseradd-g nagcmd nagiosusermod-g nagcmd Apache
Install dependent packages
Yum install-y gcc glibc glibc-common gd gd-devel xinetd openssl-develhttpd php php-devel MySQL mysql-develmysql-server
Download Nagios Program
wget HTTPS://ASSETS.NAGIOS.COM/DOWNLOADS/NAGIOSCORE/RELEASES/NAGIOS-4.1.1.TAR.GZTAR-ZXVF nagios-4.1.1.tar.gz && cdnagios-4.1.1./configure--prefix=/usr/local/nagios--with-nagios-user=nagios--with-nagios-group= Nagcmd unpack the package and pre-compile the configuration (the default user is Nagios, so just specify the group)
./configure --prefix=/usr/local/nagios--with-command-group=nagcmd# unzip the package and pre-compile the configuration (the default user is Nagios, so just specify the group) make all #编译Nagios程序包源码 make install #安装二进制运行程序 make install-init #初始化脚本 make install-config #配置文件样本 make install-commandmode #设置运行目录权限 make install-webconf #安装Nagios的WEB配置文件到Apache的conf. D directory to create a nagiosadmin user to log on to Nagios's web interface. htpasswd -c /usr/local/nagios/etc/htpasswd.usersnagiosadmin
This article is from the "hehe" blog, make sure to keep this source http://qweeqwee.blog.51cto.com/10085816/1919818
Enterprise-level monitoring of Nagios deployment (unfinished)