[mythtv-users] tuner that recorded program
Michael T. Dean
mtdean at thirdcontact.com
Thu Sep 4 17:43:30 UTC 2008
On 09/04/2008 07:22 AM, Nick Morrott wrote:
> On 04/09/2008, Brad Fuller wrote:
>
> > On Wed, Sep 3, 2008 at 8:48 PM, Michael T. Dean wrote:
> >
> >> On 09/03/2008 08:38 PM, Brad Fuller wrote:
> >>
> >>> Ok, it's probably out there, but I can't find it. Is there a
> >>> way to find out which tuner recorded a particular program?
> >>
> >> Only by digging through/interpreting the logs.
> >
> > Bummer. IT would be a good addition. Makes tuner debugging easier.
>
> It could be possible with a plugin script for the System Status page,
> grepping the backend log and outputting the last x recordings into a
> simple status page.
Heh. I didn't even think of that, and I'm the guy who added the
Miscellaneous Status Info to the status page. The attached script
provides an example.
To use it, create a script, i.e. "misc_status_info.sh" that calls
which_recorder.pl and passes it the path to the mythbackend log file.
Then, set up "misc_status_info.sh" (with any required path information)
as your:
Miscellaneous Status Application
External application or script that outputs extra information for
inclusion in the backend status page. See contrib/misc_status_info/README
(which is configured in mythtv-setup).
Feel free to call any other scripts, as desired, from
misc_status_info.sh. My misc_status_info.sh:
-----
#!/bin/bash
# Display shows recorded in the last 24 hours
/usr/local/bin/myth_recent_recordings.pl --recordings=-1 --hours=24 \
--heading '<h3>Shows Recorded Today</h3>'
# Display any upcoming recording conflicts
/usr/local/bin/myth_upcoming_recordings.pl --recordings -1 \
--no_show_scheduled \
--heading '<h3>Recording Conflicts</h3>' \
--no_conflicts_message '<h3>No Conflicts</h3>'
/home/mythtv/bin/which_recorder.pl /home/mythtv/log/mythtv.log
-----
Note that which_recorder.pl will display information about all
recordings in your logs, so you'll probably want to rotate your logs
occasionally. Also, if you have multiple backends, it will only show
information about shows recorded on the backend that runs the script
(or, technically, only shows information about shows described in the
log file specified, so you could have a slave push its log file to the
master occasionally and run the script twice--once for each log
file--but that's an exercise left for the reader).
In case you're wondering, I have the full path to which_recorder.pl
because of bash's hash function (which remembers the location of
commands as they are looked up). Depending on what you do when setting
up the script, the hash function can put things in a state where the
script fails and you have to restart the backend for the script to work,
so using the full path to the command makes sure it always works. It
also has the benefit of preventing anyone from "replacing" your command
with a trojaned script by putting it somewhere else higher in your PATH.
Mike
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: which_recorder.pl
Url: http://mythtv.org/pipermail/mythtv-users/attachments/20080904/a4819193/attachment.diff
More information about the mythtv-users
mailing list