标签:ide 地址 仓库 web url linux服务器 name gpg agentd
Zabbix监控软件LAMP或LNMP环境
通过yum安装
yum -y install mariadb mariadb-server #安装数据库
systemctl start mariadb
mysqladmin -u root password ‘password123‘
cp -r /abc/Zabbix软件包 /Zabbix
mv yum源所需 yum
createrepo /Zabbix/yum #生成yum仓库目录
修改本地yum源公钥检测为0,修改目录为/Zabbix
vim /etc/yum.repos.d/a.repo
[a]
name=a
baseurl=file:///Zabbix/yum/
gpgcheck=0
enable=0
yum -y install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent
mysql -u root -ppassword123
create database zabbix character set utf8 collate utf8_bin; #创建数据库
grant all privileges on zabbix.* to zabbix@localhost identified by ‘password456‘; #赋权
zcat /usr/share/doc/zabbix-server-mysql-3.4.1/create.sql.gz | mysql -u zabbix -p zabbix #导入脚本进zabbix
vim /etc/zabbix/zabbix_server.conf #修改server配置文件
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=password456
cp /etc/zabbix/zabbix_agentd.conf /etc/zabbix/.zabbix_agentd.conf.bak
vim /etc/zabbix/zabbix_agentd.conf
Server=127.0.0.1 #指定server主机地址(被动)
ServerActive=127.0.0.1 #指定server地址(主动)
Hostname=linux-server001
systemctl start zabbix-server
systemctl enable zabbix-server
搭建GNS3
R1:
conf t
int e0/0
ip add 192.168.10.100 255.255.255.0
no sh
exit
no ip routing
snmp-server community centos RO
snmp-server enable traps #开启主动上传模式
snmp-server host 192.168.10.1 centos #指定zabbix服务器
监控Linux服务器
cd /abc/Zabbix软件包/yum源所需/
rpm -ivh zabbix-agent-3.4.1-1.el7.x86_64.rpm
vim /etc/zabbix/zabbix_agentd.conf
Server=192.168.10.1 #指定server主机地址(被动)
ServerActive=192.168.10.1 #指定server地址(主动)
Hostname=linux-server001
systemctl start zabbix-agent.service
netstat -anpt | grep agent
yum -y install httpd
mkdir /etc/zabbix/zabbix_scripts
cd /etc/zabbix/zabbix_scripts
vim check_httpd.sh
#!/bin/bash
a=netstat -anpt | grep httpd
if [[ -n $a ]]
then
echo "2"
else
echo "0"
fi
vim /etc/zabbix/zabbix_agentd.conf
UnsafeUserParameters=1 #支持自定义脚本
vim /etc/zabbix/zabbix_agentd.d/userparameter_httpd.conf
UserParameter=check_httpd,sh /etc/zabbix/zabbix_scripts/check_httpd.sh
标签:ide 地址 仓库 web url linux服务器 name gpg agentd
原文地址:https://blog.51cto.com/13968682/2372939