首页 > 其他分享 >zabbix监控配置项配置

zabbix监控配置项配置

时间:2022-09-06 03:11:30浏览次数:66  
标签:Sep 0.0 配置 zabbix 监控 128 root localhost LISTEN

  • 创建主机并加入主机组



1.手动添加监控项


即获取数据的监控指标
增加用户,修改用户,删除用户etc/passwd文件都会发生改变,

添加监控录像

[root@client ~]# cd /tmp/
[root@client tmp]# ls
vmware-root_866-2722763301  vmware-root_932-2722632322  zabbix_agentd.pid
vmware-root_916-2689078442  vmware-root_941-4022177618
vmware-root_927-3980167416  zabbix_agentd.log
[root@client tmp]# touch abc
[root@client tmp]# ll
total 12
-rw-r--r--. 1 root   root      0 Sep  6 00:08 abc
drwx------. 2 root   root      6 Sep  5 23:41 vmware-root_866-2722763301
drwx------. 2 root   root      6 Sep  5 23:43 vmware-root_916-2689078442
drwx------. 2 root   root      6 Sep  5 23:39 vmware-root_927-3980167416
drwx------. 2 root   root      6 Sep  5 23:23 vmware-root_932-2722632322
drwx------. 2 root   root      6 Sep  4 20:43 vmware-root_941-4022177618
-rw-rw-r--. 1 zabbix zabbix 4686 Sep  5 23:48 zabbix_agentd.log
-rw-rw-r--. 1 zabbix zabbix    4 Sep  5 23:48 zabbix_agentd.pid
[root@client tmp]# 



[root@client tmp]# echo "haha" > abc

[root@client tmp]# echo "haha" >> abc
[root@client tmp]# cat abc
haha
haha



添加触发器




[root@client tmp]# echo "haha" >> abc
[root@client tmp]# echo "haha" >> abc
[root@client tmp]# cat abc 
haha
haha
haha
haha


配置媒介


配置动作


然后需要更新




手动触发警告

[root@client tmp]# echo "haha" >> abc
[root@client tmp]# cat abc 
haha
haha
haha
haha
haha
[root@client tmp]# 


2. 使用模板添加监控项

添加监控对象





因防火墙没关,获取不到数值,才会变红

[root@client ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset>
   Active: active (running) since Mon 2022-09-05 09:27:28 CST; 13h ago
     Docs: man:firewalld(1)
 Main PID: 980 (firewalld)
    Tasks: 2 (limit: 24717)
   Memory: 38.8M
   CGroup: /system.slice/firewalld.service
           └─980 /usr/libexec/platform-python -s /usr/sbin/firewalld --nofork --nopid

Sep 05 09:27:28 agent1 systemd[1]: Starting firewalld - dynamic firewall daemon...
Sep 05 09:27:28 agent1 systemd[1]: Started firewalld - dynamic firewall daemon.
Sep 05 09:27:28 agent1 firewalld[980]: WARNING: AllowZoneDrifting is enabled. This i>
[root@client ~]# systemctl disable --now firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@client ~]# getenforce
Enforcing
[root@client ~]# setenforce 0
[root@client ~]# vim /etc/selinux/config
SELINUX=disabled

3.0 邮件告警

  • 用命令行发送邮件
[root@localhost ~]# dnf -y install mailx
[root@localhost ~]# ss -antl
State   Recv-Q   Send-Q     Local Address:Port      Peer Address:Port  Process  
LISTEN  0        128              0.0.0.0:22             0.0.0.0:*              
LISTEN  0        128              0.0.0.0:10050          0.0.0.0:*              
LISTEN  0        128              0.0.0.0:10051          0.0.0.0:*              
LISTEN  0        128            127.0.0.1:9000           0.0.0.0:*              
LISTEN  0        128                    *:3306                 *:*              
LISTEN  0        128                    *:80                   *:*              
LISTEN  0        128                 [::]:22                [::]:*              
LISTEN  0        70                     *:33060                *:*              
[root@localhost ~]# dnf -y install postfix
[root@localhost ~]# systemctl enable --now postfix
Created symlink /etc/systemd/system/multi-user.target.wants/postfix.service → /usr/lib/systemd/system/postfix.service.
[root@localhost ~]# ss -antl
State   Recv-Q   Send-Q     Local Address:Port      Peer Address:Port  Process  
LISTEN  0        128              0.0.0.0:22             0.0.0.0:*              
LISTEN  0        100            127.0.0.1:25             0.0.0.0:*              
LISTEN  0        128              0.0.0.0:10050          0.0.0.0:*              
LISTEN  0        128              0.0.0.0:10051          0.0.0.0:*              
LISTEN  0        128            127.0.0.1:9000           0.0.0.0:*              
LISTEN  0        128                    *:3306                 *:*              
LISTEN  0        128                    *:80                   *:*              
LISTEN  0        128                 [::]:22                [::]:*              
LISTEN  0        100                [::1]:25                [::]:*              
LISTEN  0        70                     *:33060                *:*              
[root@localhost ~]# hostnamectl set-hostname localhost.example.com
You have new mail in /var/spool/mail/root
[root@localhost ~]# bash
[root@localhost ~]#  echo "hello world" | mail -s "test page" [email protected]



[root@localhost ~]# cd /usr/local/etc/
[root@localhost etc]# ls
zabbix_agentd.conf    zabbix_server.conf
zabbix_agentd.conf.d  zabbix_server.conf.d
[root@localhost etc]# vim zabbix_server.conf
# AlertScriptsPath=${datadir}/zabbix/alertscripts
AlertScriptsPath=/scripts/  ---添加这一行
[root@localhost etc]# mkdir -p /scripts
[root@localhost etc]# cd /scripts/
[root@localhost scripts]# ls
[root@localhost scripts]# vim sendmail.sh
#!/bin/bash

echo "$1" | mail -s "$2" $3
[root@localhost scripts]# chmod +x sendmail.sh 
[root@localhost scripts]# ll
total 4
-rwxr-xr-x 1 root root 41 Sep  6 02:39 sendmail.sh
[root@localhost scripts]# cd
[root@localhost ~]# ll /
total 24
lrwxrwxrwx.   1 root root    7 May 19  2020 bin -> usr/bin
dr-xr-xr-x.   5 root root 4096 Aug  1 15:52 boot
drwxr-xr-x   20 root root 3140 Sep  5 23:23 dev
drwxr-xr-x.  85 root root 8192 Sep  6 02:30 etc
drwxr-xr-x.   2 root root    6 May 19  2020 home
lrwxrwxrwx.   1 root root    7 May 19  2020 lib -> usr/lib
lrwxrwxrwx.   1 root root    9 May 19  2020 lib64 -> usr/lib64
drwxr-xr-x.   2 root root    6 May 19  2020 media
drwxr-xr-x.   3 root root   18 Aug  1 15:50 mnt
drwxr-xr-x.   3 root root   18 Sep  3 14:38 opt
dr-xr-xr-x  281 root root    0 Sep  5 23:23 proc
dr-xr-x---.   7 root root 4096 Sep  6 02:39 root
drwxr-xr-x   24 root root  700 Sep  5 23:23 run
lrwxrwxrwx.   1 root root    8 May 19  2020 sbin -> usr/sbin
drwxr-xr-x    2 root root   25 Sep  6 02:39 scripts
drwxr-xr-x.   2 root root    6 May 19  2020 srv
dr-xr-xr-x   13 root root    0 Sep  5 23:23 sys
drwxrwxrwt.  11 root root 4096 Sep  6 02:31 tmp
drwxr-xr-x.  12 root root  144 Aug  1 15:49 usr
drwxr-xr-x.  20 root root  278 Aug  1 15:55 var
[root@localhost ~]# /scripts/sendmail.sh "maxiaorui" "qixiaoting" [email protected]

  • 在web页面配置





重启

[root@localhost ~]# pkill zabbix
[root@localhost ~]# ss -antl
State   Recv-Q   Send-Q     Local Address:Port      Peer Address:Port  Process  
LISTEN  0        128              0.0.0.0:22             0.0.0.0:*              
LISTEN  0        100            127.0.0.1:25             0.0.0.0:*              
LISTEN  0        128            127.0.0.1:9000           0.0.0.0:*              
LISTEN  0        128                    *:3306                 *:*              
LISTEN  0        128                    *:80                   *:*              
LISTEN  0        128                 [::]:22                [::]:*              
LISTEN  0        100                [::1]:25                [::]:*              
LISTEN  0        70                     *:33060                *:*              
[root@localhost ~]# zabbix_server 
[root@localhost ~]# zabbix_agentd 
[root@localhost ~]# ss -antl
State   Recv-Q   Send-Q     Local Address:Port      Peer Address:Port  Process  
LISTEN  0        128              0.0.0.0:22             0.0.0.0:*              
LISTEN  0        100            127.0.0.1:25             0.0.0.0:*              
LISTEN  0        128              0.0.0.0:10050          0.0.0.0:*              
LISTEN  0        128              0.0.0.0:10051          0.0.0.0:*              
LISTEN  0        128            127.0.0.1:9000           0.0.0.0:*              
LISTEN  0        128                    *:3306                 *:*              
LISTEN  0        128                    *:80                   *:*              
LISTEN  0        128                 [::]:22                [::]:*              
LISTEN  0        100                [::1]:25                [::]:*              
LISTEN  0        70                     *:33060                *:*              
[root@localhost ~]# 


标签:Sep,0.0,配置,zabbix,监控,128,root,localhost,LISTEN
From: https://www.cnblogs.com/marymary/p/16660046.html

相关文章

  • zabbix监控详细
    目录zabbixzabbix创建主机组设置主机组名字创建主机添加监控项使用模板方式添加手动添加监控项创建一个被监控的目录[root@localhost~]#mkdir/tmp/test......
  • zabbix监控Linux和Windows
    zabbix监控Linux和Windows目录zabbix监控Linux和Windowszabbix监控Linuxlinux部署agentd创建监控主机创建主机组并加入主机模板方式添加监控项手动添加监控项添加触发器添......
  • zabbix监控配置
    zabbix监控配置配置层次:1.创建主机并加入到主机组2.添加监控项使用模板添加自定义模板手动加监控项3.添加触发器4.添加媒介5.添加动作6.手动触发告警zabbix监......
  • zabbix监控配置
    zabbix监控配置目录zabbix监控配置zabbix通过web界面配置邮件告警zabbix配置客户端监控创建主机组创建监控主机并将主机加入主机组添加监控项配置触发器配置媒介配置动作......
  • zabbix部署
    目录linux部署zabbix监控创建监控主机创建主机组并加入主机添加监控项添加触发器添加媒介添加动作手动触发告警windos部署zabbix监控linux部署zabbix监控zabbix客户......
  • docker实战教程(二):镜像加速器配置
    注册阿里云账户打开控制台--容器镜像服务找到镜像加速器配置docker加速器sudomkdir-p/etc/dockersudotee/etc/docker/daemon.json<<-'EOF'{"registry-mir......
  • webpack基础_2基本配置
    基本配置在开始使用Webpack之前,我们需要对Webpack的配置有一定的认识。5大核心概念entry(入口)指示Webpack从哪个文件开始打包。output(输出)指示Webpack打......
  • emo——给项目配置prettier,eslint,husky加强协作规范
    前言给自己的一个初始化项目配置一些规范;Prettier-Codeformatter:Prettier-CodeformatterESLint:ESLintGitgitignore:https://git-scm.com/docs/gitignore#......
  • 九、Spring Boot 静态资源访问配置
    使用场景:有一些文件需要让用户直接访问的静态资源,例如导入excel的模板或者小的图标当我们使用SpringMVC框架时,静态资源会被拦截,需要添加额外配置,springboot是帮我们处理......
  • VMware安装CentOS7详细步骤,以及配置网络环境,Linu目录结构
    VMware安装CentOS7详细步骤,以及配置网络环境,Linu目录结构一、新建虚拟机配置取虚拟机名称与选择安装位置(注意不要有中文与空格)注释:存放虚拟机的位置一定要有......