编译安装nagios-core

编译安装nagios-core

   小白     2021年1月12日 09:09     1236    

1.安装web环境

测试环境,现在把防火墙和selinux都停掉

关闭防火墙:systemctl stop firewalld

临时关闭selinuxsetenforce 0

永久关闭selinuxsed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config

 

yum安装环境

yum install -y httpd php gcc glibc glibc-common gd gd-devel make net-snmp mysql-devel  unzip

启停apache

systemctl start apache

systemctl stop apache

 

2.安装nagios

1)下载

linux下直接下载,但是比较慢,可以用迅雷下载后,传到服务器上。

wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.6.tar.gz

解压开tar -zxvf nagios-4.4.6.tar.gz

2)配置并编译

./configure -prefix=/usr/local/nagios

make all

 

在配置用户的时候,可以自己手动创建用户和组,也可以使用以下命令

make install-groups-users
usermod -a -G nagios apache

                                              1.png

安装主文件、CGIsHTML文件

make install

安装服务

make install-init

配置文件安装

make install-config

权限配置

make install-commandmode

安装nagiosapache配置文件

make install-webconf

 

nagios网页验证的配置

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

 

验证nagios的配置文件

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

 

重启apache

systemctl restart httpd

 

启动nagios

systemctl start nagios

systemctl enable nagios

 

访问

http://ip/nagios


文章评论

0

其他文章