Critical CDVR Log Alerts via E-Mail

Turns out you can put multiple addresses in the ALERT_EMAIL_TO variable. Comma separated, no spaces. Just tested it, and appears to work fine.

That worked thanks ... see you underestimated your coding ... :clap:

Great stuff! Indeed, very useful to know about failed/corrupted recordings. :+1:

Or also if the DVR fails to tune to a channel.
Many uses for it. :slightly_smiling_face:

An idea for improvement: offer a selection of predefined key words for common situations that people may be interested in. Maybe with check boxes.
Just an idea and I know not all ideas are good. :person_shrugging:

1 Like

I could definitely do something along those lines.

For anybody who speaks "grep", post your favorite pattern matches for CDVR logs in this thread. And, if they seem useful to others, we'll add them to this Action one way or another.

Alternatively, for those that don't know grep from a gripe, post a sample CDVR log line of something you'd like to be alerted about, and I'll work one up.

1 Like

I'll start:

[ERR] Failed to start stream on channel

1 Like

EDIT: Added [DVR] Deleting job no longer in the guide:

Category-Corrupted/Failed recording
ended prematurely:
[DVR] Deleting job no longer in the guide:
[DVR] Error running job
[DVR] Job cancelled:
[DVR] Marking expired job
[DVR] Skipping job
[ERR] Could not start stream
[ERR] Error during stream
[ERR] Failed to start stream
[ERR] Probe failed for live stream
[HLS] Couldn't generate stream playlist
[MTS] Rewriting video timestamps
[TNR] Cancelling stream

Category-DVR critical
panic recovered
runtime error
[ERR] Could not start server

2 Likes

If you decide to make check marks, can you allow a way to add your own.... the way it is now. Can we be able to keep filters 2 and 3 when set right now after a restart they go back to default.

This sends me the number of channels after a scan is complete.

[TVE] Channel scan finished

Thank you for continuing to add features to this. I set this up very early after you first released it, and now went to update it, following these instructions, and I got hit with a whole host of errors about variables not being set. I presume these are variables that are now required, that we're required before (HOST_DIR, etc.). Can I just use the sample variables you have in your post, or do I need to tinker and figure out my situation? Docker is a bit of a mystery to me, so that might take some doing.

UPDATE: The answer is no (and probably should have been obvious to me), you can't use the sample variables. I'm not sure how to even find out several of them (any of them having to do with Docker, really), so I reverted to my old settings. Sorry for my cluelessness.

Give me some specific examples of which variables you're unsure of what the values should be and I'll see if I can clarify.

Also, maybe post your current set of values, and I'll confirm if those look correct. Newer versions of the env vars might have an item or two that needs to be redacted, but yours is probably good to post as-is.

Thank you. I probably have a hodgepodge of variables that are used with my old setup, and unused after I entered a few and then reverted, but here's what I have:

CHANNELS_DVR=192.168.7.180:8089
UPDATE_YAMLS=true
UPDATE_SCRIPTS=true
TZ=US/Eastern
CHANNELS_CLIENTS=192.168.7.252 192.168.7.166 192.168.7.225 192.168.7.226 192.168.7.164 192.168.7.183 
HOST_DIR=/data
HOST_SFS_PORT=8080
FOLDER=/web
TAG=latest
DOMAIN=tailaaxxxx.ts.net
CHANNELS_DVR_HOST=http://192.168.7.180
CHANNELS_DVR_PORT=8089
HOST_PORT=1337

I think these are the ones I'm uncertain about:

HOST_DIR=/data
DVR_SHARE=/mnt/dvr
LOGS_SHARE=/mnt/channelsdvr
HOST_SFS_PORT=8080
FOLDER=/web
PORTAINER_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PORTAINER_HOST=htpc6

I presume I can figure out how to get the PORTAINER_TOKEN following the instructions.

I obfuscated my Tailscale domain above, but in my settings it is correct and copied from my Tailscale account.

Thank you.

Remind of your setup please. Where is CDVR running? Where are Docker and Portainer running? Is it all on one computer? What OS's are running?

I have it all (Channels, Docker, Portainer) running on an M1 Mac Mini. It's running Sonoma 14.2.1.

Here's what I'd suggest:

TAG=latest
DOMAIN=tailxxxxx.ts.net
HOST_PORT=1337
CHANNELS_DVR_HOST=192.168.7.180
CHANNELS_DVR_PORT=8089
CHANNELS_CLIENTS=192.168.7.252 192.168.7.166 192.168.7.225 192.168.7.226 192.168.7.164 192.168.7.183 
ALERT_SMTP_SERVER=
ALERT_EMAIL_FROM=
ALERT_EMAIL_PASS=
ALERT_EMAIL_TO=
UPDATE_YAMLS=true
UPDATE_SCRIPTS=true
TZ=US/Eastern
HOST_DIR=
DVR_SHARE=
LOGS_SHARE=
HOST_SFS_PORT=8080
FOLDER=/web
PORTAINER_TOKEN=
PORTAINER_HOST=192.168.7.180

On Docker Desktop for Mac the directories you can access from Docker are defined here:

You can add additional directories if needed. But you need to determine where you want to store your OliveTin data, and often /Users/<your_username> is a good option -- then use that for HOST_DIR.

Next figure out the absolute path for the folder that contains your CDVR folders. Mine are here:

That path is what you want to use for DVR_SHARE. If the top level of that path is not on your list of shared resources in Docker Desktop (as shown above) you'll need to add it.

Same for determining LOGS_SHARE. It's the path to the folder that has sub-folders like this:

The e-mail stuff needs to be GMail or Yahoo Mail, both of which support "app passwords", which is similar to a token. You can create more than one, and revoke it if you're ever concerned that it's been compromised. Use the Gmail smtp server info above, or Google what it is if you use Yahoo Mail.

All of the variables above should have values for OliveTin to have full functionality. Let me know if I can help with further clarifications.

I could not use Gmail kept getting unauthorize ... there is something I think I have to do on my email Account but not sure what it is ... I am using my comcast email.

I with don't think you can use Gmail directly -- it needs to be with an "app password", as described here:

Geez that was easy the google help sent me on a wild goose chase.

Thanks so much for walking through this. I really appreciate it. I'm having trouble locating any folders that look like your example for LOGS_SHARE. Also, I presume certain things are OK to comment out in the docker-compose, such as the CHANNELS_DVR_ALTERNATES, where I only run one Channels DVR.

For things you don't need, just make the Environment value look like this
CHANNELS_DVR_ALTERNATES=

LOGS_SHARE should point to the directory where the Channels DVR executables are installed.
You'll see this in the DVR log when Channels DVR starts

2024/04/04 15:48:57.005970 [SYS] Starting Channels DVR v2024.04.04.1838 (linux-x86_64 pid:13521) in /var/packages/ChannelsDVR/target/channels-dvr/data

In my case it's /var/packages/ChannelsDVR/target/channels-dvr

Thank you! My logs don't show a restart, but I tried your path, and that seems to have worked. I'm going in now and playing around with things. (OliveTin seems to be working, as I was able to use it just now to restart the server)

It's correct if you're running Channels DVR on a Synology using the Synology package.

You can view the logs going back further by specifying the number of lines you want to view
http://x.x.x.x:8089/log?n=10000
where x.x.x.x is the IP address of your Channels DVR Server and n=10000 is the number of lines to display