zabbix监控配置流程
- 创建主机
- 创建主机组并加入主机
- 添加监控项
- 添加触发器
- 配置媒介
- 配置动作
- 手动触发告警
添加被监控的主机
详细流程 在zabbix图形页面——配置——主机——创建主机(定义主机名称、添加群组、填写被监控端主机IP地址)——模板——选定要监控的模板(httpd sshd服务)——选择——添加(添加连接模板)——添加(添加主机)
zabbix监控配置
- 手动添加监控项
- 使用模板添加监控项(有局限性,你需要的监控功能可能没有,还有可能有不需要的监控项)
添加监控操作实列
安装zabbix监控软件
[root@localhost ~]
CentOS Stream release 8
[root@localhost ~]
[root@localhost ~]
[root@web ~]
[root@web ~]
[root@web ~]
[root@web ~]
[root@web ~]
[root@web src]
https://cdn.zabbix.com/zabbix/sources/stable/6.2/zabbix-6.2.2.tar.gz
[root@web src]
[root@web src]
[root@web zabbix-6.2.2]
--enable-agent Turn on build of Zabbix agent and client utilities
--enable-agent2 Turn on build of Zabbix agent 2
[root@web zabbix-6.2.2]
[root@web zabbix-6.2.2]
***********************************************************
* Now run 'make install' *
* *
* Thank you for using Zabbix! *
* <http://www.zabbix.com> *
***********************************************************
[root@web zabbix-6.2.2]
[root@web zabbix-6.2.2]
[root@web etc]
zabbix_agentd.conf zabbix_agentd.conf.d
[root@web etc]
Server=192.168.141.134
ServerActive=192.168.141.134
Hostname=long
[root@web etc]
[root@web etc]
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 128 0.0.0.0:10050 0.0.0.0:*
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 128 [::]:22 [::]:*
[root@web etc]
[root@web ~]
zabbix_agentd
[root@localhost ~]
lrwxrwxrwx. 1 root root 13 Dec 2 2020 /etc/rc.local -> rc.d/rc.local
[root@localhost ~]
[root@localhost ~]
-rwxr-xr-x. 1 root root 502 Sep 4 14:47 /etc/rc.d/rc.local
[root@localhost ~]
[root@web harbor]
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enab>
Active: inactive (dead) since Mon 2022-09-05 21:02:52 CST; 9s ago
Docs: man:firewalld(1)
Process: 1008 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exite>
Main PID: 1008 (code=exited, status=0/SUCCESS)
Sep 05 20:34:16 web systemd[1]: Starting firewalld - dynamic firewall daemon...
Sep 05 20:34:17 web systemd[1]: Started firewalld - dynamic firewall daemon.
Sep 05 20:34:17 web firewalld[1008]: WARNING: AllowZoneDrifting is enabled. This is consid>
Sep 05 21:02:51 web systemd[1]: Stopping firewalld - dynamic firewall daemon...
Sep 05 21:02:52 web systemd[1]: firewalld.service: Succeeded.
Sep 05 21:02:52 web systemd[1]: Stopped firewalld - dynamic firewall daemon.
[root@web harbor]
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@web harbor]
Enforcing
[root@web harbor]
[root@web harbor]
[root@web harbor]
创建主机
  
 主机添加成功 
创建主机组并加入主机
    
添加监控项
选择模板添加监控项
     刷新一下可用性会变绿。 
可以在最新数据查看信息  
手动添加监控项
可用选择查看过程添加的模板的监控项  在这里查看有哪有些监控项然后可用安装模板中有的选择自己需要的   创建监控的文件
[root@web harbor]
[root@web tmp]
systemd-private-3807b4d002704709ad30edc8d0a949a4-chronyd.service-mrn576 zabbix_agentd.log
vmware-root_961-4248090753 zabbix_agentd.pid
vmware-root_989-4257069338
[root@web tmp]
[root@web tmp]
total 8
-rw-r--r--. 1 root root 0 Sep 5 21:16 abc
drwx------. 3 root root 17 Sep 5 20:34 systemd-private-3807b4d002704709ad30edc8d0a949a4-chronyd.service-mrn576
drwx------. 2 root root 6 Sep 5 20:34 vmware-root_961-4248090753
drwx------. 2 root root 6 Sep 4 21:25 vmware-root_989-4257069338
-rw-rw-r--. 1 zabbix zabbix 2523 Sep 5 20:57 zabbix_agentd.log
-rw-rw-r--. 1 zabbix zabbix 4 Sep 5 20:37 zabbix_agentd.pid
[root@web tmp]
 查看是否有添加的监控项   添加信息到abc中
[root@web tmp]
可用在最新的500个值有信息显示  再添加就会有新的不一样的数据,但是没有报警,所以要添加触发器
[root@web tmp]

添加触发器
 
    查看触发器配置是否成功   修改文件触发报警机制,验证配置的触发器是否成功
[root@web tmp]
[root@web tmp]
[root@web tmp]
这里会出现报警声音,在仪表盘可用看见报警问题 
配置媒介
创建发生问题的邮箱   选择你需要通知的邮箱,然后查找邮箱服务器的地址和授权密码   
 这里是问题出现的通知格式,按个人需求配置 
接受问题信息的邮箱   添加配置后选择更新 
配置动作
选择触发器的动作,把原来的配置禁用,创建一个新的       
手动触发报警
查看当前500个值  触发
[root@web tmp]
[root@web tmp]
[root@web tmp]
数值改变  问题在仪表盘显示  在收的邮箱查看 收到了问题显示 
|