I've added a feature to OliveTin-for-Channels to support getting "critical" (whatever that means to you ) CDVR log alerts via e-mail. There are 3 filters (let me know if more are needed) available that work in a this-or-this-or-this style. Basically any text you find in your CDVR server log where you'd like to get an e-mail the next time that same text string is found.
Matches to your filters will be continuously collected, and then sent at whatever frequency you choose. Find strings you'd like to use in the server log, and then you can test them using the "Generate Filtered Channels DVR Log" Action button to see how often they've occurred in the last x lines if you like.
You can monitor for failed recordings, Comskip failures, or pretty much whatever. You'll need to pull the most recent bnhf/olivetin:latest, use the docker-compose posted here, and add values to several newly required environment variables.
If you don't already have one you'll want to create an "app password" on your GMail or Yahoo Mail account to use for your password. You'll also need to identify the absolute path to your Channels DVR logs, if OliveTin is on the same host. Or, if that directory is on a different host, you can share it via Samba or NFS, and create a Docker-Volume to connect to it. It's basically the same process as setting up the DVR_SHARE variable, but this one is called LOGS_SHARE.
Multiple DVRs are supported. Be sure to run the basic "OliveTin Post-Install Healthcheck" to confirm you have everything set up correctly:
Updated docker-compose:
version: '3.9'
services:
olivetin: # This docker-compose requires little or no editing. Set the Environment variables section of Portainer.
# GitHub home for this project: https://github.com/bnhf/OliveTin.
# Docker container home for this project with setup instructions: https://hub.docker.com/repository/docker/bnhf/olivetin.
image: bnhf/olivetin:${TAG} # Add the tag like latest or test to the environment variables below.
container_name: olivetin
hostname: olivetin
dns_search: ${DOMAIN} # For Tailscale users using Magic DNS, add your Tailnet (tailxxxxx.ts.net) to use hostnames for remote nodes, otherwise use your local domain name.
ports:
- ${HOST_PORT}:1337
environment:
- CHANNELS_DVR=${CHANNELS_DVR_HOST}:${CHANNELS_DVR_PORT} # Add your Channels DVR server in the form CHANNELS_DVR_HOST=<hostname or ip> and CHANNELS_DVR_PORT=<port>.
- CHANNELS_DVR_ALTERNATES=${CHANNELS_DVR2_HOST}:${CHANNELS_DVR2_PORT} # Space separated list of alternate Channels DVR servers to choose from in the form hostname:port or ip:port.
- CHANNELS_CLIENTS=${CHANNELS_CLIENTS} # Space separated list of Channels DVR clients you'd like notifications sent to in the form hostname or IP.
- ALERT_SMTP_SERVER=${ALERT_SMTP_SERVER} # SMTP server to use for sending alert e-mails. smtp.gmail.com:587 for example.
- ALERT_EMAIL_FROM=${ALERT_EMAIL_FROM} # Sender address for alert e-mails.
- ALERT_EMAIL_PASS=${ALERT_EMAIL_PASS} # SMTP "app" password established through GMail or Yahoo Mail. Do not use your everyday e-mail address.
- ALERT_EMAIL_TO=${ALERT_EMAIL_TO} # Recipient address for alert e-mails.
- UPDATE_YAMLS=${UPDATE_YAMLS} # Set this to true to update config.yaml.
- UPDATE_SCRIPTS=${UPDATE_SCRIPTS} # Set this to true to update all included scripts.
- TZ=${TZ} # Add your local timezone in standard linux format. E.G. US/Eastern, US/Central, US/Mountain, US/Pacific, etc.
- PORTAINER_TOKEN=${PORTAINER_TOKEN} # Generate via <username> dropdown (upper right of WebUI), "My account", API tokens.
- PORTAINER_HOST=${PORTAINER_HOST} # Hostname or IP of the Docker host you're running Portainer on.
volumes:
- ${HOST_DIR}/olivetin:/config # Add the parent directory on your Docker you'd like to use.
- ${DVR_SHARE}:/mnt/${CHANNELS_DVR_HOST}-${CHANNELS_DVR_PORT} # This can either be a Docker volume or a host directory that's connected via Samba or NFS to your Channels DVR network share.
- ${LOGS_SHARE}:/mnt/${CHANNELS_DVR_HOST}-${CHANNELS_DVR_PORT}_logs # This can either be a Docker volume or a host directory that's connected via Samba or NFS to your Channels DVR logs network share.
#- ${DVR2_SHARE}:/mnt/${CHANNELS_DVR2_HOST}-${CHANNELS_DVR2_PORT} # Note that these volume mounts should always be to /mnt/hostname-port or /mnt/ip-port (dash rather than a colon between).
#- ${LOGS2_SHARE}:/mnt/${CHANNELS_DVR2_HOST}-${CHANNELS_DVR2_PORT}_logs # This can either be a Docker volume or a host directory that's connected via Samba or NFS to your Channels DVR logs network share.
restart: unless-stopped
static-file-server:
image: halverneus/static-file-server:latest
container_name: static-file-server2
dns_search: ${DOMAIN}
ports:
- ${HOST_SFS_PORT}:8080
environment:
- FOLDER=${FOLDER}
volumes:
- ${HOST_DIR}/olivetin/data:${FOLDER}
restart: unless-stopped
#volumes: # use this section if you've setup a docker volume named channels-dvr, with CIFS or NFS, to bind to /mnt/${HOST_DIR}-${HOST_PORT} inside the container. Set ${HOST_DIR} to channels-dvr (HOST_DIR=channels-dvr) in this example.
#channels-dvr:
#external: true
#channels-dvr-logs:
#external: true
And, sample environment variables:
TAG=latest
DOMAIN=tailxxxxx.ts.net
HOST_PORT=1337
CHANNELS_DVR_HOST=local-server
CHANNELS_DVR_PORT=8089
CHANNELS_DVR2_HOST=another-server
CHANNELS_DVR2_PORT=8089
CHANNELS_CLIENTS=appletv4k-den firestick-bedroom
ALERT_SMTP_SERVER=smtp.gmail.com:587
[email protected]
ALERT_EMAIL_PASS=xxxxxxxxxxxxxxxx
[email protected]
UPDATE_YAMLS=true
UPDATE_SCRIPTS=true
TZ=US/Mountain
HOST_DIR=/data
DVR_SHARE=/mnt/dvr
LOGS_SHARE=/mnt/channelsdvr
HOST_SFS_PORT=8080
FOLDER=/web
PORTAINER_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PORTAINER_HOST=htpc6