[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

[Zabbix3.4] Suppress the occurrence of alerts on specific days of the week using triggers

Hello.

My name is Miyazaki and I work in the Operations Management Division of the System Solutions Department.

Today I would like to introduce a trigger that suppresses alerts from occurring on specific days of the week in ZABBIX3.4.
Nakagawa from the Technical Sales Department has also written an article titled [ZABBIX3.4] Setting monitoring exclusion time

Trigger function to specify a specific day of the week

The trigger function that specifies a particular day of the week is "dayofweek".

The following was written in Zabbix Documentation 2.2.
https://www.zabbix.com/documentation/2.2/jp/manual/appendix/triggers/functions

They range from 1 to 7,
1 - Monday,
2 - Tuesday
,

7 - Sunday
, etc.

Below is an example of a trigger condition expression.

The trigger conditional expression is as follows.
{test-wd01:agent.ping.nodata(5m)}=1 and
({test-wd01:agent.ping.dayofweek(0)}=7)=0

The upper conditional expression checks whether the data "agent.ping" of the host "test-wd01" has not responded for 5 minutes using the nodata function.
The lower conditional expression uses the dayofweek function to check what day of the week the data "agent.ping" of the host "test-wd01" is.
This is an expression that connects these with and.

Let's actually test it using the conditional expression builder.
Select Expression Builder and click Test.

If there is no response for 5 minutes on Monday,

return
{test-wd01:agent.ping.nodata(5m)}=1 ({test-wd01:agent.ping.dayofweek(0)}=7)=0
Select 1 to say Monday.

The conditions are connected with and, and both are TRUE, so an alert is generated.

If there is no response for 5 minutes on Sunday,

return
{test-wd01:agent.ping.nodata(5m)}=1 ({test-wd01:agent.ping.dayofweek(0)}=7)=0
Let's choose 7 and say it's Sunday.

The conditional expression for dayofweek is now FALSE.
Since the conditions are connected with and, the alert will not occur unless both are true.

Trigger explanation

{test-wd01:agent.ping.dayofweek(0)}=7
In the above case, if the value in dayofweek is 7 (Sunday), it will be TRUE.

({test-wd01:agent.ping.dayofweek(0)}=7)=0
However, if you enclose it in () and set =0 at the end, it means to negate what is enclosed in ().
By doing this, if the value entered in dayofweek is 7 (Sunday), it will be FALSE.

summary

As introduced in the link along the way, there are many trigger functions, so it seems possible to write complex conditions.
Also, if I come across any interesting conditions, I would like to introduce them.

That's it.

If you found this article helpful , please give it a like!
0
Loading...
0 votes, average: 0.00 / 10
4,956
X facebook Hatena Bookmark pocket
[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

The person who wrote this article

About the author

Kenta Miyazaki

I joined Beyond in 2017 as a new graduate.

We provide 24-hour, 365-day operation, maintenance, and monitoring services for servers and clouds used by companies that primarily provide web-based services.
I belong to the System Solutions Department, and my job is to improve Beyond's operations so that our customers can focus on their business.

Certifications: AWS Certified Solutions Architect, GCP Professional Cloud Architect, Linuc1