Monitoring with returners

As we discussed in the previous chapter, returners have the ability to store the job return data from minions in an external data store. This is ideal for monitoring situations because the external data store can be used to establish a baseline.

One of the best ways to set up Salt so that it starts to collect data is to use the minion's scheduler. For our example, we'll assume that you're using the mysql returner. Go ahead and add the following code to your minion configuration:

schedule: 
  loadavg_monitoring: 
    function: status.loadavg 
    minutes: 10 
    returner: mysql 
  diskusage_monitoring: 
    function: status.diskusage 
    minutes: 10 
    returner: mysql 

Note that both of these have the returner set to mysql. If you are scheduling a lot of ...

Get Mastering SaltStack - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.