环境
IP | OS | HOSTNAME | packages |
---|---|---|---|
192.168.220.138 | centos7 | server | nagios-4.3.1.tar.gz nagios-plugins-2.2.1.tar.gz nrpe-3.1.0.tar.gz |
192.168.220.139 | centos7 | client | mysql |
大致流程
环境简易安装
[root@server ~]# yum install httpd php gcc glibc gd gd-devel unzip mysql-devel -y
[root@server ~]# systemctl start httpd
[root@server ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@server ~]# cat >> /var/www/html/index.php << eof
> <?php
> phpinfo();
> ?>
> eof
测试下环境
[root@server ~]# curl 192.168.220.138 -L
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<style type="text/css">
body {
background-color: #ffffff; color: #000000;}
body, td, th, h1, h2 {
font-family: sans-serif;}
pre {
margin: 0px; font-family: monospace;}
......
安装nagios
创建用户
[root@server ~]# useradd nagios
[root@server ~]# groupadd nagcmd
[root@server ~]# usermod -G nagcmd nagios
[root@server ~]# usermod -G nagcmd apache
解压文件
[root@server ~]# tar -zxvf nagios-4.3.1.tar.gz
[root@server ~]# cd nagios-4.3.1/
[root@server nagios-4.3.1