Book Image

Mastering SaltStack - Second Edition

Book Image

Mastering SaltStack - Second Edition

Overview of this book

SaltStack is a powerful configuration management and automation suite designed to manage servers and tens of thousands of nodes. This book showcases Salt as a very powerful automation framework. We will review the fundamental concepts to get you in the right frame of mind, and then explore Salt in much greater depth. You will explore Salt SSH as a powerful tool and take Salt Cloud to the next level. Next, you’ll master using Salt services with ease in your infrastructure. You will discover methods and strategies to scale your infrastructure properly. You will also learn how to use Salt as a powerful monitoring tool. By the end of this book, you will have learned troubleshooting tips and best practices to make the entire process of using Salt pain-free and easy.
Table of Contents (20 chapters)
Mastering SaltStack Second Edition
Credits
Foreword
About the Author
About the Reviewer
www.PacktPub.com
Preface

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 5, 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.

Note

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...