Opened 12 years ago

Closed 12 years ago

#4049 closed enhancement (fixed)

Remove libsensors dependency and add "Miscellaneous Status Information"

Reported by: sphery <mtdean@…> Owned by: paulh
Priority: minor Milestone: 0.21
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The attached patch, mythtv-miscellaneous_status_info.patch , removes the libsensors dependency (and ACPI temperature information) from MythTV and adds new functionality allowing a user-defined "Miscellaneous" status information section on the backend status page.

The patch changes Myth to optionally (by default disabled) execute a user-specified script to retrieve delimited data which is placed into the "display" (for HTML output), "name", and "value" (for "machine-parsing") attributes of an "Information" element. The "Information" elements are grouped within a new "Miscellaneous" element of the XML document. The display value is written without modification to the HTML status document (followed by a line break tag, if necessary).

Details are provided in the contrib/misc_status_info/README file (provided in the patch).

Also attached is a patch, mythtv-miscellaneous_status_info-example_scripts.patch , which adds two example scripts. The first, myth_sensors.sh, provides sensors data on the backend status page (screenshot at http://misc.thirdcontact.com/MythTV/MiscellaneousStatusInfo/MiscellaneousStatusInformation-sensors.png ). The second, myth_recent_recordings.pl , provides a list of the most recent recordings (screenshot at http://misc.thirdcontact.com/MythTV/MiscellaneousStatusInfo/MiscellaneousStatusInformation-RecentRecordings.png ). Note that myth_recent_recordings.pl can also do plain-text output (i.e. for use in a script to provide an e-mail update of recordings) and allows specifying how many recordings to list. Note, also, the SVN properties change for the scripts (they should be executable--I don't know if that must be done manually after applying the patch).

Reasoning behind changes:

Attachments (6)

mythtv-miscellaneous_status_info.patch (18.9 KB) - added by sphery <mtdean@…> 12 years ago.
mythtv-miscellaneous_status_info-example_scripts.patch (5.5 KB) - added by sphery <mtdean@…> 12 years ago.
example scripts for contrib directory
mythtv-miscellaneous_status_info-20071005.patch (19.0 KB) - added by sphery <mtdean@…> 12 years ago.
Updates XML format to put display text in element body
mythtv-miscellaneous_status_info-example_scripts-20071005.patch (6.0 KB) - added by sphery <mtdean@…> 12 years ago.
mythtv-miscellaneous_status_info-example_scripts-20071008.patch (20.8 KB) - added by sphery <mtdean@…> 12 years ago.
Updates myth_recent_recordings.pl and adds myth_upcoming_recordings.pl
mythtv-miscellaneous_status_info-example_scripts-20071009.patch (22.8 KB) - added by sphery <mtdean@…> 12 years ago.
Adds --hours, --minutes, and --seconds to myth_recent_recordings.pl

Download all attachments as: .zip

Change History (13)

Changed 12 years ago by sphery <mtdean@…>

Changed 12 years ago by sphery <mtdean@…>

example scripts for contrib directory

comment:1 Changed 12 years ago by anonymous

Just one quick comment. I would prefer having the "Display" part of the data be represented as the elements text instead of being an attribute.

For Example:

<Information name="temperature" value="53.5 &amp;#8451;">

Current CPU temperature: 53.5 &amp;#8451;.

</Information>

Either way will work, just a personal preference.

Changed 12 years ago by sphery <mtdean@…>

Updates XML format to put display text in element body

Changed 12 years ago by sphery <mtdean@…>

comment:2 Changed 12 years ago by sphery <mtdean@…>

Updated the XML format to put display text in the "Information" element body. Also updated the the example scripts so that myth_recent_recordings.pl can now show information on all recordings and cleaned up printing (to make it easier to add new formats). The "-20071005" patches should be used instead of the previous patches.

Changed 12 years ago by sphery <mtdean@…>

Updates myth_recent_recordings.pl and adds myth_upcoming_recordings.pl

comment:3 Changed 12 years ago by sphery <mtdean@…>

The updated patch, mythtv-miscellaneous_status_info-example_scripts-20071008.patch , updates myth_recent_recordings.pl to take advantage of the ability to disable illegal character replacement in format_name (provided by [14625]) and allows the user to pass in a format string for the output and a string for the heading (since there's no i18n/L10n support).

It also adds a new script, myth_upcoming_recordings.pl, which can be used with the status page, i.e. to show a list of all conflicts on the schedule (screenshot at http://misc.thirdcontact.com/MythTV/MiscellaneousStatusInfo/MiscellaneousStatusInformation-Conflicts.png ).

Note that both myth_recent_recordings.pl and myth_upcoming_recordings.pl can be used to retrieve information for use in places other than the miscellaneous status information section of the backend status page. For example, a user could set up a script to e-mail the list of most-recently-recorded shows or the shows that are scheduled to record today or the conflicts on the schedule.

Changed 12 years ago by sphery <mtdean@…>

Adds --hours, --minutes, and --seconds to myth_recent_recordings.pl

comment:4 Changed 12 years ago by paulh

The myth_upcoming_recordings.pl script is giving me an error when I try and run it.

Duplicate specification "show_scheduled|_show_scheduled|scheduled|_scheduled|e!" for option "e"

perl is all greek to me :-) any idea what's wrong?

comment:5 Changed 12 years ago by paulh

Never mind I've figured it out. 'e' is used as a parameter for both --seconds and --show_scheduled. Changing --seconds to use 's' instead fixed it.

comment:6 Changed 12 years ago by paulh

Milestone: unknown0.21
Owner: changed from Isaac Richards to paulh

comment:7 Changed 12 years ago by paulh

Resolution: fixed
Status: newclosed

(In [14744]) Remove libsensors dependency and add "Miscellaneous Status Information".

This reworks the miscellaneous section of the status page returned by the BE. You can now specify a script to use to add whatever information you want.

There are some example scripts and a README in contrib/misc_status_info/.

Patch from sphery. Closes #4049

Note: See TracTickets for help on using tickets.