jiabanl 发表于 2019-1-13 09:24:31

自动化运维之系统监控Nagios(一)安装部署

  一、系统环境
  操作系统:CentOS 7 (最小化安装)
  软件版本:Nagios 4.11 Pnp4nagios 0.6.25
  二、部署脚本
  安装脚本如下:
#!/bin/sh
#mysql密码
mysqlps=123
#nagios账户密码
nagiospa=123
#nagiosadmin账户密码
nagadps=123
#获取本机IP
hostip=` ip a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|awk -F / '{print $1}'|tail -1 `
#系统配置
systemctl stop firewalld.service
systemctl disable firewalld.service
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
setenforce 0
yum -y install epel-release
yum -y install bash-completion ntp mailx expect yum-axelget vim
echo "alias vi='vim'">>/etc/bashrc
echo "alias ll='ls -lh --color=auto'">>/etc/bashrc
echo "set nu">>/etc/vimrc
yum update -y
#安装LAMP
yum -y install httpd mariadb-server mariadb php php-mysql php-gd php-pear
systemctl start httpd
systemctl enable httpd
systemctl start mariadb
systemctl enable mariadb
expect
页: [1]
查看完整版本: 自动化运维之系统监控Nagios(一)安装部署