Maintenance periods

In Zabbix, it is possible to create a maintenance period for the times we need to do some maintenance on our servers. It would be awkward to get a bunch of notifications when we know that our servers are down for a certain period of time. In Zabbix we can split maintenance periods in two major types, maintenance with and without data collection.

Getting ready

For this recipe, we need our Zabbix server with administrator rights. We also need at least one host set up and added in our Zabbix configuration. We will make use of this host to show you how to add a host or a group in maintenance period.

How to do it...

  1. Go to the Zabbix menu to Configuration | Maintenance.
  2. Click on Create maintenance period to see the window as shown in the following screenshot:
    How to do it...
  3. Fill in a Name for our maintenance period.
  4. Select the Maintenance type: No data collection.
  5. Select the Active since date.
  6. Select the Active till date.
  7. Add a Description so that people know why there is a maintenance foreseen.
  8. Click on the Periods tab to view the window seen in the following screenshot:
    How to do it...
  9. Select from the Period type box if the maintenance has to happen one time, Daily, Weekly, or Monthly. In this example, I have chosen Weekly.
  10. In Every week(s), we fill in if it has to happen every week or every 2 weeks. Similarly, if you have chosen days, it will be every day or every 2 days and so on.
  11. Select the Day of the week or the months if you have selected months.
  12. In the At (hour:minute) box, you can give the time at which the maintenance period has to start.
  13. In Maintenance period length, you add how long the maintenance window has to last.
  14. Next go to the tab Hosts & Groups.
  15. Select what host or what group you want to maintain and click on Add.
    How to do it...
  16. When we go to Configuration | Hosts, we will see that our host is In maintenance mode:
    How to do it...

How it works…

From the Maintenance tab, we have selected the start and the end day of our maintenance period. We also told Zabbix to collect or not collect data.

We then went to the Periods tab. In this tab, we were able to do some more fine-tuning in our maintenance schedule, for example, recurring periods on a weekly basis.

From our Periods tab, we went to the Hosts & Groups tab where we selected all hosts and / or host groups that we wanted to place in maintenance.

There's more…

During a maintenance period With data collection, Zabbix will process triggers and create events as usual. So when we reboot servers or shutdown services, we will get notified about those events. If you would like to skip notifications during the maintenance period, then we have to put the Maintenance status = not in maintenance in the trigger action by navigating to Configuration | Actions | Triggers.

If a trigger generates an event during the maintenance period, then once the maintenance period has ended, an additional event will be created. This is to make sure that if a problem happened during the maintenance period, you will get notified about the problem if it is not resolved even after the maintenance period is over.

Tip

Remember that there are two types of maintenance periods:

With data collection: Data will be collected by the server during maintenance, triggers will be processed, and event will be created.

No data collection: Data will not be collected by the server during maintenance period. Last check in latest data will stay at the same time.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.163.239