OliveTin for Channels: An Interface for Misc Channels DVR Scripts & Tricks

I restarted the container, then started a fresh alerter session. Here is stderr:

+ dvr=192.xxx.xxx.xxx:8089
++ echo 192.xxx.xxx.xxx:8089
++ awk -F: '{print $1}'
+ channelsHost=192.xxx.xxx.xxx
++ echo 192.xxx.xxx.xxx:8089
++ awk -F: '{print $2}'
+ channelsPort=8089
+ foregroundScript=logalerts
++ ps -ef
++ grep '[l]ogalerter.sh 192.xxx.xxx.xxx:8089'
++ awk '{print $2}'
+ runningScriptPID=
+ greenIcon='"icons/channels.png"'
+ purpleIcon='"https://community-assets.getchannels.com/original/2X/5/55232547f7e8f243069080b6aec0c71872f0f537.png"'
+ logFile=/config/192.xxx.xxx.xxx:8089_logalerts_latest.log
+ rm /config/192.xxx.xxx.xxx:8089_logalerts_latest.log
rm: cannot remove '/config/192.xxx.xxx.xxx-8089_logalerts_latest.log': No such file or directory
+ configFile=/config/config.yaml
+ configTemp=/tmp/config.yaml
+ trap finish EXIT
+ cp /config/config.yaml /tmp
+ frequency=2m
+ [[ 2m == \0 ]]
+ [[ 2m != \0 ]]
+ sed -i '/#logalerts frequency default/s/default: .* #/default: 2m #/' /tmp/config.yaml
+ filter1=2024
+ sed -i '/#logalerts filter1 default/s/default: .* #/default: "2024" #/' /tmp/config.yaml
+ filter2=none
+ sed -i '/#logalerts filter2 default/s/default: .* #/default: "none" #/' /tmp/config.yaml
+ filter3=none
+ sed -i '/#logalerts filter3 default/s/default: .* #/default: "none" #/' /tmp/config.yaml
+ main
+ cd /config
+ scriptRun
++ ps -ef
++ grep '[l]ogalerter.sh 192.xxx.xxx.xxx:8089'
++ awk '{print $2}'
+ runningScriptPID=
+ [[ -n '' ]]
+ runningScriptPID=323
+ echo 'logalerts.sh 192.xxx.xxx.xxx:8089 2m "2024" "none" "none"'
+ nohup /config/logalerter.sh 192.xxx.xxx.xxx:8089 2m 2024 none none
+ grep -q '(.*) #logalerts' /tmp/config.yaml
+ [[ 1 == \1 ]]
++ date +%d%b%y_%H:%M
+ sed -i '/#logalerts title/s/#/(08Aug24_19:03) #/' /tmp/config.yaml
+ sed -i '/#logalerts icon/s|img src = .* width|img src = "icons/channels.png" width|' /tmp/config.yaml
+ sleep 2
+ cat /config/192.xxx.xxx.xxx:8089_logalerts_latest.log
+ runningScripts
+ servers=($CHANNELS_DVR $CHANNELS_DVR_ALTERNATES)
+ for server in "${servers[@]}"
++ ps -ef
++ grep '[l]ogalerter.sh 192.xxx.xxx.xxx:8089'
++ awk '{print $2}'
+ activeProcess=323
+ [[ -n 323 ]]
+ echo 'Background E-Mail Log Alerts process running for 192.xxx.xxx.xxx:8089'
+ finish
+ cp /tmp/config.yaml /config

I ran an extended healthcheck, here is stdout:

Checking your OliveTin installation...
(extended_check=true)

----------------------------------------

Checking that your selected Channels DVR server (192.xxx.xxx.xxx:8089) is reachable by URL:
HTTP Status: 200 indicates success...

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  1276  100  1276    0     0   311k      0 --:--:-- --:--:-- --:--:--  311k
HTTP Status: 200
Effective URL: http://192.xxx.xxx.xxx:8089/

----------------------------------------

Checking that your selected Channels DVR server's data files (/mnt/192.xxx.xxx.xxx-8089) are accessible:
Folders with the names Database, Images, Imports, Logs, Movies, Streaming and TV should be visible...

total 156
drwxrwxrwx 1 1000 1000    512 Jul  9 14:03 .
drwxr-xr-x 1 root root   4096 Aug  6 18:43 ..
-rwxrwxrwx 1 1000 1000   1728 Apr 12 16:19 Cameras rtsp.m3u8
drwxrwxrwx 1 1000 1000    512 Aug  8 18:36 Database
drwxrwxrwx 1 1000 1000    512 Nov 24  2023 Images
drwxrwxrwx 1 1000 1000    512 Aug 21  2023 Imports
drwxrwxrwx 1 1000 1000    512 Nov 14  2023 Logs
-rwxrwxrwx 1 1000 1000 151391 Apr 16 12:32 NEW_Feb_2023_Mapped_Channels.m3u
drwxrwxrwx 1 1000 1000    512 Nov 15  2023 OLD m3u
drwxrwxrwx 1 1000 1000    512 Jul  9 13:51 Scripting
drwxrwxrwx 1 1000 1000    512 Aug  8 06:23 Streaming
drwxrwxrwx 1 1000 1000    512 Feb  5  2024 TV

----------------------------------------

Checking that your selected Channels DVR server's log files (/mnt/192.xxx.xxx.xxx-8089_logs) are accessible:
Folders with the names data and latest should be visible...

total 8
drwxrwxrwx 1 1000 1000  512 Jul 18 18:08 .
drwxr-xr-x 1 root root 4096 Aug  6 18:43 ..
drwxrwxrwx 1 1000 1000  512 Jan  8  2024 2024.01.08.1431
drwxrwxrwx 1 1000 1000  512 Feb  8 16:45 2024.02.08.0626
drwxrwxrwx 1 1000 1000  512 Feb 10 23:41 2024.02.11.0311
drwxrwxrwx 1 1000 1000  512 Feb 25 13:48 2024.02.24.2134
drwxrwxrwx 1 1000 1000  512 Mar 29 19:33 2024.03.27.1935
drwxrwxrwx 1 1000 1000  512 May  7 21:41 2024.05.07.1442
-rwxrwxrwx 1 1000 1000  871 Jul 18 16:38 Channels DVR Server.lnk
drwxrwxrwx 1 1000 1000  512 Aug  7 09:22 data
drwxrwxrwx 1 1000 1000  512 Jul 18 16:38 latest

----------------------------------------

Here's a list of your current OliveTin-related settings:

HOSTNAME=olivetin
CHANNELS_DVR=192.xxx.xxx.xxx:8089
CHANNELS_DVR_ALTERNATES=
CHANNELS_CLIENTS=appletv4k-den firestick-bedroom
ALERT_SMTP_SERVER=smtp.gmail.com:587
ALERT_EMAIL_FROM=[Redacted]@gmail.com
ALERT_EMAIL_PASS=[Redacted]
ALERT_EMAIL_TO=[Redacted]@tourville.us
UPDATE_YAMLS=true
UPDATE_SCRIPTS=true
PORTAINER_TOKEN=[Redacted]
PORTAINER_HOST=docker-host

----------------------------------------

Here's the contents of /etc/resolv.conf from inside the container:

# Generated by Docker Engine.
# This file can be edited; Docker Engine will not make further changes once it
# has been modified.

nameserver 127.0.0.11
search 
options ndots:0

# Based on host file: '/etc/resolv.conf' (internal resolver)
# ExtServers: [192.168.65.7]
# Overrides: [search]
# Option ndots from: internal

----------------------------------------

Here's the contents of /etc/hosts from inside the container:

127.0.0.1	localhost
::1	localhost ip6-localhost ip6-loopback
fe00::0	ip6-localnet
ff00::0	ip6-mcastprefix
ff02::1	ip6-allnodes
ff02::2	ip6-allrouters
172.18.0.3	olivetin

----------------------------------------

Your Docker-host is running:

 "Debian GNU/Linux 11 (bullseye)"

----------------------------------------

Your Docker-host's /etc/resolv.conf file contains:

# Generated by Docker Engine.
# This file can be edited; Docker Engine will not make further changes once it
# has been modified.

nameserver 127.0.0.11
search 
options ndots:0

# Based on host file: '/etc/resolv.conf' (internal resolver)
# ExtServers: [192.168.65.7]
# Overrides: [search]
# Option ndots from: internal

----------------------------------------

Your Docker-host's /etc/hosts file contains:

127.0.0.1	localhost
::1	localhost ip6-localhost ip6-loopback
fe00::0	ip6-localnet
ff00::0	ip6-mcastprefix
ff02::1	ip6-allnodes
ff02::2	ip6-allrouters
172.18.0.3	olivetin

----------------------------------------

Your Tailscale version is:

bash: tailscale: command not found

----------------------------------------

FYI I have yet to receive the first email from this alerter session.

When you're posting code, logs or any other long blocks of text on this forum, you want to use 3 backticks at the beginning and end of the block. If you could edit the above accordingly, and post standard out instead of standard error for the healthcheck it would be appreciated. It'll make it easier for me, and anyone else, to read it.

OK, please stand by. In the meantime, I tried to kill the current alerter session (frequency =0) ps -ef from the console shows the processes killed but the Olive Tin Web Interface just hangs like this:

The current version of the source OliveTin project doesn't refresh the webpage like the old version used to. Basically this means, when you're making changes fast-and-furious like you are now -- be sure to refresh the page before proceeding.

If all your processes are killed the Action icon should be purple, if something is still running, it'll show green. Refresh if the color is wrong for the state you're in.

Original post edited as you suggested. Thanks for the 3 backtick education.

Got it. In the meantime, the second alerter session after the container restart did give me one (and only one) email message. Kinda like the first session primed the pump at least.

@Edwin_Perez Are you currently using OliveTin Log Alerts with your setup? You popped to mind as someone who's running CDVR and Docker Desktop for Windows on the same machine. @skipt is having an issue that's solved to my knowledge -- but maybe still persists with Windows Docker hosts? Idk, it's puzzling...

I do not have that Problem .... when I set it to 0 it closes immediately .... Is this what you mean ?

The main issue @skipt is reporting is that he never receives more than one e-mail when he sets up Log Alerts. An easy test, if you're willing, is to use [DVR] (or similar) for a filter. That should kick out multiple e-mails pretty quickly. I'm just trying to confirm the fix I've implemented is working on all Docker hosts. You'll need to be running the 2024.07.23 build.

I got one at 07:35 PT and no more it is now 7:45 ... I see more [DVR] but no longer getting alerts.

The following CDVR (192.168.50.162:8089) log lines match your filters:

2024/08/08 19:31:17.389912 [DVR] Fetching guide data for 167 stations in X-M3U @ 2024-08-24 7:00AM
2024/08/08 19:31:19.326981 [DVR]   indexed 1236 airings (167 channels) [1s fetch, 662ms index]
2024/08/08 19:31:20.000992 [DVR]   indexed 36 movies (13 channels) [620ms fetch, 53ms index]
2024/08/08 19:31:20.015124 [DVR]   pruned 1 replaced airings in 14ms.
2024/08/08 19:31:20.020126 [DVR] Fetching guide data for 167 stations in X-M3U @ 2024-08-24 1:00PM
2024/08/08 19:31:22.128510 [DVR]   indexed 1183 airings (167 channels) [1s fetch, 628ms index]
2024/08/08 19:31:22.681496 [DVR]   indexed 46 movies (17 channels) [487ms fetch, 65ms index]

log

2024/08/08 19:45:10.250765 [DVR]   indexed 1332 airings (167 channels) [1s fetch, 649ms index]
2024/08/08 19:45:10.814344 [DVR]   indexed 18 movies (6 channels) [516ms fetch, 46ms index]
2024/08/08 19:45:10.822582 [DVR] Fetching guide data for 167 stations in X-M3U @ 2024-08-23 7:30AM
2024/08/08 19:45:12.842874 [DVR]   indexed 1264 airings (167 channels) [1s fetch, 735ms index]
2024/08/08 19:45:13.524955 [DVR]   indexed 21 movies (8 channels) [635ms fetch, 47ms index]
2024/08/08 19:45:13.532828 [DVR] Fetching guide data for 167 stations in X-M3U @ 2024-08-23 1:30PM
2024/08/08 19:45:15.498841 [DVR]   indexed 1241 airings (167 channels) [1s fetch, 569ms index]
2024/08/08 19:45:16.044187 [DVR]   indexed 38 movies (15 channels) [485ms fetch, 60ms index]
2024/08/08 19:45:16.052939 [DVR] Fetching guide data for 167 stations in X-M3U @ 2024-08-23 7:30PM
2024/08/08 19:45:18.055958 [DVR]   indexed 1260 airings (167 channels) [1s fetch, 649ms index]
2024/08/08 19:45:18.548660 [DVR]   indexed 32 movies (14 channels) [423ms fetch, 69ms index]
2024/08/08 19:45:18.555390 [DVR] Fetching guide data for 167 stations in X-M3U @ 2024-08-24 1:30AM
2024/08/08 19:45:20.698380 [DVR]   indexed 1384 airings (167 channels) [1s fetch, 734ms index]
2024/08/08 19:45:21.183911 [DVR]   indexed 20 movies (7 channels) [441ms fetch, 43ms index]
2024/08/08 19:45:21.191770 [DVR] Fetching guide data for 167 stations in X-M3U @ 2024-08-24 7:30AM
2024/08/08 19:45:23.345085 [DVR]   indexed 1264 airings (167 channels) [1s fetch, 616ms index]
2024/08/08 19:45:24.309355 [DVR]   indexed 37 movies (13 channels) [911ms fetch, 52ms index]
2024/08/08 19:45:24.316393 [DVR] Fetching guide data for 167 stations in X-M3U @ 2024-08-24 1:30PM
2024/08/08 19:45:26.494159 [DVR]   indexed 1220 airings (167 channels) [1s fetch, 583ms index]
2024/08/08 19:45:27.092677 [DVR]   indexed 50 movies (17 channels) [539ms fetch, 58ms index]

OK, that's helpful. It's pretty rare to have Docker host related issues with containers, but I have seen it once before.

I have an idea how to deal with this, which I'll likely roll out tomorrow.

Still no alerts going to watch some Olympics.

@skipt @Edwin_Perez I've implemented a potential fix to this issue with the E-Mail Log Alerts Action that appears to only effect those using Windows Docker hosts. If you could please update bnhf/olivetin:latest (2024.08.09) to confirm, I'd appreciate it.

OK Updated and setup ... Speaking of OliveTin can you redact the phone number when using text in HealthCheck ?

Have you had a chance to run a test yet?

I'm guessing you're seeing that because you have two values in the ALERT_EMAIL_TO env var -- does that sound likely?

Yes

AS far as the test goes only got 1 initial alert nothing else. Even though the guide update is running and new [DVR] are being logged.

The following CDVR (192.168.50.162:8089) log lines match your filters:

2024/08/09 07:15:57.459295 [DVR]   indexed 46 movies (17 channels) [3s fetch, 843ms index]
2024/08/09 07:15:57.470239 [DVR] Fetching guide data for 167 stations in X-M3U @ 2024-08-24 7:00PM
2024/08/09 07:16:07.376653 [DVR]   indexed 1183 airings (167 channels) [7s fetch, 2s index]
2024/08/09 07:16:09.993018 [DVR]   indexed 41 movies (17 channels) [1s fetch, 917ms index]
2024/08/09 07:16:10.004432 [DVR] Fetching guide data for 167 stations in X-M3U @ 2024-08-25 1:00AM
2024/08/09 07:16:20.865850 [DVR]   indexed 1307 airings (167 channels) [8s fetch, 1s index]
2024/08/09 07:16:25.541196 [DVR]   indexed 25 movies (11 channels) [3s fetch, 786ms index]
2024/08/09 09:10:29.992700 [DVR] Fetching guide data for 102 stations in X-TVE @ 2024-08-25 3:00AM
2024/08/09 09:10:31.071240 [DVR]   indexed 749 airings (102 channels) [721ms fetch, 357ms index]

OK, thanks -- I'll work on a plan c...

" ... only got 1 initial alert....."

Woo Hoo!!! I'm not crazy!!

1 Like

Will do and report back.

When I do the update, is my existing environment carried forward?

Yes, but there's no need to update yet. First attempt at a fix failed. I'm working on another approach now...