Joke Collection Website - Blessing messages - Zabbix alarm configuration

Zabbix alarm configuration

overview

suppose we have configured some monitoring items and triggers, and now we will get some events when the trigger status changes. It is time to consider the next step.

we can't keep staring at the trigger or the event list, and it's better to send a warning when some landmark events happen. When problems occur, users who pay attention to them will be notified.

the main function provided by zabbix is to send alarms, which is the reason. Who are these people? At what time? What information should be received can be defined.

in order to send and receive alerts from zabbix, you must:

define the media

configure the action of sending information to the defined media

The action consists of trigger conditions and actions. Basically, when the conditions are met, the operation is executed. The two main operations are sending messages and executing remote commands

In order to discover and automatically register created events, some additional operations are available, including adding or deleting hosts, Link templates, etc.

1. Media types

Overview

Media is a delivery channel used to send messages and alarms of zabbix

You can define the media types

E-mail

SMS

Jabber

EzTexting

Custom alert scripts

1. E-mail

to define an e-mail transmission channel for messages, you need to configure e-mail as the media type and deliver the specified address to the user

Configure

Click Manage in turn ——> Alarm media type, Click Create Media Type (or click the predefined media type E-mail)

The media type table contains the usual media type attributes

All important fields will be marked with red stars

Name Media Type Name

TypeSelect Email as the type

SMTP server Set stmp Server as the exit for processing information

SMT. P server port sets the port of smtp service. This parameter supports

SMTP helo from zabbix3.. This is the correct stmp link value, usually the domain name

SMTP email. This address will be used for the sender of information to send messages. Add the display name of the sender such as Zabbix_info, and Zabbix _ info <; gaoxiaoxu@126.com>

several configurations that can take effect:

gaoxiaoxu@126.com only has an email address and does not need angle brackets

zabbix _ info <; Gaoxiaoxu@126.com displays the name and email address, and the address is written in angle brackets

Monitoring system gaoxiaoxu@126.com uses UTF-8 display name

Connection security to select the link security level, and None means that ssl option is not used. Starttls uses the CURLOPT_USE_SSL parameter, and SSL/TLS uses the CURLOPT_USE_SSL optional

SSL verify peer to mark the SSL certificate of checkbox synchronization SMTP service.

Authentication authentication method

Username username

Password password

Enabled media

Note: In order to make the authentication option in SMTP available, zabbix, You need to take the --with-libcurl parameter and use cURL7.2. or later

second tab options

second tab options to configure the alarm processing flow. The same options configuration exists in other media types.

all media are processed in parallel. at present, each media is defined by itself, but the total number of alarm processing of zabbix service is limited by the parameter (zabbix _ sever.conf) startalerters. The alarm generated by the same trigger will be serialized.

options table

The number of concurrent sessions, three options, one (one), unlimited (unlimited) and custom (custom)

Attempts to send the alarm. If it is set to 1, zabbix will send this notice, and will not resend

attempts when it fails. Frequency of resending notifications, and interval of resending when sending fails

Configure the user's media

Click Administration in turn-> Users

click the user's property sheet, click add

type in the Media table to select Email as the type

send to specify email address, and you can click add to add multiple addresses. Similarly, this address can also be set with a display name such as zabbix _ admin <: Gaoxiaoxu@126.com or gaoxiaoxu@126.com

when active sets the sending time such as working days (1-5, 9:-18:) You can use the macro

Use if severity to specify the alarm level you want to accept.

status is enabled or not.

2. SMS

zabbix sends short messages. Connect to the serial port

Prerequisites:

Serial device (normally in linux/dev. Zabbix does not set the speed of the serial link.

zabbix user has read and write access to serial devices. Run ls -l /dev/ttyS to view the current access.

The GSM debugging demodulator has a PIN code, and the PIN can also be disabled by using the command AT+CPIN="NNNN ".It must have double quotation marks.

the tested modem Siemens mc35 teltonika modem com/G1

to configure SMS as the sending channel, you need to configure SMS as the media type and configure the receiving phone number in the user interface

Configure

Click Administration---> Media types, click to create a Media type or use the pre-configured

sms media type table attribute

Description media type name

Type to select SMS

GSM modem to select devices such as /dev/ttyS

options tab, see E-mail

configure user media

and then click Administration-> Users

Click on the user's property sheet, and click add

types in the Media table to select SMS as the medium

Send to enter the user's mobile phone number

When active sets the sending time such as working days (1-5, 9:-18:) You can use the macro

Use if severity to specify the alarm level you want to accept

whether status is enabled or not

3, Jabber

4, Ez Texing

5, Custom alertscripts

If you are not satisfied with the existing media, send a warning. You can customize scripts to send

warning scripts are executed on the zabbix server, and these scripts are located in the server configuration file AlertScriptsPath variable (default/usr/local/share/zabbix/alertscripts)

Script example:

#! /bin/bash

to=$1

subject=$2

body=$3

cat < < Eof | mail-s "$ subject" "$ to"

$ body eof

starting from 3.4, zabbix will check the exit code(shell execution return code, is successful). If the exit code is not equal to , it is considered that the execution has failed, and zabbix will repeatedly execute

the script without saving the environment variable, so the environment variable should be specified accurately

. Media types, Click create media type

mediatype table property

Name to enter the name of the media

Type to select Script as the type

Script name to enter the name of the script (script file in zabbix server)

Script parameters to add command line parameters to the script.

macros such as ALERT.SENDTO}, {ALERT.SUBJECT} and {ALERT.MESSAGE} can be supported.

{ALERT.SENDTO} value of send to in user media

{ALERT.SUBJECT} Default subject in action configuration

{ALERT.MESSAGE} The processing flow is defined in the Default message

options table in the action configuration. See the description of E-mail.

Configure User media

Click Administration-> Users

click the user's attribute table, and click add

User's Media attribute

Type in the media table to select the media type of the custom script

Send to specify the alarm receiver

When active sets the sending time such as working days (1-5, 9:-18:) You can use the macro

Use if serverity to specify the alarm level you want to accept.

Whether status is enabled or not

2. action

If you want some actions to be triggered when an event occurs, then you need to configure Action

Action to define all supported event types.

Event type:

Trigger events.

Discovery events

Auto registration events

When a new agent is automatically registered, or when the registered host metadata changes

Internal events

When the monitoring item becomes unsupported or the trigger state becomes unknown,

Configure an action

in turn—>; Actions

select the required source from the event source (including trigger source, automatic source discovery, automatic source registration, Event source)

click create action

select conditions for operation execution

select specific operation

select restore operation

properties of action table

Name unique action name

type of calculation

select calculation method triggered by conditions

And all conditions must be met

Or only one is required. Only

And/Or can be combined if the conditions are met, and different types of conditions can be combined with And, The same type of conditions with Or

Custom expression user-defined

Conditions trigger action of a series of conditions,

New condition selects a new action trigger condition

Enabled to enable the action

condition setting

trigger-based condition

Application set

Host group

Template

Host

Tag. Tag (string)

tag value tag value

Trigger

Trigger name

Trigger severity trigger level

Time period trigger time

whether the problem is suppressed trigger problem is expected, For example, host maintenance

based on the condition of automatic discovery

Host ip specifies the automatic discovery range format of host IP address: single IP: 192.168.1.33 range IP: 192.168.1-11.1-254? Ip mask: 192.168.4。 /24

Service type

service port

Discovery rule