How to use filters to implement monitoring in Zabbix

How to use filters to implement monitoring in Zabbix

Recently, when I was working on monitoring equipment, there were always alarms about ports being down. After checking the data, I found that the port had been down all along. After it was shut down, the alarm would continue to be sent out after a while. The leader also gave me feedback on why there were so many monitoring items but so much data was missing, and then he gave a lot of explanations. Therefore, I thought of using filters and adding regular expressions to remove these monitoring items that have no practical significance, and recorded them for your reference. The specific operations shall be subject to the actual situation.
Filters, as the name implies, filter out unnecessary monitoring items, such as ports with no data, ports that are always down, virtual ports, etc. Using filters in automatic discovery rules is very helpful for our monitoring needs.

The following uses the port status and virtual port of network devices as an example to briefly talk about how to use filters to help us achieve monitoring effects. It can also be used in other templates with automatic discovery rules. Before filtering, you can first observe the actual data and then use the filter.

1. Filter out virtual ports (Virtual Interface)

As shown in the figure below, ports such as Vlanif (VirtualLocalAreaNetworkIterface) are generally logical ports of the device and do not exist physically. Similar ports include virtual interface, Vinterface, etc., which are all virtual ports. There is no practical significance in monitoring these virtual ports, so they can be filtered appropriately.


Filtering method: Add the regular expression ^Vlanif in the automatic discovery rule, then click Check Now and wait for automatic discovery again to filter such monitoring items.

2. No closed or unknown ports are found

Usually the port status has three value mappings, namely 0 Unknown, 1 On, and 2 Down. Of course, each model of device may be different and needs to be queried based on the actual device OID. We usually create a trigger when the port status is Down, but if the port is always Off and keeps sending alarm messages, this does not meet the actual monitoring needs. Alarms should be sent only when the port status changes from Up to Down. Therefore, it is necessary to filter ports that are in Down state during automatic discovery.

Open the port status monitoring item and copy the oid to the automatic discovery rule


Add a regular expression to the filter to filter out ports with a status of 2 (Down).

Then add it to the automatic discovery rules. After updating, click Check Now. After the rules rediscover the data, the ports with a status of Down will be filtered out.

Of course, this is done by adding and modifying templates one by one. It is not convenient when there are many templates. You can create a global expression in Configuration - General - Regular Expression, and then reference it in the automatic discovery rule.

Example:


Reference method: Click Add expression, enter the macro, and use @Network interfaces for discovery.


Regarding the use of regular expressions, you can refer to some tutorial learning websites, such as Novice Tutorial, W3Cschool, etc.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed explanation of monitoring Jenkins process based on zabbix
  • Detailed explanation of the process of Zabbix active, passive and web monitoring in distributed monitoring system
  • Distributed monitoring system Zabbix uses SNMP and JMX channels to collect data
  • Detailed explanation of Zabbix monitoring SQL Server service status
  • How to monitor mysql using zabbix
  • How does Zabbix monitor and obtain network device data through ssh?
  • Analysis of Linux Zabbix custom monitoring and alarm implementation process
  • Detailed tutorial for upgrading zabbix monitoring 4.4 to 5.0
  • Detailed steps for adding hosts you need to monitor in zabbix
  • Using zabbix to monitor the ogg process (Windows platform)

<<:  How to use Vue3 to achieve a magnifying glass effect example

>>:  MySQL master-slave replication configuration process

Recommend

Echarts Bar horizontal bar chart example code

Table of contents Horizontal bar chart Dynamicall...

JavaScript method to detect the type of file

Table of contents 1. How to view the binary data ...

Detailed explanation of how to use Vue to load weather components

This article shares with you how to use Vue to lo...

Some notes on mysql create routine permissions

1. If the user has the create routine permission,...

How to create a Django project + connect to MySQL

1: django-admin.py startproject project name 2: c...

ElementUI implements sample code for drop-down options and multiple-select boxes

Table of contents Drop-down multiple-select box U...

Solution to nginx-ingress-controller log persistence solution

Recently I saw an article on a public account tha...

React implementation example using Amap (react-amap)

The PC version of React was refactored to use Ama...

Parsing the commonly used v-instructions in vue.js

Table of contents Explanation of v-text on if for...

Build a Docker private warehouse (self-signed method)

In order to centrally manage the images we create...

MySQL uses variables to implement various sorting

Core code -- Below I will demonstrate the impleme...

How to convert JavaScript array into tree structure

1. Demand The backend provides such data for the ...

MySQL series 6 users and authorization

Table of contents Tutorial Series 1. User Managem...