8. Alerting

NetSpyGlass has built-in alerting framework that can watch monitoring variables using complex condition-matching rules and send notifications to several notification streams. At this time notifications can be sent to log, email, Slack and Pager Duty. Administrator can apply silencing rules to “mute” active alerts, that is, prevent them from sending notifications. JSON API can be used to get lists of alerts, as well as get lists of active silences and manipulate them.

At the end of each polling cycle, the server scans Python scripts found in the directory scripts/alerts, looking for those that declare a function (or several functions) with name that starts with alert_(). If a script like this found, the program executes it.