mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-21 16:32:59 +02:00
services.cgi: Drop the process graphs
These are utterly broken and incomplete. I don't want to fix this now, so I am dropping it. Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -399,97 +399,6 @@ sub updateswapgraph {
|
||||
return "Error in RRD::graph for memory: ".$ERROR."\n" if $ERROR;
|
||||
}
|
||||
|
||||
# Generate the Process Cpu Graph for the current period of time for values given by collecd
|
||||
|
||||
sub updateprocessescpugraph {
|
||||
my @processesgraph = getprocesses();
|
||||
my $period = $_[0];
|
||||
my $count="0";
|
||||
|
||||
my @command = (
|
||||
@GRAPH_ARGS,
|
||||
"-",
|
||||
"--start",
|
||||
"-1".$period,
|
||||
"-l 0",
|
||||
"-r",
|
||||
"--color=SHADEA".$color{"color19"},
|
||||
"--color=SHADEB".$color{"color19"},
|
||||
"--color=BACK".$color{"color21"}
|
||||
);
|
||||
|
||||
foreach(@processesgraph){
|
||||
chomp($_);my @name=split(/\-/,$_);chop($name[1]);
|
||||
push(@command,"DEF:".$name[1]."user=".$_."ps_cputime.rrd:user:AVERAGE");
|
||||
push(@command,"DEF:".$name[1]."system=".$_."ps_cputime.rrd:syst:AVERAGE");
|
||||
push(@command,"CDEF:".$name[1]."=".$name[1]."user,".$name[1]."system,+");
|
||||
}
|
||||
|
||||
push(@command,"COMMENT:".$Lang::tr{'caption'}."\\j");
|
||||
|
||||
my $colorIndex = 0;
|
||||
foreach(@processesgraph){
|
||||
my $colorIndex = 10 + $count % 15;
|
||||
my $color="$color{\"color$colorIndex\"}";
|
||||
chomp($_);my @name=split(/\-/,$_);chop($name[1]);
|
||||
if ($count eq "0"){
|
||||
push(@command,"AREA:".$name[1].$color."A0:".$name[1]);
|
||||
}else{
|
||||
push(@command,"STACK:".$name[1].$color."A0:".$name[1]);
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
|
||||
RRDs::graph (@command);
|
||||
$ERROR = RRDs::error;
|
||||
return "Error in RRD::graph for processes: ".$ERROR."\n" if $ERROR;
|
||||
}
|
||||
|
||||
# Generate the Process Memory Graph for the current period of time for values given by collecd
|
||||
|
||||
sub updateprocessesmemorygraph {
|
||||
my @processesgraph = getprocesses();
|
||||
my $period = $_[0];
|
||||
my $count="0";
|
||||
|
||||
my @command = (
|
||||
@GRAPH_ARGS,
|
||||
"-",
|
||||
"--start",
|
||||
"-1".$period,
|
||||
"-l 0",
|
||||
"-r",
|
||||
"-v ".$Lang::tr{'bytes'},
|
||||
"--color=SHADEA".$color{"color19"},
|
||||
"--color=SHADEB".$color{"color19"},
|
||||
"--color=BACK".$color{"color21"}
|
||||
);
|
||||
|
||||
foreach(@processesgraph){
|
||||
chomp($_);my @name=split(/\-/,$_);chop($name[1]);
|
||||
push(@command,"DEF:".$name[1]."=".$_."ps_rss.rrd:value:AVERAGE");
|
||||
}
|
||||
|
||||
push(@command,"COMMENT:".$Lang::tr{'caption'}."\\j");
|
||||
|
||||
my $colorIndex = 0;
|
||||
foreach(@processesgraph){
|
||||
chomp($_);my @name=split(/\-/,$_);chop($name[1]);
|
||||
my $colorIndex = 10 + $count % 15;
|
||||
my $color="$color{\"color$colorIndex\"}";
|
||||
if ($count eq "0"){
|
||||
push(@command,"AREA:".$name[1].$color."A0:".$name[1]);
|
||||
}else{
|
||||
push(@command,"STACK:".$name[1].$color."A0:".$name[1]);
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
|
||||
RRDs::graph (@command);
|
||||
$ERROR = RRDs::error;
|
||||
return "Error in RRD::graph for processesmemory: ".$ERROR."\n" if $ERROR;
|
||||
}
|
||||
|
||||
# Generate the Disk Graph for the current period of time for values given by collecd
|
||||
|
||||
sub updatediskgraph {
|
||||
|
||||
@@ -22,7 +22,6 @@ LoadPlugin load
|
||||
#LoadPlugin logfile
|
||||
LoadPlugin memory
|
||||
LoadPlugin ping
|
||||
LoadPlugin processes
|
||||
LoadPlugin rrdtool
|
||||
LoadPlugin sensors
|
||||
LoadPlugin swap
|
||||
@@ -66,18 +65,6 @@ include "/etc/collectd.precache"
|
||||
timeout 10
|
||||
</Plugin>
|
||||
|
||||
<Plugin processes>
|
||||
Process "sshd"
|
||||
Process "smbd"
|
||||
Process "nmbd"
|
||||
Process "squid"
|
||||
Process "squidguard"
|
||||
Process "charon"
|
||||
Process "openvpn"
|
||||
Process "qemu"
|
||||
Process "mpd"
|
||||
</Plugin>
|
||||
|
||||
<Plugin rrdtool>
|
||||
DataDir "/var/log/rrd/collectd"
|
||||
</Plugin>
|
||||
|
||||
@@ -49,15 +49,6 @@ my @querry = split(/\?/,$ENV{'QUERY_STRING'});
|
||||
$querry[0] = '' unless defined $querry[0];
|
||||
$querry[1] = 'hour' unless defined $querry[1];
|
||||
|
||||
if ( $querry[0] =~ "processescpu"){
|
||||
print "Content-type: image/png\n\n";
|
||||
binmode(STDOUT);
|
||||
&Graphs::updateprocessescpugraph($querry[1]);
|
||||
}elsif ( $querry[0] =~ "processesmemory"){
|
||||
print "Content-type: image/png\n\n";
|
||||
binmode(STDOUT);
|
||||
&Graphs::updateprocessesmemorygraph($querry[1]);
|
||||
}else{
|
||||
&Header::showhttpheaders();
|
||||
&Header::openpage($Lang::tr{'status information'}, 1, '');
|
||||
&Header::openbigbox('100%', 'left');
|
||||
@@ -205,17 +196,8 @@ END
|
||||
print "</table></div>\n";
|
||||
&Header::closebox();
|
||||
|
||||
&Header::opensection('100%', 'center', "$Lang::tr{'processes'} $Lang::tr{'graph'}");
|
||||
&Graphs::makegraphbox("services.cgi","processescpu","day");
|
||||
&Header::closebox();
|
||||
|
||||
&Header::openbox('100%', 'center', "$Lang::tr{'processes'} $Lang::tr{'memory'} $Lang::tr{'graph'}");
|
||||
&Graphs::makegraphbox("services.cgi","processesmemory","day");
|
||||
&Header::closebox();
|
||||
|
||||
&Header::closebigbox();
|
||||
&Header::closepage();
|
||||
}
|
||||
|
||||
sub isautorun (@) {
|
||||
my ($pak, $service, $col) = @_;
|
||||
|
||||
Reference in New Issue
Block a user