Alerting

There is an interesting quote from a system administrator on the web: “In god we trust, everything else we monitor."

To ensure that systems that have to be active 24/7 are working correctly, they should be monitored. cherryEPG has several options for this purpose.

Outsourcing to other monitoring systems

This job can of course be outsourced. All system-relevant data can be accessed via a web interface. \
You can get a system report in JSON https://ip_address_of_your_system:12323/report.json or TXT https://ip_address_of_your_system:12323/report.txt format.

Notification over e-mail

cherryEPG is already using a centralized logging system. All reports can be routed to the database and to the console. By default it is configured to log only messages with at least info level. This can be changed in the /var/lib/cherryepg/config.yml file.

The section for configuring logging starts with log4perl. Please be carefull when making changes to this as it can stop cherryEPG from working.

config file

configuration for mail notifications

The shown settings work perfectly with gmail accounts. But any other SMTP/SMTPS server should work.

For security reasons, Google will block access to your account in the first step. You need to allow less secure apps to access your account. Please read more here
We recommend to not use your regular mail account for this.

The section relevant for mailing can contain also additional recipients cc, bcc. The mail can be in format with Peter <peter@your-company.com> or without name noc@your-company.com.

You can test the connection to your SMTP server by running cherryTool -Z "This is a check of the mail server"

By setting log4perl.appender.Mail.Debug = 1 you will see the output of the connection to the mail server.

The setting of log4perl.appender.Mail.Threshold defines the threshold for log entries to be sent over mail. There are six log levels in descending priority: FATAL, ERROR, WARN, INFO, DEBUG, and TRACE.
By setting log4perl.appender.Mail.Threshold = ERROR all log entries with level ERROR or higher will by sent by mail.

Example when using starttls

log4perl.appender.Mail                = cherryEpg::Log4perlMail
log4perl.appender.Mail.Threshold      = WARN
log4perl.appender.Mail.layout         = Log::Log4perl::Layout::NoopLayout
log4perl.appender.Mail.Host           = smtp.gmail.com:587
log4perl.appender.Mail.auth           = username:password
log4perl.appender.Mail.doSSL          = starttls,
log4perl.appender.Mail.to             = recipient_mail@mail.com
log4perl.appender.Mail.cc             = Peter <my_friend@company.com>
log4perl.appender.Mail.bcc            = your_boss@company.com
log4perl.appender.Mail.from           = Watchdog <sender_mail@gmail.com>
log4perl.appender.Mail.Debug          = 0
log4perl.appender.Mail.warp_message   = 0

Example for servers without authentication on standard port 25

log4perl.appender.Mail                = cherryEpg::Log4perlMail
log4perl.appender.Mail.Threshold      = WARN
log4perl.appender.Mail.layout         = Log::Log4perl::Layout::NoopLayout
log4perl.appender.Mail.Host           = smtp.your.server:25
log4perl.appender.Mail.auth           =
log4perl.appender.Mail.doSSL          =
log4perl.appender.Mail.to             = recipient_mail@mail.com
log4perl.appender.Mail.cc             = Peter <my_friend@company.com>
log4perl.appender.Mail.bcc            = your_boss@company.com
log4perl.appender.Mail.from           = Watchdog <sender_mail@gmail.com>
log4perl.appender.Mail.Debug          = 0
log4perl.appender.Mail.warp_message   = 0