CentOS7 Yum 安装zabbix-agent 3.4

CentOS7 Yum 安装zabbix-agent 3.4

RHEL 7, Oracle Linux 7, CentOS 7 快速安装zabbix-agent 3.4

1、安装zabbix yum源
rpm -Uvh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
yum install zabbix-agent

2、直接安装zabbix-agent 3.4的rpm包
rpm -Uvh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-agent-3.4.5-1.el7.x86_64.rpm

3、启动服务
chkconfig zabbix_agent on;service zabbix_agent start(和自己编译的不太一样service zabbix_agentd start)

4、设置接收服务器zabbix_server
Received empty response from Zabbix Agent at [193.70.67.100]. Assuming that agent dropped connection because of access permission 出现这样的错误,是zabbix_agentd没有设置zabbix_server的IP地址,导致zabbix_server收不到信息而失败。
/etc/zabbix/zabbix_agentd.conf

sed -i "s/Server=127.0.0.1/Server=116.255.166.1/" /etc/zabbix/zabbix_agentd.conf
sed -i "s/ServerActive=127.0.0.1/ServerActive=116.255.166.1/" /etc/zabbix/zabbix_agentd.conf (主动模式)
116.255.166.1为zabbix_server的IP地址,如果你的server有多个IP地址,使用逗号分隔多个IP地址。

Linux 磁盘自检设置

Linux 磁盘自检设置
Linux磁盘自检可以通过自行设置自检时间间隔,自动对硬盘进行检测,第一时间监测硬盘的健康状况,提高硬盘可靠性。
不同的文件系统(xfs,reiserfs,ext4)都有自己的检测和修复工具,本文讲解ext4文件系统的磁盘自检设置方法。
1、检查指定硬盘的文件系统:
df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda2 xfs 32G 3.3G 29G 11% /
devtmpfs devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs tmpfs 7.8G 17M 7.8G 1% /run
tmpfs tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/sdb5 ext4 631G 297G 303G 50% /data
tmpfs tmpfs 1.6G 0 1.6G 0% /run/user/0

或者blkid /dev/sdb5
# blkid /dev/sdb5
/dev/sdb5: UUID="5e1f3504-8808-4ebb-82be-c318fcbd6d63" TYPE="ext4"

2、查看/etc/fstab确认挂载分区

3、查看相应硬盘的文件系统的自检时间
通过下面的命令可以显示ext文件系统相关参数:
tune2fs -l /dev/sdb5
tune2fs 1.42.9 (28-Dec-2013)
Filesystem volume name:
Last mounted on: /data
Filesystem UUID: 5e1f3504-8808-4ebb-82be-c318fcbd6d63
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags: signed_directory_hash
Default mount options: (none)
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 42000384
Block count: 167975624
Reserved block count: 8398781
Free blocks: 92897263
Free inodes: 42000355
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 983
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 512
Flex block group size: 16
Filesystem created: Mon Aug 7 16:04:19 2017
Last mount time: Thu Nov 30 15:02:15 2017
Last write time: Thu Nov 30 15:02:15 2017
Mount count: 12
Maximum mount count: 39
Last checked: Mon Aug 7 16:04:19 2017
Check interval: 15552000 (6 months)
Next check after: Sat Feb 3 16:04:19 2018
Lifetime writes: 10 GB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: 17716f76-ff63-402e-9ecd-00b0e400f6f0
Journal backup: inode blocks
或者
tune2fs -l /dev/sdb5 | grep 'Check interval'

4.修改Check interval自检间隔时间
Check interval指的是文件系统间隔多长时间进行一次完整性检查,您可以根据您的需要通过下面的命令手工指定:

tune2fs –i 30/dev/sdb5
其默认的单位是天,其他可用的单位有12m(12个月),7w(7周)