This example will collect and send alerts every 5 minutes via a cron
job. Note that other job-scheduling mechanisms are also supported.
*/5 * * * * sdb-report send-alert --alert-location alertconfig.yaml
Change Default Thresholds
A JSON file may also be passed into sdb-report send-alert
via the --thresholds
flag to set your own warning and failure alert thresholds. Refer to the tables on the Next Steps page for the list of configurable thresholds.
For example, the following JSON file changes the offlineLeaves
fail threshold to >= 2
(overriding the default >=1
) and increases the Memory Committed
warning threshold to 75
.
Additionally, it will change the default result for the OrphanDatabases
checker; instead of resulting in a warning when there are Orphan databases present, it will instead increase the urgency of the output and upgrade it to a failure. You can apply this change to other checkers that are based on output as well.
config.json:
{
"leavesNotOnline":{
"fail":2
},
"memoryCommitted":{
"warn":75.0
},
"orphanDatabases":{
"output_level":"fail"
}
}
Run the following command to pass this file in, or pass this into the scheduling job that was created in the previous step (Step 4).
sdb-report send-alert \
--alert-location alertconfig.yaml \
--thresholds config.json
Troubleshooting
If the sdb-report send-alert
command displays an error or does not complete successfully, rerun the command with the --vvv
flag to produce verbose output.