Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement trigger interval in nagios

2025-02-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to achieve the trigger interval in nagios. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Go back to the important alarm section and mention it again:

The default detection time for nagios3.4.1 is every 5 minutes.

Check_interval 5 detection time

Retry_interval 1 retry interval

It was changed in the templates.cfg file.

2. The default time for sending email is 30 seconds. There is a parameter called notification_timeout=30 in nagios.conf.

3.

You can define the parameter normal_check_interval in define service, which overrides the default definition in the service inheritance template.

3min check once and write: define service {... Normal_check_interval 3... }

W arningu nreacheblec riticalr ecovery

Only one of these four states can send an alarm message, and those that are not needed can be removed.

Maximum number of retries for max_,. That is, the number of times to retry the check when a fault is found. When the set value is still abnormal, an alarm is issued.

The interval between normal_check_, checks. That is, how often do you check?

The interval between retry_, retries and max_ can be understood.

4. Change the interval of information frequency.

Vim nagios.cfg

Insert a sentence

Cfg_file=/usr/local/nagios/etc/objects/escalations.cfg

Vim / usr/local/nagios/etc/objects/escalations.cfg

Add the following

Define hostescalation {

Host_name 192.168.10.21 # monitored host name, consistent with hosts.cfg, with multiple hosts separated by commas

First_notification 5 # Article 5 message, change the frequency interval

Last_notification 0 # Article n message, recovery frequency interval

Notification_interval 600 # Notification interval (10 hours)

Contact_groups mygroup

}

Note: from the 5th tone warning all servers recover before the warning is sent to mygroup. The time is 10 hours.

Define serviceescalation {

Host_name 192.168.10.21 # monitored host name, consistent with Hosts.cfg

Service_description check_http,check_uptime # monitored service name, which is the same as in services.cfg

First_notification 5

Last_notification 0

Notification_interval 600

Contact_groups mygroup

}

Add completion test whether the configuration file is correct

/ usr/local/nagios/bin/nagios-v / usr/local/nagios/etc/nagios.cfg

If there is no problem with the test, just restart the nagios service and OK.

Service nagios restart

This is the end of the article on "how to achieve trigger interval in nagios". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report