Summary of the 204th issue of Zabbix "Expert Consultation" Q&A

Question 1Q
: How to configure automatic discovery?

A: To configure automatic discovery in Zabbix, you can use the following steps:

  1. Log in to Zabbix's web interface.

  2. Make sure you have the Administrator or user role with appropriate permissions.

  3. Navigate to the Configuration menu and select Autodiscover.

  4. Click the "Create Autodiscover" button.

  5. In the Name field, enter a name for the Autodiscover rule.

  6. In the Newly Discovered Devices field, select how you want the device to be created during the autodiscovery process. You can choose to use hostnames, SNMP OIDs, IP ranges, or other options.

  7. Configure other auto-discovery rule options such as detection intervals, SNMP configuration (if applicable), IP ranges, etc.

  8. In the Filters section, you can set conditions to filter automatically discovered devices. For example, you can filter using attributes such as IP address, SNMP OID, system name, etc.

  9. In the Actions section, you can define the actions to be performed after autodiscovery. For example, you can automatically add hosts, trigger actions, notifications, etc.

  10. Click the "Add" button to save the autodiscover rule.

  11. On the Autodiscover Rules page, enable the rule and ensure that triggers, actions, and other related configurations are set correctly.

  12. Zabbix will perform automatic discovery at regular intervals based on your configuration and create new devices or perform other actions based on rules.

Q: What should I write in the key value? Insert image description here
A: When configuring automatic discovery of key values, you can use placeholders to represent dynamic values ​​so that they can be replaced with actual values ​​when data collection is actually performed.

Here are some common examples of autodiscover key-value configurations:

SNMP automatically discovers key values:

Get the CPU utilization of the SNMP device: snmp.get[{#SNMPINDEX},]

Get the interface status of the SNMP device: snmp.get[{#SNMPINDEX},ifOperStatus.{#SNMPVALUE}]

Get the memory usage of the SNMP device: snmp.get[{#SNMPINDEX},,]

In the above example, {#SNMPINDEX} and {#SNMPVALUE} are placeholders that will be replaced with the corresponding values ​​when the data collection is actually performed.

Question 2Q
: An error is reported when creating a prototype of a monitoring item. What is the problem?

Insert image description here
A: Automatic discovery rule names and key values ​​do not need to include {#SNMPINDEX}, monitoring item prototypes do.

Q: The automatic discovery rule name has been configured. How to prototype the monitoring item?

Insert image description here
Insert image description here
A: The monitoring item prototype is the way you configured it just now.

Q: Saving failed. Can be saved without adding. Insert image description here
Q: OK, just use variables to store the obtained values. Insert image description here
Question 3
Q: How should Zabbix alarm convergence be done?

A: Methods that can be considered to achieve alarm convergence:

  1. Merge duplicate alarms: When an alarm is triggered, you can check whether the same alarm notification has been sent before. If so, you can choose not to send duplicate notifications again, or to combine duplicate notifications into one.

  2. Set alarm delay: You can set a delay time. During this time period, if the same problem persists, only one alarm notification will be sent. This can avoid triggering the same alarm multiple times in a short period of time.

  3. Alarm upgrade: You can define alarm rules. When the same problem is triggered a certain number of times in succession, an alarm notification will be sent. This avoids short-term problems causing frequent alarms.

  4. Alarm shielding and silent time: For some alarms that do not need to be processed immediately, you can set shielding rules or silent time to prevent the sending of alarm notifications. During this time, alert notifications will be temporarily ignored.

  5. Alarm classification: Set different processing methods and notification frequencies for different levels of alarms. For example, critical-level alarm notifications are sent to the relevant person in charge, while warning-level alarm notifications are sent to the team.

Q: Teacher, how to implement the first and second methods?

A:

  1. Merge duplicate alarms:

    • In Zabbix's Actions configuration, you can choose to enable the "Repeat Interval" (Recovery operations) option.

    • Set an appropriate time interval, that is, within this time period, if the same problem persists, an alarm notification will be sent only once.

    • This can avoid triggering the same alarm multiple times in a short period of time.

    • This time interval can be adjusted according to specific needs and circumstances.

  2. Set alarm delay:

    • In Zabbix's trigger (Triggers) configuration, you can set the "alarm delay" (Trigger severity) of the trigger.

    • Alarm delay means that after an alarm is triggered, the alarm notification will not be sent for a certain period of time to avoid triggering the same alarm multiple times in a short period of time.

    • The appropriate alarm delay time can be set according to specific needs and conditions.

Q: I don’t seem to have this option here, the version is 5.0.
A: You can use the two operation types "send message" and "remote command" to implement some customized alarm convergence logic. Here's one possible way to do it:

  1. Use the "Send Message" action type:

    • In the action configuration, select "Send Message" as the action type.

    • In Message content, define the content of the alarm notification you want to send.

    • In the trigger condition, set the conditions of the trigger. When the conditions are met, the message sending operation will be executed.

    • In this way, relevant personnel can be notified by sending messages to inform them that an alarm event has occurred.

  2. Use the "remote command" action type:

    • In the operation configuration, select "Remote Command" as the operation type.

    • In the command parameters, define the custom script or command you want to execute.

    • In the trigger condition, set the conditions of the trigger. When the conditions are met, the remote command operation will be executed.

    • This allows you to process alarm convergence logic by executing custom scripts or commands.

Q: I have changed everything about sending messages, but nothing works. I set the custom message in the alarm medium, so this should have no effect. The second type is remote command. I monitor the disk, memory, etc., this kind of remote How to write the command?

A: You can define the duration of the action-operation and how long it lasts to send the alarm.

Q: Teacher, I set the time period for the trigger. I set it for ten minutes before. As long as it is triggered within ten minutes, an alarm will be sent, and then it will keep sending messages to DingTalk. It can send dozens of messages at a time. There are only three monitoring items in total, and they are all duplicated, so I want to solve them.

A: You can use the two operation types "send message" and "remote command" to implement some customized alarm convergence logic. Here's one possible way to do it:

  1. Use the "Send Message" action type:

    • In the action configuration, select "Send Message" as the action type.

    • In Message content, define the content of the alarm notification you want to send.

    • In the trigger condition, set the conditions of the trigger. When the conditions are met, the message sending operation will be executed.

    • In this way, relevant personnel can be notified by sending messages to inform them that an alarm event has occurred.

  2. Use the "remote command" action type:

    • In the operation configuration, select "Remote Command" as the operation type.

    • In the command parameters, define the custom script or command you want to execute.

    • In the trigger condition, set the conditions of the trigger. When the conditions are met, the remote command operation will be executed.

    • This allows you to process alarm convergence logic by executing custom scripts or commands.

Q: I have changed everything about sending messages, but nothing works. I set the custom message in the alarm medium, so this should have no effect. The second type is remote command. I monitor the disk, memory, etc., this kind of remote How to write the command?

A: You can define the duration of the action-operation and how long it lasts to send the alarm.

Q: Teacher, I set the time period for the trigger. I set it for ten minutes before. As long as it is triggered within ten minutes, an alarm will be sent, and then it will keep sending messages to DingTalk. It can send dozens of messages at a time. There are only three monitoring items in total, and they are all duplicated, so I want to solve them.
Q: What is the collection interval for monitoring items bound to triggers?

A: 100000 represents 10 o'clock, 100100 represents 10:01, and the value of the trigger expression configured here is less than or equal to 70.

Question 4
: Is there any tutorial on how to monitor tomcat with zabbix? Use the templates that come with zabbix.

A:https://www.cnblogs.com/yangzhaon/p/12102794.html

Question 5Q
: Zabbix calling script times out in Zabbix 6.0.10 centos7 system, but it can be executed locally. What is the problem?

A:

You can try the following solutions:

  1. Check the script path and permissions: Confirm that the script path is correct and ensure that the script has execution permissions.

  2. Increase the timeout for script execution: You can increase the timeout for script execution in the configuration file of the Zabbix server or agent. For Zabbix server, you can add or modify the Timeout parameter in the zabbix_server.conf file; for Zabbix agent, you can add or modify the Timeout parameter in the zabbix_agentd.conf file.

  3. Optimize the script: If the script execution time is too long, you can consider optimizing the script logic to reduce the execution time.

  4. Check network and system latency: Make sure the network connection and system load are normal. You can try increasing the timeout for script execution or taking other measures to resolve latency issues.

Question 6
Q: I want to use zabbix 4.2.3 to build a visualization system using grafana. Please ask which version of grafana and flowcharting should be used based on zabbix 4.2.3?

A:

Grafana version: Zabbix 4.2.3 has good compatibility with Grafana 6.x series. You can use Grafana 6.7.x or 6.8.x versions, which have been extensively tested and compatible with Zabbix 4.2.3.

Flowcharting plug-in version: You can use the Flowcharting plug-in to create flowchart visualizations in Grafana. According to Zabbix official documentation, Zabbix 4.2.x version is compatible with Flowcharting plugin version 2.0.0. Therefore, you can use Flowcharting version 2.0.0 to create flowchart visualizations.

For more zabbix technical issues, you can continue to pay attention to the Lewei community

Guess you like

Origin blog.csdn.net/weixin_43631631/article/details/133141132