Send and Schedule Alerts min read


Send Alerts

The following is the simplest implementation of the sdb-report command and will use the default thresholds. You may also configure your own thresholds for the checkers in this file using the configuration reference in Next Steps.

The following command will set up alerts to the SMTP server (which was installed and configured in the previous step) and will generate and send an alert exactly once to the location specified in the YAML file. This “one-liner” is a convenient method for testing your configuration before officially scheduling your alerts.

sdb-report send-alert --config-file config.yaml

Refer to sdb-report send-alert for more information on the available command-line arguments.

Scheduling Alerts

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 --config-file config.yaml

Troubleshooting

If you receive a timeout error, confirm that the port you are using for your SMTP (in this case, Postfix) is open and listening. The default Postfix port is 25. If it is blocked on your host, you can change the port that Postfix uses by editing the first line of the /etc/postfix/master.cf file.

Find the first instance of the word smtp in this file and replace smtp with the port number that is available. For example:

smtp     inet  n       -       n       -       -       smtpd

Changing smtp to 1025 will change the smtp port to 1025.

1025     inet  n       -       n       -       -       smtpd

If you change this port, you will also need to update the port in your alert configuration file to use the same port.

After making this changes to the master.cf file, reload Postfix:

sudo postfix reload

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.