Book Image

Mastering SaltStack

By : Joseph Hall
Book Image

Mastering SaltStack

By: Joseph Hall

Overview of this book

Table of Contents (19 chapters)
Mastering SaltStack
About the Author
About the Reviewers

Setting up alerts

Now that you've seen various ways to monitor Minions, let's go ahead and set up some alerts.

Alerting in State files

In Chapter 4, Managing Tasks Asynchronously, we discussed how to use the Reactor system to file incidents in the PagerDuty service in response to events. Our example also made use of the disk.status monitoring state.


Keep in mind that any state inside an SLS file can raise an alert; monitoring states are not alone here.

Alerting from beacons

As beacons are designed to do nothing more than send an event when a certain threshold is reached, they are perfect for alerting purposes! Let's go ahead and set up a couple of examples.

Watching file changes

Let's go back to inotify for a moment. Say that you're using the /etc/hosts file to manage local DNS lookups. You may have some software that manages this file for you, perhaps automatically adding entries as necessary; you want to be notified via e-mail when this happens.

First off, the Minion needs to be properly configured...