Project

General

Profile

Possibility to use tvheadend for monitoring of muxes / send email on failure?

Added by stefan 327 almost 5 years ago

Hello,
I wonder if there is a possibility to use tvheadend for sending an email if one or more muxes fail?
We have a private cable system that converts sat to cable signals, and from time to time it needs a reset / repowering.
Now, we recognize it when a certain service is not there anymore only when watching, so it would be nice if we could have a email as soon as the mux is missing / failing.
Has anyone done somethink like that before?

Thank you,
Stefan


Replies (3)

RE: Possibility to use tvheadend for monitoring of muxes / send email on failure? - Added by Joe User almost 5 years ago

Not directly from Tvheadend, but you could use something like logwatch.
(https://www.linode.com/docs/uptime/monitoring/monitor-systems-logwatch/)

Or, just a simple script to tail the log file and grep for errors and generate an email.

And if you want to be proactive about it, you can use Configuration->DVB Inputs->Mux Scheduler to periodically try to tune 1 (or more) mux(s).

RE: Possibility to use tvheadend for monitoring of muxes / send email on failure? - Added by stefan 327 almost 5 years ago

Thank you!

And if you want to be proactive about it, you can use Configuration->DVB Inputs->Mux Scheduler to periodically try to tune 1 (or more) mux(s).

manual tuning (in the "muxes" tab) results in a message like "mpegts: 546MHz in DVB-C Network - scan no data, failed"
when using the mux scheduler, there shows up

tvheadend26882: subscription: 0428: service instance is bad, reason: No input detected (timeout: 10 seconds)
or
tvheadend26882: linuxdvb: Unhandled ERROR_BLOCK_COUNT scale: 0 (timeout: 5 seconds)

with timeout setting 5 seconds, sometimes there is no failure message at all.
I think i should at least use 10 seconds? and look after "No input detected" in the logs?

Assuming I check all muxes 1 time in an hour with the mux scheduler,
what is the behaviour of that construction when a recording is in progress, or someone is watching tv?
there are 2 tuners (dual stick).

can i use logwatch to configure the parsing of the logs, so that only new entries are taken in account?
or do i have to make a script on my own?
Is it better to let tvh write in an own logfile instead of syslog?

best regards,
Stefan

P.S.: is there any option to invoke tvh from the command line directly, that givies similar failure messages? without using the mux scheduler?

RE: Possibility to use tvheadend for monitoring of muxes / send email on failure? - Added by Joe User almost 5 years ago

stefan 327 wrote:

with timeout setting 5 seconds, sometimes there is no failure message at all.
I think i should at least use 10 seconds? and look after "No input detected" in the logs?

I am not sure how (or why for that matter) it is failing, so hard to guess exactly what to look for - you will probably have to play with it for awhile.

Assuming I check all muxes 1 time in an hour with the mux scheduler,
what is the behaviour of that construction when a recording is in progress, or someone is watching tv?
there are 2 tuners (dual stick).

mux scheduler has low priority. There is an option to "Restart" if it is overridden, but not necessary for you since you only want it to run if nothing else has recently.

can i use logwatch to configure the parsing of the logs, so that only new entries are taken in account?

Yes, you can choose and also choose not to react until n times a match has occurred. But it has been many years since I used it and don't remember exact details.

or do i have to make a script on my own?

Either way. Logwatch may be a bit overkill for what you need, but for many it is easier than writing scripts.

Is it better to let tvh write in an own logfile instead of syslog?

Again, either way, but if you know you will be getting lots of tvheadend entries, it would probably be best to write to a separate file to avoid cluttering up the syslog.

P.S.: is there any option to invoke tvh from the command line directly, that givies similar failure messages? without using the mux scheduler?

I am not sure exactly what you are asking for. Start tvheadend and immediately tune (test) a mux?? In that case, no.

"tvheadend --help" will give you the command line options. Like "--logfile" to specify a separate logfile.

    (1-3/3)