This is Proxy Graphs 3.2, slightly tuned for better readability - as a suggestion. I found by chance that the corresponding lang-strings still existed, so I thought "Why not?"
I just had to create a - hopefully correct - 'sgraph.cgi', wrote a - hopefully correct - lfs-file and some 'backgrounds' and there it was.
I changed the original CGI-font-colors to something better readable and added some 'style=padding-left:5px' for cosmetics.
If somone likes it, here it is (again).
Signed-off-by: Matthias Fischer matthias.fischer@ipfire.org --- config/menu/20-status.menu | 8 +++- config/rootfiles/common/squid-graph | 1 + html/cgi-bin/sgraph.cgi | 72 ++++++++++++++++++++++++++++++++ html/html/squid-graph/logo.png | Bin 0 -> 3933 bytes lfs/squid-graph | 81 ++++++++++++++++++++++++++++++++++++ make.sh | 1 + src/scripts/makegraphs | 9 +++- 7 files changed, 170 insertions(+), 2 deletions(-) create mode 100644 config/rootfiles/common/squid-graph create mode 100644 html/cgi-bin/sgraph.cgi create mode 100644 html/html/squid-graph/logo.png create mode 100644 lfs/squid-graph
diff --git a/config/menu/20-status.menu b/config/menu/20-status.menu index 2bcf0d5..a1511ec 100644 --- a/config/menu/20-status.menu +++ b/config/menu/20-status.menu @@ -58,7 +58,13 @@ 'title' => "$Lang::tr{'hardware graphs'}", 'enabled' => 1, }; - $substatus->{'61.entropy'} = { + $substatus->{'61.proxygraphs'} = { + 'caption' => "$Lang::tr{'ssproxy graphs'}", + 'uri' => '/cgi-bin/sgraph.cgi', + 'title' => "$Lang::tr{'ssproxy graphs'}", + 'enabled' => 1, + }; + $substatus->{'62.entropy'} = { 'caption' => "$Lang::tr{'entropy'}", 'uri' => '/cgi-bin/entropy.cgi', 'title' => "$Lang::tr{'entropy graphs'}", diff --git a/config/rootfiles/common/squid-graph b/config/rootfiles/common/squid-graph new file mode 100644 index 0000000..a2c9035 --- /dev/null +++ b/config/rootfiles/common/squid-graph @@ -0,0 +1 @@ +usr/bin/squid-graph diff --git a/html/cgi-bin/sgraph.cgi b/html/cgi-bin/sgraph.cgi new file mode 100644 index 0000000..f25dce0 --- /dev/null +++ b/html/cgi-bin/sgraph.cgi @@ -0,0 +1,72 @@ +#!/usr/bin/perl +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2016 IPFire Team info@ipfire.org # +# # +# 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/. # +# # +############################################################################### + +use strict; + +# enable only the following on debugging purpose +#use warnings; +#use CGI::Carp 'fatalsToBrowser'; + +require '/var/ipfire/general-functions.pl'; +require "${General::swroot}/lang.pl"; +require "${General::swroot}/header.pl"; + +my @graphs = (); + +&Header::showhttpheaders(); + +my $dir = "/srv/web/ipfire/html/squid-graph"; +my $sgraphdir = "/srv/web/ipfire/html/squid-graph"; + +&Header::openpage($Lang::tr{'ssproxy graphs'}, 1, ''); + +&Header::openbigbox('100%', 'left'); + +&Header::openbox('100%', 'left', $Lang::tr{'proxy access graphs'} . ":" ); + +if (open(IPACHTML, "$sgraphdir/index.html")) +{ + my $skip = 1; + while (<IPACHTML>) + { + $skip = 1 if /^<HR>$/; + if ($skip) + { + $skip = 0 if /<H1>/; + next; + } + s/<IMG SRC=([^"'>]+)>/<img src='/squid-graph/$1' alt='Graph' />/; + s/<HR>/<hr />/g; + s/<BR>/<br />/g; + s/<([^>]*)>/\L<$1>\E/g; + s/(size|align|border|color)=([^'"> ]+)/$1='$2'/g; + print; + } + close(IPACHTML); +} +else { + print $Lang::tr{'no information available'}; } + +&Header::closebox(); + +&Header::closebigbox(); + +&Header::closepage(); diff --git a/html/html/squid-graph/logo.png b/html/html/squid-graph/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..e2fe57b703e2662ec3fd9b70b6cfb6de4425aadf GIT binary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86J&)HubY88!{NRDRFf~vYJi|)rLdJSX;I#9f z$$#QZCU!nJ&z3#VPKWVh7l{sWLv$*km~zb^`6a?L0UWQ~+1`Yd!<8CLPCv?uSl<`( zjyLa#<R@eJzAh;nB%}i5C82knP_?krm1~uhCzSry-I=x`(;<5@P@yx{J}(RcqUCq7 zHP7HP^z;B|V@@pk%~=!6*tP_}`=%p)6!T#o+02zjT0t5h%)dE`QK)yOsUB&(jWcU= zHIdy)i9n~h{qwnhTwPc4W;WFN{oAgURq}*gvTGU$h=7%W1KAdA&Aa_lF%sO3$J_`! zQV8^qW0jekrcg5uJV)>|M#si2m4SvkCgb=Z4mr&jXc+yF5C6i0#~^Z=l3BXa=>&X` z<$spRGyaxO-vJ6BdoedR*$Kx6uoO$ZIdy3S49!#032HlvOlTp-4-{cZl<=1*1vz`> z^xYHl5-Fs*VH7yCf1vJGzW%dqP#09)l^re40c#6GzyT{>Q$V)OFH^OIxbq5rhYXM= zSO7hu_R3l3-O`R71A9j$$hDkWvAmZ-LhMgs(PBg^vF3czFV8_vZ4v3i_d3;o43iZ& z6##8rTB}P$v8s|+m*<*={<y2n)y!^hIkDo78+gp1@kSZ)VM&#Q!wImUKO+x1;Q0K& zEd0n3BiT`FH~b%TIjEq)%OsWF#UA$4v9W6&0Mp(E$vzw(cvH&>LXF(9zEvXPpzf1{ z@MS4?kHg1HBAN}X#duCr(s`buab50`k&`pgC!}}A%+iM7+3;djA=&<<JD9fVTCaC% zP}-uzHameEwwi7GUtiW!(Um+Z#gPFc2Yz1cBB4rn^q(=+0(dR4J&v;M24Fl1Pjt=V p8QSb*D$gq8GkI;0CIcd5;BV1iMZbf;|7WCuQzz{$8qLVb{|7ra_8|ZO
literal 0 HcmV?d00001
diff --git a/lfs/squid-graph b/lfs/squid-graph new file mode 100644 index 0000000..776aa79 --- /dev/null +++ b/lfs/squid-graph @@ -0,0 +1,81 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007-2015 IPFire Team info@ipfire.org # +# # +# 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 = 3.2 + +THISAPP = squid-graph-$(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 = 89ac122a99dc2db67efbdcd2467b9939 + +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) + + cp -f $(DIR_SRC)/squid-graph/squid-graph /usr/bin/squid-graph + chmod 755 /usr/bin/squid-graph + + -mkdir -p /srv/web/ipfire/html/squid-graph + cp -f $(DIR_SRC)/squid-graph/logo.png /srv/web/ipfire/html/squid-graph + + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/make.sh b/make.sh index 189f7d9..d2cc30d 100755 --- a/make.sh +++ b/make.sh @@ -618,6 +618,7 @@ buildipfire() { ipfiremake snort ipfiremake oinkmaster ipfiremake squid + ipfiremake squid-graph ipfiremake squidguard ipfiremake calamaris ipfiremake tcpdump diff --git a/src/scripts/makegraphs b/src/scripts/makegraphs index 0b56b93..fbf0635 100644 --- a/src/scripts/makegraphs +++ b/src/scripts/makegraphs @@ -79,7 +79,7 @@ sub updatehdddata{ print "Error in RRD::create for hdd-".$array[$#array].": $ERROR\n" if $ERROR; }
- # Temperaturlesen w�rde die Platte aufwecken!!! + # Temperaturlesen würde die Platte aufwecken!!! if (!$standby){ $temp = 0; my $smart_output = ''; @@ -134,3 +134,10 @@ foreach (@disks){
updatehdddata($disk); } + +### +### Squid Graphs +### +if ( -e "/var/log/squid/access.log") { + system ("/usr/bin/squid-graph --no-console-log --tcp-only --output-dir=/srv/web/ipfire/html/squid-graph < /var/log/squid/access.log >/dev/null 2>&1"); +}