]> git.etc.gen.nz Git - mythtv-status.git/commitdiff
Add support for the additional storage groups using my XML patches.
authorAndrew Ruthven <andrew@etc.gen.nz>
Sat, 8 Dec 2007 05:34:23 +0000 (18:34 +1300)
committerAndrew Ruthven <andrew@etc.gen.nz>
Sat, 8 Dec 2007 05:34:23 +0000 (18:34 +1300)
Use the patch from:
 - http://svn.mythtv.org/trac/ticket/4278

ChangeLog
bin/mythtv-status

index fa3389432ab769ec8e0704b443b1fece2005461d..3e61b5f62e524fb07cbae9d797885915e3b41a36 100644 (file)
--- 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
index df3cff7c561551eacb941b74b79abf9b5bc1da45..093df97554b01a23cca1b9e4cb6827c8781ebb27 100755 (executable)
@@ -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