MythTV Status MOTD

My MOTD was lacking, so it got prettied up a bit. I have Apache available externally for Mythweb and transcoded shows. I like to keep an eye on recent accesses.

raging@mythbuntu:~$ cat /etc/update-motd.d/40-apache-hosts
echo "nRecent Apache Accesses"
cat /var/log/apache2/access.log | cut -f1 -d" " | sort | uniq

I loved when mythtv-status was included in mythbuntu, but is in the repository. I missed this feature and wished to have it again.

sudo apt-get install mythtv-status

… but that didn’t quite work. The fix is in this gossamer-threads link.

I didn’t have a MTA configured, and I just wanted to email upcoming recordings to myself, so I set up sSMTP

I got an error
Use of uninitialized value in numeric gt (>) at /usr/bin/mythtv-status line 867.

I love the open source community! This problem had already been identified and solved so i just needed to apply the included .patch file.

I’m including it here again for my convenience if i were to need it again soon,

--- /usr/bin/mythtv-status.orig 2010-11-17 09:52:08.043031500 +0000
+++ /usr/bin/ 2010-11-17 09:36:51.347027492 +0000
@@ -10,6 +10,9 @@

use LWP::UserAgent;
use XML::LibXML;
+# $Date::Manip::Backend = 'DM5';
use Date::Manip;
use Getopt::Long;
use Text::Wrap;
@@ -864,7 +867,7 @@
for my $key (@{ $block->{'human_readable_sizes'}}) {
for my $unit (@size_thresholds) {
if (defined $unit->{'threshold'}) {
- if ($vars->{$key} > $unit->{'threshold'}) {
+ if (defined($vars->{$key}) and $vars->{$key} > $unit->{'threshold'}) {
$vars->{$key} = sprintf("%.1f", $vars->{$key} / $unit->{'conversion'});
$vars->{"${key}_unit"} = $unit->{'unit'};

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: