mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-25 02:18:08 +00:00
Whitespace cleanup
* remove trailing whitespace * remove empty lines at the end of files
This commit is contained in:
parent
ef851f0c34
commit
17f784270a
604 changed files with 2927 additions and 2945 deletions
|
@ -2,8 +2,8 @@
|
|||
#
|
||||
# Munin plugin for MythTV
|
||||
# This plugin can graph:- EPG programs per channel
|
||||
#
|
||||
# NOTE: This plugin needs to run as root so add the following to your munin-node config file
|
||||
#
|
||||
# NOTE: This plugin needs to run as root so add the following to your munin-node config file
|
||||
# [mythtv_status*]
|
||||
# user=root
|
||||
#
|
||||
|
@ -48,8 +48,8 @@ my $Channel="";
|
|||
print "cannot find MythTV configuration file my.txt\n";
|
||||
exit 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#Config Options
|
||||
##Configuration for encoder, no config data needs to read from anywhere
|
||||
if ($ARGV[0] and $ARGV[0] eq "config"){
|
||||
|
@ -71,16 +71,16 @@ my $Channel="";
|
|||
print "Channel" . $Channel . "EPG.label EPG days for channel $gata\n";
|
||||
$Ptr=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
exit 0;
|
||||
}
|
||||
|
||||
#Actually dump data to Munin
|
||||
@result=SQLQuery("SELECT o.chanid, (UNIX_TIMESTAMP(MAX(c.endtime))
|
||||
- UNIX_TIMESTAMP(NOW()))/86400
|
||||
FROM channel o, program c
|
||||
@result=SQLQuery("SELECT o.chanid, (UNIX_TIMESTAMP(MAX(c.endtime))
|
||||
- UNIX_TIMESTAMP(NOW()))/86400
|
||||
FROM channel o, program c
|
||||
WHERE o.chanid = c.chanid
|
||||
AND o.visible = '1'
|
||||
AND o.visible = '1'
|
||||
GROUP BY o.chanid");
|
||||
my $Ptr=0;
|
||||
foreach $gata (@result) {
|
||||
|
@ -89,10 +89,10 @@ my $Channel="";
|
|||
$Ptr=1;
|
||||
} else {
|
||||
if ( $gata > 12 ) {
|
||||
print "Channel" . $Channel . "EPG.value 12.0\n";
|
||||
} else {
|
||||
print "Channel" . $Channel . "EPG.value 12.0\n";
|
||||
} else {
|
||||
print "Channel" . $Channel . "EPG.value $gata\n";
|
||||
}
|
||||
}
|
||||
$Ptr=0;
|
||||
}
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ exit 0;
|
|||
sub PrepSQLRead {
|
||||
my $hostname = `hostname`;
|
||||
chomp($hostname);
|
||||
|
||||
|
||||
# Read the mysql.txt file in use by MythTV. Could be in a couple places, so try the usual suspects
|
||||
my $found = 0;
|
||||
my @mysql = ('/usr/local/share/mythtv/mysql.txt',
|
||||
|
@ -153,7 +153,7 @@ sub SQLQuery {
|
|||
my ($QUERY) = @_;
|
||||
my @data;
|
||||
my $ref;
|
||||
my $dbh = DBI->connect("DBI:mysql:$SQLDBName:$SQLServer", $SQLUser, $SQLPassword)
|
||||
my $dbh = DBI->connect("DBI:mysql:$SQLDBName:$SQLServer", $SQLUser, $SQLPassword)
|
||||
or die "Couldn't connect to database: " . DBI->errstr;
|
||||
my $table_data = $dbh->prepare($QUERY) or die "Couldn't prepare statement: " . $dbh->errstr;
|
||||
$table_data->execute or die "Couldn't execute statement: " . $table_data->errstr;
|
||||
|
@ -165,5 +165,5 @@ sub SQLQuery {
|
|||
return @data;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue