mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
Imported graphs.pl and hardwaregraphs.cgi (by maniac)
Removed ipac-ng & mbmon
This commit is contained in:
@@ -22,13 +22,13 @@ $ENV{PATH}="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin";
|
||||
|
||||
my %color = ();
|
||||
my %mainsettings = ();
|
||||
my %mbmonsettings = ();
|
||||
my %sensorsettings = ();
|
||||
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
|
||||
&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
|
||||
|
||||
|
||||
# If the collection deamon is working and collecting mbmon data there will be
|
||||
# some data source named after a common scheme, with the mbmonsettingsfile
|
||||
# If the collection deamon is working and collecting lm_sensors data there will be
|
||||
# some data source named after a common scheme, with the sensorssettingsfile
|
||||
# the user is able to deactivate some of this parameters, in case not to show
|
||||
# false collected value´s may be disable. The user has the ability to enter
|
||||
# custom graph names in order to change temp0 to cpu or motherboad
|
||||
@@ -37,19 +37,23 @@ my $key;
|
||||
my $value;
|
||||
my @args = ();
|
||||
my $count = 0;
|
||||
my @mbmongraphs = ();
|
||||
my @sensorsgraphs = ();
|
||||
my @processesgraph = `ls -dA $rrdlog/collectd/localhost/processes-*/`;
|
||||
if ( -e "$rrdlog/collectd/localhost/mbmon" ){
|
||||
@mbmongraphs = `ls $rrdlog/collectd/localhost/mbmon/`;
|
||||
foreach (@mbmongraphs){
|
||||
my @sensorsdir = `ls -dA $rrdlog/collectd/localhost/sensors-*/`;
|
||||
foreach (@sensorsdir)
|
||||
{
|
||||
chomp($_);chop($_);
|
||||
foreach (`ls $_/*`){
|
||||
chomp($_);
|
||||
my @name=split(/\./,$_);my $label = $name[0]; $label=~ s/-//;
|
||||
$mbmonsettings{'LABEL-'.$name[0]}="$label";
|
||||
$mbmonsettings{'LINE-'.$name[0]}="checked";
|
||||
push(@sensorsgraphs,$_);
|
||||
$_ =~ /\/(.*)sensors-(.*)\/(.*)\.rrd/;
|
||||
my $label = $2.$3;$label=~ s/-//g;
|
||||
$sensorsettings{'LABEL-'.$label}="$label";
|
||||
$sensorsettings{'LINE-'.$label}="checked";
|
||||
}
|
||||
}
|
||||
|
||||
&General::readhash("${General::swroot}/mbmon/settings", \%mbmonsettings);
|
||||
&General::readhash("${General::swroot}/sensors/settings", \%sensorsettings);
|
||||
use Encode 'from_to';
|
||||
|
||||
my %tr=();
|
||||
@@ -536,43 +540,51 @@ sub overviewgraph {
|
||||
print "$ERROR";
|
||||
}
|
||||
|
||||
# Generate the Temperature Graph for the current period of time for values given by collecd and mbmon
|
||||
# Generate the Temperature Graph for the current period of time for values given by collecd and lm_sensors
|
||||
|
||||
sub updatehwtempgraph {
|
||||
|
||||
my $period = $_[0];
|
||||
|
||||
my @command = ("$graphs/mbmon-hwtemp-$period.png",
|
||||
my @command = ("$graphs/sensors-hwtemp-$period.png",
|
||||
"--start", "-1$period", "-aPNG", "-i", "-W www.ipfire.org",
|
||||
"--alt-y-grid", "-w 600", "-h 125",
|
||||
"--color", "SHADEA".$color{"color19"},"--color",
|
||||
"SHADEB".$color{"color19"},"--color",
|
||||
"BACK".$color{"color21"},
|
||||
"-t $Lang::tr{'mbmon temp'} $Lang::tr{'graph per'} $Lang::tr{$period}");
|
||||
"-t $Lang::tr{'sensors temp'} $Lang::tr{'graph per'} $Lang::tr{$period}");
|
||||
|
||||
foreach(@mbmongraphs){
|
||||
foreach(@sensorsgraphs){
|
||||
chomp($_);
|
||||
if ( $_ =~ /temperature/ ) {my @name=split(/\./,$_);if ( $mbmonsettings{'LINE-'.$name[0]} eq "off" ){next;}push(@command,"DEF:".$mbmonsettings{'LABEL-'.$name[0]}."=$rrdlog/collectd/localhost/mbmon/".$_.":value:AVERAGE");
|
||||
if ( $_ =~ /temperature/ ) {
|
||||
$_ =~ /\/(.*)sensors-(.*)\/(.*)\.rrd/;
|
||||
my $label = $2.$3;$label=~ s/-//g;
|
||||
if ( $sensorsettings{'LINE-'.$label} eq "off" ){next;}
|
||||
push(@command,"DEF:".$sensorsettings{'LABEL-'.$label}."=".$_.":value:AVERAGE");
|
||||
}
|
||||
}
|
||||
push(@command,"COMMENT:".sprintf("%-29s",$Lang::tr{'caption'}),"COMMENT:".sprintf("%15s",$Lang::tr{'maximal'}),"COMMENT:".sprintf("%15s",$Lang::tr{'average'}),"COMMENT:".sprintf("%15s",$Lang::tr{'minimal'}),"COMMENT:".sprintf("%15s",$Lang::tr{'current'})."\\j");
|
||||
foreach(@mbmongraphs){
|
||||
foreach(@sensorsgraphs){
|
||||
chomp($_);
|
||||
if ( $_ =~ /temperature/ ) {my @name=split(/\./,$_);if ( $mbmonsettings{'LINE-'.$name[0]} eq "off" ){next;}push(@command,"LINE3:".$mbmonsettings{'LABEL-'.$name[0]}.random_hex_color(6)."A0:".sprintf("%-25s",$mbmonsettings{'LABEL-'.$name[0]}),
|
||||
"GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":MAX:%3.2lf C","GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":AVERAGE:%3.2lf C","GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":MIN:%3.2lf C","GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":LAST:%3.2lf C\\j",);}
|
||||
if ( $_ =~ /temperature/ ){
|
||||
$_ =~ /\/(.*)sensors-(.*)\/(.*)\.rrd/;
|
||||
my $label = $2.$3;$label=~ s/-//g;
|
||||
if ( $sensorsettings{'LINE-'.$label} eq "off" ){next;}
|
||||
push(@command,"LINE3:".$sensorsettings{'LABEL-'.$label}.random_hex_color(6)."A0:".sprintf("%-25s",$sensorsettings{'LABEL-'.$label}),"GPRINT:".$sensorsettings{'LABEL-'.$label}.":MAX:%3.2lf C","GPRINT:".$sensorsettings{'LABEL-'.$label}.":AVERAGE:%3.2lf C","GPRINT:".$sensorsettings{'LABEL-'.$label}.":MIN:%3.2lf C","GPRINT:".$sensorsettings{'LABEL-'.$label}.":LAST:%3.2lf C\\j",);
|
||||
}
|
||||
}
|
||||
RRDs::graph (@command);
|
||||
$ERROR = RRDs::error;
|
||||
print "$ERROR";
|
||||
}
|
||||
|
||||
# Generate the Voltage Graph for the current period of time for values given by collecd and mbmon
|
||||
# Generate the Voltage Graph for the current period of time for values given by collecd and lm_sensors
|
||||
|
||||
sub updatehwvoltgraph {
|
||||
|
||||
my $period = $_[0];
|
||||
|
||||
my @command = ("$graphs/mbmon-hwvolt-$period.png",
|
||||
my @command = ("$graphs/sensors-hwvolt-$period.png",
|
||||
"--start", "-1$period", "-aPNG", "-i", "-W www.ipfire.org",
|
||||
"--alt-y-grid", "-w 600", "-h 125",
|
||||
"--color", "SHADEA".$color{"color19"},"--color",
|
||||
@@ -580,28 +592,37 @@ sub updatehwvoltgraph {
|
||||
"BACK".$color{"color21"},
|
||||
"-t $Lang::tr{'mbmon volt'} $Lang::tr{'graph per'} $Lang::tr{$period}");
|
||||
|
||||
foreach(@mbmongraphs){
|
||||
foreach(@sensorsgraphs){
|
||||
chomp($_);
|
||||
if ( $_ =~ /voltage/ ) {my @name=split(/\./,$_);if ( $mbmonsettings{'LINE-'.$name[0]} eq "off" ){next;}push(@command,"DEF:".$mbmonsettings{'LABEL-'.$name[0]}."=$rrdlog/collectd/localhost/mbmon/".$_.":value:AVERAGE");}
|
||||
if ( $_ =~ /voltage/ ) {
|
||||
$_ =~ /\/(.*)sensors-(.*)\/(.*)\.rrd/;
|
||||
my $label = $2.$3;$label=~ s/-//g;
|
||||
if ( $sensorsettings{'LINE-'.$label} eq "off" ){next;}
|
||||
push(@command,"DEF:".$sensorsettings{'LABEL-'.$label}."=".$_.":value:AVERAGE");
|
||||
}
|
||||
}
|
||||
push(@command,"COMMENT:".sprintf("%-29s",$Lang::tr{'caption'}),"COMMENT:".sprintf("%15s",$Lang::tr{'maximal'}),"COMMENT:".sprintf("%15s",$Lang::tr{'average'}),"COMMENT:".sprintf("%15s",$Lang::tr{'minimal'}),"COMMENT:".sprintf("%15s",$Lang::tr{'current'})."\\j");
|
||||
foreach(@mbmongraphs){
|
||||
foreach(@sensorsgraphs){
|
||||
chomp($_);
|
||||
if ( $_ =~ /voltage/ ) {my @name=split(/\./,$_);if ( $mbmonsettings{'LINE-'.$name[0]} eq "off" ){next;}push(@command,"LINE3:".$mbmonsettings{'LABEL-'.$name[0]}.random_hex_color(6)."A0:".sprintf("%-25s",$mbmonsettings{'LABEL-'.$name[0]}),
|
||||
"GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":MAX:%3.2lf V","GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":AVERAGE:%3.2lf V","GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":MIN:%3.2lf V","GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":LAST:%3.2lf V\\j",);}
|
||||
if ( $_ =~ /voltage/ ){
|
||||
$_ =~ /\/(.*)sensors-(.*)\/(.*)\.rrd/;
|
||||
my $label = $2.$3;$label=~ s/-//g;
|
||||
if ( $sensorsettings{'LINE-'.$label} eq "off" ){next;}
|
||||
push(@command,"LINE3:".$sensorsettings{'LABEL-'.$label}.random_hex_color(6)."A0:".sprintf("%-25s",$sensorsettings{'LABEL-'.$label}),"GPRINT:".$sensorsettings{'LABEL-'.$label}.":MAX:%3.2lf V","GPRINT:".$sensorsettings{'LABEL-'.$label}.":AVERAGE:%3.2lf V","GPRINT:".$sensorsettings{'LABEL-'.$label}.":MIN:%3.2lf V","GPRINT:".$sensorsettings{'LABEL-'.$label}.":LAST:%3.2lf V\\j",);
|
||||
}
|
||||
}
|
||||
RRDs::graph (@command);
|
||||
$ERROR = RRDs::error;
|
||||
print "$ERROR";
|
||||
}
|
||||
|
||||
# Generate the Load Graph for the current period of time for values given by collecd and mbmon
|
||||
# Generate the Load Graph for the current period of time for values given by collecd and lm_sensors
|
||||
|
||||
sub updatehwfangraph {
|
||||
|
||||
my $period = $_[0];
|
||||
|
||||
my @command = ("$graphs/mbmon-hwfan-$period.png",
|
||||
my @command = ("$graphs/sensors-hwfan-$period.png",
|
||||
"--start", "-1$period", "-aPNG", "-i", "-W www.ipfire.org",
|
||||
"--alt-y-grid", "-w 600", "-h 125",
|
||||
"--color", "SHADEA".$color{"color19"},"--color",
|
||||
@@ -609,15 +630,24 @@ sub updatehwfangraph {
|
||||
"BACK".$color{"color21"},
|
||||
"-t $Lang::tr{'mbmon fan'} $Lang::tr{'graph per'} $Lang::tr{$period}");
|
||||
|
||||
foreach(@mbmongraphs){
|
||||
foreach(@sensorsgraphs){
|
||||
chomp($_);
|
||||
if ( $_ =~ /fanspeed/ ) {my @name=split(/\./,$_);if ( $mbmonsettings{'LINE-'.$name[0]} eq "off" ){next;}push(@command,"DEF:".$mbmonsettings{'LABEL-'.$name[0]}."=$rrdlog/collectd/localhost/mbmon/".$_.":value:AVERAGE");}
|
||||
if ( $_ =~ /fanspeed/ ) {
|
||||
$_ =~ /\/(.*)sensors-(.*)\/(.*)\.rrd/;
|
||||
my $label = $2.$3;$label=~ s/-//g;
|
||||
if ( $sensorsettings{'LINE-'.$label} eq "off" ){next;}
|
||||
push(@command,"DEF:".$sensorsettings{'LABEL-'.$label}."=".$_.":value:AVERAGE");
|
||||
}
|
||||
}
|
||||
push(@command,"COMMENT:".sprintf("%-29s",$Lang::tr{'caption'}),"COMMENT:".sprintf("%15s",$Lang::tr{'maximal'}),"COMMENT:".sprintf("%15s",$Lang::tr{'average'}),"COMMENT:".sprintf("%15s",$Lang::tr{'minimal'}),"COMMENT:".sprintf("%15s",$Lang::tr{'current'})."\\j");
|
||||
foreach(@mbmongraphs){
|
||||
foreach(@sensorsgraphs){
|
||||
chomp($_);
|
||||
if ( $_ =~ /fanspeed/ ) {my @name=split(/\./,$_);if ( $mbmonsettings{'LINE-'.$name[0]} eq "off" ){next;}push(@command,"LINE3:".$mbmonsettings{'LABEL-'.$name[0]}.random_hex_color(6)."A0:".sprintf("%-25s",$mbmonsettings{'LABEL-'.$name[0]}),
|
||||
"GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":MAX:%5.0lf RPM","GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":AVERAGE:%5.0lf RPM","GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":MIN:%5.0lf RPM","GPRINT:".$mbmonsettings{'LABEL-'.$name[0]}.":LAST:%5.0lf RPM\\j",);}
|
||||
if ( $_ =~ /fanspeed/ ){
|
||||
$_ =~ /\/(.*)sensors-(.*)\/(.*)\.rrd/;
|
||||
my $label = $2.$3;$label=~ s/-//g;
|
||||
if ( $sensorsettings{'LINE-'.$label} eq "off" ){next;}
|
||||
push(@command,"LINE3:".$sensorsettings{'LABEL-'.$label}.random_hex_color(6)."A0:".sprintf("%-25s",$sensorsettings{'LABEL-'.$label}),"GPRINT:".$sensorsettings{'LABEL-'.$label}.":MAX:%3.2lf RPM","GPRINT:".$sensorsettings{'LABEL-'.$label}.":AVERAGE:%3.2lf RPM","GPRINT:".$sensorsettings{'LABEL-'.$label}.":MIN:%3.2lf RPM","GPRINT:".$sensorsettings{'LABEL-'.$label}.":LAST:%3.2lf RPM\\j",);
|
||||
}
|
||||
}
|
||||
RRDs::graph (@command);
|
||||
$ERROR = RRDs::error;
|
||||
|
||||
@@ -50,12 +50,6 @@ LoadPlugin syslog
|
||||
# File STDOUT
|
||||
#</Plugin>
|
||||
|
||||
#<Plugin mbmon>
|
||||
# Host "127.0.0.1"
|
||||
# Port "411"
|
||||
#</Plugin>
|
||||
|
||||
|
||||
<Plugin ping>
|
||||
Host "gateway"
|
||||
</Plugin>
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
bin/mail
|
||||
#etc/ipac-ng
|
||||
etc/ipac-ng/ipac.conf
|
||||
etc/ipac-ng/rules.conf
|
||||
#usr/man/man8/fetchipac.8
|
||||
#usr/man/man8/ipac-convert.8
|
||||
#usr/man/man8/ipacsum.8
|
||||
usr/sbin/fetchipac
|
||||
#usr/sbin/ipac-convert
|
||||
usr/sbin/ipacsum
|
||||
var/log/ip-acct
|
||||
@@ -1,2 +0,0 @@
|
||||
usr/bin/mbmon
|
||||
#usr/man/man1/mbmon.1
|
||||
@@ -30,9 +30,10 @@ require "${General::swroot}/lang.pl";
|
||||
require "${General::swroot}/header.pl";
|
||||
require "${General::swroot}/graphs.pl";
|
||||
|
||||
my %mbmonsettings = ();
|
||||
my %sensorsettings = ();
|
||||
my %cgiparams=();
|
||||
my @cgigraphs=();
|
||||
my $rrdlog = "/var/log/rrd";
|
||||
|
||||
&Header::showhttpheaders();
|
||||
|
||||
@@ -42,19 +43,28 @@ $ENV{'QUERY_STRING'} =~ s/&//g;
|
||||
@cgigraphs = split(/graph=/,$ENV{'QUERY_STRING'});
|
||||
$cgigraphs[1] = '' unless defined $cgigraphs[1];
|
||||
|
||||
my @mbmongraphs = ();
|
||||
if ( -e "/var/log/rrd/collectd/localhost/mbmon" ){@mbmongraphs = `ls /var/log/rrd/collectd/localhost/mbmon/`;}
|
||||
|
||||
&Header::getcgihash(\%mbmonsettings);
|
||||
|
||||
if ( $mbmonsettings{'ACTION'} eq $Lang::tr{'save'} ) {
|
||||
foreach (@mbmongraphs){
|
||||
my @sensorsgraphs = ();
|
||||
my @sensorsdir = `ls -dA $rrdlog/collectd/localhost/sensors-*/`;
|
||||
foreach (@sensorsdir)
|
||||
{
|
||||
chomp($_);chop($_);
|
||||
foreach (`ls $_/*`){
|
||||
chomp($_);
|
||||
my @name=split(/\./,$_);
|
||||
if ( $mbmonsettings{'LINE-'.$name[0]} ne "on" ){$mbmonsettings{'LINE-'.$name[0]} = 'off';}
|
||||
elsif ( $mbmonsettings{'LINE-'.$name[0]} eq "on" ){$mbmonsettings{'LINE-'.$name[0]} = 'checked';}
|
||||
push(@sensorsgraphs,$_);
|
||||
}
|
||||
&General::writehash("${General::swroot}/mbmon/settings", \%mbmonsettings);
|
||||
}
|
||||
|
||||
&Header::getcgihash(\%sensorsettings);
|
||||
|
||||
if ( $sensorsettings{'ACTION'} eq $Lang::tr{'save'} ) {
|
||||
foreach(@sensorsgraphs){
|
||||
chomp($_);
|
||||
$_ =~ /\/(.*)sensors-(.*)\/(.*)\.rrd/;
|
||||
my $label = $2.$3;$label=~ s/-//g;
|
||||
if ( $sensorsettings{'LINE-'.$label} ne "on" ){$sensorsettings{'LINE-'.$label} = 'off';}
|
||||
elsif ( $sensorsettings{'LINE-'.$label} eq "on" ){$sensorsettings{'LINE-'.$label} = 'checked';}
|
||||
}
|
||||
&General::writehash("${General::swroot}/sensors/settings", \%sensorsettings);
|
||||
}
|
||||
|
||||
my @disks = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`;
|
||||
@@ -98,18 +108,18 @@ else
|
||||
my @graphs = ("hwtemp","hwfan","hwvolt");
|
||||
foreach (@graphs){
|
||||
&Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}");
|
||||
if (-e "$graphdir/mbmon-$_-day.png"){
|
||||
my $ftime = localtime((stat("$graphdir/mbmon-$_-day.png"))[9]);
|
||||
if (-e "$graphdir/sensors-$_-day.png"){
|
||||
my $ftime = localtime((stat("$graphdir/sensors-$_-day.png"))[9]);
|
||||
print "<center>";
|
||||
print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
|
||||
print "<a href='/cgi-bin/hardwaregraphs.cgi?graph=$_'>";
|
||||
print "<img src='/graphs/mbmon-$_-day.png' border='0' />";
|
||||
print "<img src='/graphs/sensors-$_-day.png' border='0' />";
|
||||
print "</a><hr />";
|
||||
}
|
||||
else{print $Lang::tr{'no information available'};}
|
||||
&Header::closebox();
|
||||
}
|
||||
if ( -e "/var/log/rrd/collectd/localhost/mbmon" ){mbmonbox();}
|
||||
sensorsbox();
|
||||
}
|
||||
|
||||
&Header::closebigbox();
|
||||
@@ -150,43 +160,35 @@ sub graphbox {
|
||||
my $graph = $_[0];
|
||||
|
||||
&Header::openbox('100%', 'center', "$graph $Lang::tr{'graph'}");
|
||||
if (-e "$graphdir/mbmon-$graph-week.png"){
|
||||
my $ftime = localtime((stat("$graphdir/mbmon-$graph-week.png"))[9]);
|
||||
if (-e "$graphdir/sensors-$graph-week.png"){
|
||||
my $ftime = localtime((stat("$graphdir/sensors-$graph-week.png"))[9]);
|
||||
print "<center>";
|
||||
print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
|
||||
print "<img src='/graphs/mbmon-$graph-week.png' border='0' /><hr />";
|
||||
print "<img src='/graphs/sensors-$graph-week.png' border='0' /><hr />";
|
||||
}
|
||||
else{print $Lang::tr{'no information available'};}
|
||||
&Header::closebox();
|
||||
&Header::openbox('100%', 'center', "$graph $Lang::tr{'graph'}");
|
||||
if (-e "$graphdir/mbmon-$graph-month.png"){
|
||||
my $ftime = localtime((stat("$graphdir/mbmon-$graph-month.png"))[9]);
|
||||
if (-e "$graphdir/sensors-$graph-month.png"){
|
||||
my $ftime = localtime((stat("$graphdir/sensors-$graph-month.png"))[9]);
|
||||
print "<center>";
|
||||
print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
|
||||
print "<img src='/graphs/mbmon-$graph-month.png' border='0' /><hr />";
|
||||
print "<img src='/graphs/sensors-$graph-month.png' border='0' /><hr />";
|
||||
}
|
||||
else{print $Lang::tr{'no information available'};}
|
||||
&Header::closebox();
|
||||
&Header::openbox('100%', 'center', "$graph $Lang::tr{'graph'}");
|
||||
if (-e "$graphdir/mbmon-$graph-year.png"){
|
||||
my $ftime = localtime((stat("$graphdir/mbmon-$graph-year.png"))[9]);
|
||||
if (-e "$graphdir/sensors-$graph-year.png"){
|
||||
my $ftime = localtime((stat("$graphdir/sensors-$graph-year.png"))[9]);
|
||||
print "<center>";
|
||||
print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
|
||||
print "<img src='/graphs/mbmon-$graph-year.png' border='0' /><hr />";
|
||||
print "<img src='/graphs/sensors-$graph-year.png' border='0' /><hr />";
|
||||
}
|
||||
else{print $Lang::tr{'no information available'};}
|
||||
&Header::closebox();
|
||||
}
|
||||
|
||||
sub mbmonbox{
|
||||
|
||||
foreach (@mbmongraphs){
|
||||
chomp($_);
|
||||
my @name=split(/\./,$_);my $label = $name[0]; $label=~ s/-//;
|
||||
$mbmonsettings{'LABEL-'.$name[0]}="$label";
|
||||
$mbmonsettings{'LINE-'.$name[0]}="checked";
|
||||
}
|
||||
&General::readhash("${General::swroot}/mbmon/settings", \%mbmonsettings);
|
||||
sub sensorsbox{
|
||||
|
||||
&Header::openbox('100%', 'center', "$Lang::tr{'mbmon settings'}");
|
||||
if ( $cgiparams{'ACTION'} eq $Lang::tr{'save'} ){print "Test";}
|
||||
@@ -199,10 +201,14 @@ sub mbmonbox{
|
||||
</tr>
|
||||
END
|
||||
;
|
||||
foreach (@mbmongraphs){
|
||||
chomp($_);my @name=split(/\./,$_);
|
||||
print("<tr><td align='right'><input type='checkbox' name='LINE-$name[0]' $mbmonsettings{'LINE-'.$name[0]} /></td>");
|
||||
print("<td><input type='text' name='LABEL-$name[0]' value='$mbmonsettings{'LABEL-'.$name[0]}' size='25' /></td></tr>\n");
|
||||
foreach (@sensorsgraphs){
|
||||
$_ =~ /\/(.*)sensors-(.*)\/(.*)\.rrd/;
|
||||
my $label = $2.$3;$label=~ s/-//g;
|
||||
$sensorsettings{'LABEL-'.$label}="$label";
|
||||
$sensorsettings{'LINE-'.$label}="checked";
|
||||
&General::readhash("${General::swroot}/sensors/settings", \%sensorsettings);
|
||||
print("<tr><td align='right'><input type='checkbox' name='LINE-$label' $sensorsettings{'LINE-'.$label} /></td>");
|
||||
print("<td><input type='text' name='LABEL-$label' value='$sensorsettings{'LABEL-'.$label}' size='25' /></td></tr>\n");
|
||||
}
|
||||
print <<END
|
||||
<tr><td align='center' colspan='2' ><input type='submit' name='ACTION' value=$Lang::tr{'save'} /></td></tr>
|
||||
|
||||
@@ -51,9 +51,9 @@ $(TARGET) :
|
||||
|
||||
# Create all directories
|
||||
for i in addon-lang auth backup ca certs connscheduler crls ddns dhcp dhcpc dmzholes \
|
||||
ethernet extrahd/bin fwlogs isdn key langs logging main mbmon menu.d modem net-traffic \
|
||||
ethernet extrahd/bin fwlogs isdn key langs logging main menu.d modem net-traffic \
|
||||
net-traffic/templates nfs optionsfw outgoing/bin patches pakfire portfw \
|
||||
ppp private proxy/advanced/cre proxy/calamaris/bin qos/bin red remote snort time tripwire/report \
|
||||
ppp private proxy/advanced/cre proxy/calamaris/bin qos/bin red remote sensors snort time tripwire/report \
|
||||
updatexlrator/bin updatexlrator/autocheck urlfilter/autoupdate urlfilter/bin upnp vpn \
|
||||
wakeonlan wireless xtaccess ; do \
|
||||
mkdir -p $(CONFIG_ROOT)/$$i; \
|
||||
@@ -82,7 +82,7 @@ $(TARGET) :
|
||||
cp $(DIR_SRC)/config/cfgroot/connscheduler-lib.pl $(CONFIG_ROOT)/connscheduler/lib.pl
|
||||
cp $(DIR_SRC)/config/cfgroot/connscheduler.conf $(CONFIG_ROOT)/connscheduler
|
||||
cp $(DIR_SRC)/config/extrahd/* $(CONFIG_ROOT)/extrahd/bin/
|
||||
cp $(DIR_SRC)/config/cfgroot/mbmon-settings $(CONFIG_ROOT)/mbmon/settings
|
||||
cp $(DIR_SRC)/config/cfgroot/sensors-settings $(CONFIG_ROOT)/sensors/settings
|
||||
cp $(DIR_SRC)/config/menu/* $(CONFIG_ROOT)/menu.d/
|
||||
cp $(DIR_SRC)/config/cfgroot/modem-defaults $(CONFIG_ROOT)/modem/defaults
|
||||
cp $(DIR_SRC)/config/cfgroot/modem-settings $(CONFIG_ROOT)/modem/settings
|
||||
|
||||
85
lfs/ipac-ng
85
lfs/ipac-ng
@@ -1,85 +0,0 @@
|
||||
###############################################################################
|
||||
# #
|
||||
# IPFire.org - A linux based firewall #
|
||||
# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
|
||||
# #
|
||||
# This program is free software: you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation, either version 3 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# This program is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
|
||||
# #
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
# Definitions
|
||||
###############################################################################
|
||||
|
||||
include Config
|
||||
|
||||
VER = 1.31
|
||||
|
||||
THISAPP = ipac-ng-$(VER)
|
||||
DL_FILE = $(THISAPP).tar.gz
|
||||
DL_FROM = $(URL_IPFIRE)
|
||||
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||
|
||||
###############################################################################
|
||||
# Top-level Rules
|
||||
###############################################################################
|
||||
|
||||
objects = $(DL_FILE)
|
||||
|
||||
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
|
||||
|
||||
$(DL_FILE)_MD5 = 0c010550adfc140bb3990eb02f1604d0
|
||||
|
||||
install : $(TARGET)
|
||||
|
||||
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
|
||||
|
||||
download :$(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
|
||||
md5 : $(subst %,%_MD5,$(objects))
|
||||
|
||||
###############################################################################
|
||||
# Downloading, checking, md5sum
|
||||
###############################################################################
|
||||
|
||||
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
|
||||
@$(CHECK)
|
||||
|
||||
$(patsubst %,$(DIR_DL)/%,$(objects)) :
|
||||
@$(LOAD)
|
||||
|
||||
$(subst %,%_MD5,$(objects)) :
|
||||
@$(MD5)
|
||||
|
||||
###############################################################################
|
||||
# Installation Details
|
||||
###############################################################################
|
||||
|
||||
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
@$(PREBUILD)
|
||||
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/$(THISAPP)-iptables-1.3.1.patch
|
||||
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/$(THISAPP)-fetchcounter.patch
|
||||
cd $(DIR_APP) && sed -i -e 's%/var/lib/ipac%/var/log/ip-acct%g' configure
|
||||
cd $(DIR_APP) && chmod 755 configure
|
||||
cd $(DIR_APP) && ./configure --prefix=/usr --disable-nls --enable-default-storage=gdbm
|
||||
cd $(DIR_APP) && make
|
||||
cd $(DIR_APP) && make install
|
||||
ln -sf /bin/true /bin/mail
|
||||
-mkdir -p /var/log/ip-acct
|
||||
-mkdir -p /etc/ipac-ng
|
||||
cp -f $(DIR_SRC)/config/ipac-ng/*.conf /etc/ipac-ng/
|
||||
@rm -rf $(DIR_APP)
|
||||
@$(POSTBUILD)
|
||||
78
lfs/mbmon
78
lfs/mbmon
@@ -1,78 +0,0 @@
|
||||
###############################################################################
|
||||
# #
|
||||
# IPFire.org - A linux based firewall #
|
||||
# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
|
||||
# #
|
||||
# This program is free software: you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation, either version 3 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# This program is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
|
||||
# #
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
# Definitions
|
||||
###############################################################################
|
||||
|
||||
include Config
|
||||
|
||||
VER = 205
|
||||
|
||||
THISAPP = xmbmon$(VER)
|
||||
DL_FILE = $(THISAPP).tar.gz
|
||||
DL_FROM = $(URL_IPFIRE)
|
||||
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||
|
||||
###############################################################################
|
||||
# Top-level Rules
|
||||
###############################################################################
|
||||
|
||||
objects = $(DL_FILE)
|
||||
|
||||
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
|
||||
|
||||
$(DL_FILE)_MD5 = ab6614c785f5b653fcc69fb9c02058f0
|
||||
|
||||
install : $(TARGET)
|
||||
|
||||
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
|
||||
|
||||
download :$(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
|
||||
md5 : $(subst %,%_MD5,$(objects))
|
||||
|
||||
###############################################################################
|
||||
# Downloading, checking, md5sum
|
||||
###############################################################################
|
||||
|
||||
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
|
||||
@$(CHECK)
|
||||
|
||||
$(patsubst %,$(DIR_DL)/%,$(objects)) :
|
||||
@$(LOAD)
|
||||
|
||||
$(subst %,%_MD5,$(objects)) :
|
||||
@$(MD5)
|
||||
|
||||
###############################################################################
|
||||
# Installation Details
|
||||
###############################################################################
|
||||
|
||||
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
@$(PREBUILD)
|
||||
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
|
||||
cd $(DIR_APP) && ./configure --prefix=/usr
|
||||
cd $(DIR_APP) && make PROGRAM=mbmon
|
||||
cd $(DIR_APP) && install -o root -g wheel -m 4555 -c -p mbmon /usr/bin
|
||||
cd $(DIR_APP) && install -o root -g wheel -m 444 -c -p mbmon.1 /usr/man/man1
|
||||
@rm -rf $(DIR_APP)
|
||||
@$(POSTBUILD)
|
||||
2
make.sh
2
make.sh
@@ -417,7 +417,6 @@ buildipfire() {
|
||||
ipfiremake libupnp
|
||||
ipfiremake ipp2p IPT=1
|
||||
ipfiremake linux-igd
|
||||
ipfiremake ipac-ng
|
||||
ipfiremake ipaddr
|
||||
ipfiremake iptstate
|
||||
ipfiremake iputils
|
||||
@@ -534,7 +533,6 @@ buildipfire() {
|
||||
ipfiremake portmap
|
||||
ipfiremake nfs
|
||||
ipfiremake nmap
|
||||
ipfiremake mbmon
|
||||
ipfiremake ncftp
|
||||
ipfiremake etherwake
|
||||
ipfiremake bwm-ng
|
||||
|
||||
Reference in New Issue
Block a user