zabbix监控硬件及服务(详解)一

    科技2024-05-15  81

    一.items监控项(详解) 1.简介:监控内存包含很多维度,某一个维度(信息是数值还是字母,获取数据的间隔。) 2.获取监控数据方式 zabbix-agent SNMP-简单的网际管理协议 3. 取值的数据类型/单位 磁盘容量单位一般为B(记住) 网卡流量单位为bps MySQL每秒select,insert,每秒访问量 qps CPU Interrupts per second ips 每秒的中断总数。 user time float % Context switches per second sps 每秒上下文切换 进程线程切换 Host boot time unixtime 系统启动的时间 4.监控Key :组合命令 5.获取数据的间隔:1s 1m 6.历史数据保存的时间 7.趋势数据保存的时间 二.默认项示例 Linux OS 模板,关于mem的项目有5个 三.新建items示例 监控项:服务器启动分区剩余空间。 帮助

    语法 key vfs.fs.size[fs,<mode>] 说明 vfs.fs.size[fs,<mode>] Calculate disk space for a given volume. Disk space in KB. If mode is missing total is used. In case of mounted volume, unused disk space for local file system is returned. 示例 vfs.fs.size[/,free]

    1.新增模板

    2.新增监控项 3.查看项 4.监控图形

    5.查看图形 6.新建聚合图形 根据主机/业务分类,监控一台主机的不同项。创建聚合图形,需要选择所有者(有权限的用户)。并不是任何人都有权限看到聚合图形。

    就只有一个图形所以两个是一样的 7.项加入聚合图形 监控项:服务器网络接口进出流量 帮助

    网卡流量的监控key net.if.in[if,<mode>] Network interface input statistic. Integer value. If mode is missing bytes is used. net.if.out[if,<mode>] Network interface output statistic. Integer value. If mode is missing bytes is used. net.if.total[if,<mode>] Sum of network interface incoming and outgoing statistics. Integer value. Mode - one of bytes (default), packets, errors or dropped

    1.新建项IN 注意:您的网络接口名称可能是eth0 在配置》模板》刚刚新建的模板》监控项》创建监控项 2.新建项out 3.新建项all 4.新建项MEM 5.创建图形 6.模板关联主机 8.最新数据

    9.创建聚合图形 监控项:服务器服务状态 帮助:

    帮助 监控服务端口key net.tcp.listen[port] Checks if this port is in LISTEN state. 0 - it is not, 1 - it is in LISTEN state. net.tcp.port[<ip>,port] Check, if it is possible to make TCP connection to the port number. 0 - cannot connect, 1 - can connect. IP address is optional. If ip is missing, 127.0.0.1 is used. Example: net.tcp.port[,80] net.tcp.service[service,<ip>,<port>] Check if service is available. 0 - service is down, 1 - service is running. If ip is missing 127.0.0.1 is used. If port number is missing, default service port is used. net.tcp.service.perf[service,<ip>,<port>] Check performance of service "service". 0 - service is down, sec - number of seconds spent on connection to the service. If ip is missing 127.0.0.1 is used. If port number is missing, default service port is used. Example: net.tcp.service[ftp,,45]. http,192.168.100.10,80

    图示 还有其它监控项例子请看(详解二)。

    Processed: 0.017, SQL: 8