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 tasks that use the same Returner, you may just want to add a
schedule_returner line instead:
schedule_returner: mysql schedule: loadavg_monitoring: function: status.loadavg minutes: 10 diskusage_monitoring: ...