From 5eb80ced7c1f35d0713d49afb6bc0d3671a91701 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Sat, 8 Dec 2007 18:34:23 +1300 Subject: [PATCH] Add support for the additional storage groups using my XML patches. Use the patch from: - http://svn.mythtv.org/trac/ticket/4278 --- ChangeLog | 1 + bin/mythtv-status | 28 +++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fa33894..3e61b5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2007-12-08 Andrew Ruthven Allow using my new xmlVer attribute in the XML. + If using my XML patches against MythTV so the disk space details. 2007-12-07 Andrew Ruthven Better suppress warnings from the MythTV Perl API if we can't access diff --git a/bin/mythtv-status b/bin/mythtv-status index df3cff7..093df97 100755 --- a/bin/mythtv-status +++ b/bin/mythtv-status @@ -51,6 +51,7 @@ GetOptions( 'schedule-conflicts!' => \$display{'Schedule Conflicts'}, 'next-recording!' => \$display{'Next Recording In'}, 'total-disk-space!' => \$display{'Total Disk Space'}, + 'disk-space!' => \$display{'Disk Space'}, 'file=s' => \$xml_file, @@ -244,6 +245,27 @@ my @blocks = ( } }, + # Diskspace, with storage groups and sensible XML layour. + { + 'name' => 'Disk Space', + 'type' => 'xpath', + 'xpath' => '//Status/MachineInfo/Storage/Group', + 'protocol_version' => [ ">= 36" ], + 'xml_version' => [ "> 0" ], + 'attrs' => [ qw/id total used/ ], + 'commify' => [ qw/total used/ ], + 'template' => "Total space for group __id__ is __total__ GB, with __used__ GB used (__percent__)", + 'filter' => { + 'id' => sub { return $_[0] eq 'total' } + }, + 'subs' => { + 'percent' => sub { + calc_disk_space_percentage($_[0]->{'used'}, $_[0]->{'total'}) + } + } + }, + + # How many hours till the next recording. { 'name' => 'Next Recording In', @@ -699,7 +721,7 @@ Handy for debugging things. The host to check, defaults to localhost. -=item B<--nostatus>, B<--noencoders>, B<--norecording-now>, B<--noscheduled-recordings>, B<--noschedule-conflicts>, B<--nonext-recording>, B<--nototal-disk-space> +=item B<--nostatus>, B<--noencoders>, B<--norecording-now>, B<--noscheduled-recordings>, B<--noschedule-conflicts>, B<--nonext-recording>, B<--nototal-disk-space>, B<--nodisk-space> Suppress displaying blocks of the output if they would normally be displayed. @@ -755,6 +777,10 @@ The amount of disk space in total, and used by MythTV. If there are no recordings currently happening, then the amount of time until the next recording is displayed. +=item Disk Space + +Details about each storage group that MythTV knows about. + =back =head1 AUTHOR -- 2.30.2