From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthias Fischer To: development@lists.ipfire.org Subject: [PATCH] Revived (as addon): squid graphs 3.2 Date: Sun, 12 Nov 2017 21:59:18 +0100 Message-ID: <20171112205918.10570-1-matthias.fischer@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1495973767325707546==" List-Id: --===============1495973767325707546== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, For details see: https://sourceforge.net/projects/squid-graph/ "Squid Graph is a free, simple, yet powerful Squid v2 native logfile analysis= tool that generates reports with graphical representation of the proxy server's tr= affic, somewhat like the popular MRTG tool." I found by chance that the corresponding translation strings were still prese= nt, but not used, so I thought "Why not?". After some tests I decided to revive this tool - here it is as an IPFire addo= n - hopefully this is (some kind of) a final version, perhaps as a base for furth= er maintenance. Contrary to my first attempts - sorry for that! - it was now built as a 'stan= dalone' version, like 'wio' - no tar.gz-sources to up- or download, easier to maintai= n. Main differences to the original version: GUI and scripts were slightly tuned, fully localised and polished for better readability. The old (three) remaining translation strings were remove= d, all needed localisations went in '/var/ipfire/addon-lang/'. For better GUI integration I had to move the menu-entry for 'entropy' one ste= p down, so that the '*-graphs' entries were lying together. I found no problems so far during= testing. Updates are made every five minutes through '/etc/fcron.cyclic', so there was= no need to patch '/usr/local/bin/makegraphs', as it was before. I also removed some unnecessary spaces in 'make.sh' - found by chance, too. Best, Matthias Signed-off-by: Matthias Fischer --- config/menu/20-status.menu | 2 +- config/rootfiles/packages/squid-graph | 16 + langs/de/cgi-bin/de.pl | 3 - langs/en/cgi-bin/en.pl | 3 - langs/es/cgi-bin/es.pl | 3 - langs/fr/cgi-bin/fr.pl | 3 - langs/it/cgi-bin/it.pl | 3 - langs/nl/cgi-bin/nl.pl | 3 - langs/pl/cgi-bin/pl.pl | 3 - langs/ru/cgi-bin/ru.pl | 3 - langs/tr/cgi-bin/tr.pl | 3 - lfs/squid-graph | 90 +++ make.sh | 1 + src/paks/squid-graph/install.sh | 31 + src/paks/squid-graph/uninstall.sh | 28 + src/paks/squid-graph/update.sh | 26 + src/squid-graph/EX-squid-graph.menu | 6 + src/squid-graph/logo.png | Bin 0 -> 3933 bytes src/squid-graph/sgraph.cgi | 72 ++ src/squid-graph/squid-graph | 1280 +++++++++++++++++++++++++++++++= ++ src/squid-graph/squid-graph.de.pl | 49 ++ src/squid-graph/squid-graph.en.pl | 49 ++ src/squid-graph/squid-graph.es.pl | 10 + src/squid-graph/squid-graph.fr.pl | 9 + src/squid-graph/squid-graph.it.pl | 9 + src/squid-graph/squid-graph.nl.pl | 9 + src/squid-graph/squid-graph.pl.pl | 9 + src/squid-graph/squid-graph.ru.pl | 9 + src/squid-graph/squid-graph.tr.pl | 9 + src/squid-graph/update-squid-graph.sh | 8 + 30 files changed, 1721 insertions(+), 28 deletions(-) create mode 100644 config/rootfiles/packages/squid-graph create mode 100644 lfs/squid-graph create mode 100644 src/paks/squid-graph/install.sh create mode 100644 src/paks/squid-graph/uninstall.sh create mode 100644 src/paks/squid-graph/update.sh create mode 100644 src/squid-graph/EX-squid-graph.menu create mode 100644 src/squid-graph/logo.png create mode 100644 src/squid-graph/sgraph.cgi create mode 100644 src/squid-graph/squid-graph create mode 100644 src/squid-graph/squid-graph.de.pl create mode 100644 src/squid-graph/squid-graph.en.pl create mode 100644 src/squid-graph/squid-graph.es.pl create mode 100644 src/squid-graph/squid-graph.fr.pl create mode 100644 src/squid-graph/squid-graph.it.pl create mode 100644 src/squid-graph/squid-graph.nl.pl create mode 100644 src/squid-graph/squid-graph.pl.pl create mode 100644 src/squid-graph/squid-graph.ru.pl create mode 100644 src/squid-graph/squid-graph.tr.pl create mode 100644 src/squid-graph/update-squid-graph.sh diff --git a/config/menu/20-status.menu b/config/menu/20-status.menu index 2bcf0d5e8..2e7c579e3 100644 --- a/config/menu/20-status.menu +++ b/config/menu/20-status.menu @@ -58,7 +58,7 @@ 'title' =3D> "$Lang::tr{'hardware graphs'}", 'enabled' =3D> 1, }; - $substatus->{'61.entropy'} =3D { + $substatus->{'62.entropy'} =3D { 'caption' =3D> "$Lang::tr{'entropy'}", 'uri' =3D> '/cgi-bin/entropy.cgi', 'title' =3D> "$Lang::tr{'entropy graphs'}", diff --git a/config/rootfiles/packages/squid-graph b/config/rootfiles/package= s/squid-graph new file mode 100644 index 000000000..499359cbd --- /dev/null +++ b/config/rootfiles/packages/squid-graph @@ -0,0 +1,16 @@ +etc/fcron.cyclic/update-squid-graph +srv/web/ipfire/cgi-bin/sgraph.cgi +srv/web/ipfire/html/sgraph +srv/web/ipfire/html/sgraph/logo.png +usr/bin/squid-graph +usr/local/bin/update-squid-graph.sh +var/ipfire/addon-lang/squid-graph.de.pl +var/ipfire/addon-lang/squid-graph.en.pl +var/ipfire/addon-lang/squid-graph.es.pl +var/ipfire/addon-lang/squid-graph.fr.pl +var/ipfire/addon-lang/squid-graph.it.pl +var/ipfire/addon-lang/squid-graph.nl.pl +var/ipfire/addon-lang/squid-graph.pl.pl +var/ipfire/addon-lang/squid-graph.ru.pl +var/ipfire/addon-lang/squid-graph.tr.pl +var/ipfire/menu.d/EX-squid-graph.menu diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index 6dff5d781..12da3e2ab 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -1692,7 +1692,6 @@ 'no filter pass' =3D> 'Legen Sie hier die Standardklassen fest durch die nic= ht-gefilterte Pakete gehen.', 'no fritzdsl driver' =3D> 'Kein Fritz!DSL-Treiber vorhanden. Bitte hochladen= .', 'no hardware random number generator' =3D> 'Dieses System hat keine Entropie= quelle.', -'no information available' =3D> 'Keine Informationen verf=C3=BCgbar.', 'no log selected' =3D> 'kein Protokoll ausgew=C3=A4hlt', 'no modem selected' =3D> 'Kein Modem ausgew=C3=A4hlt', 'no set selected' =3D> 'Es wurde kein Satz ausgew=C3=A4hlt', @@ -1934,7 +1933,6 @@ 'proto' =3D> 'Proto', 'protocol' =3D> 'Protokoll:', 'proxy' =3D> 'Proxy', -'proxy access graphs' =3D> 'Diagramme zur Proxyauslastung', 'proxy admin password' =3D> 'Cache Administrator Passwort', 'proxy cachemgr' =3D> 'Cachemanager aktivieren', 'proxy errmsg filedescriptors' =3D> 'Ung=C3=BCltiger Anzahl Filedescriptoren= ', @@ -2157,7 +2155,6 @@ 'ssnetwork status' =3D> 'Netzwerk-Status', 'sspasswords' =3D> 'Passw=C3=B6rter', 'ssport forwarding' =3D> 'Port-Weiterleitung', -'ssproxy graphs' =3D> 'Proxy-Diagramme', 'sssystem status' =3D> 'System-Status', 'sstraffic' =3D> 'Net-Traffic', 'sstraffic graphs' =3D> 'Netzwerk-Diagramme', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 4efff6e65..98694a7ab 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1724,7 +1724,6 @@ 'no filter pass' =3D> 'Enter the standard class for non-filtered packets.', 'no fritzdsl driver' =3D> 'No Fritz!DSL driver. Please upload.', 'no hardware random number generator' =3D> 'This system has no source for en= tropy.', -'no information available' =3D> 'No information available.', 'no log selected' =3D> 'No log selected', 'no modem selected' =3D> 'No modem selected', 'no set selected' =3D> 'No set was selected', @@ -1970,7 +1969,6 @@ 'proto' =3D> 'Proto', 'protocol' =3D> 'Protocol:', 'proxy' =3D> 'Proxy', -'proxy access graphs' =3D> 'Proxy access graphs', 'proxy admin password' =3D> 'Cache administrator password', 'proxy cachemgr' =3D> 'Activate cachemanager', 'proxy errmsg filedescriptors' =3D> 'Wrong amount of filedescriptors', @@ -2199,7 +2197,6 @@ 'ssnetwork status' =3D> 'Network Status', 'sspasswords' =3D> 'Passwords', 'ssport forwarding' =3D> 'Port Forwarding', -'ssproxy graphs' =3D> 'Proxy Graphs', 'sssystem status' =3D> 'System Status', 'sstraffic' =3D> 'Net-Traffic', 'sstraffic graphs' =3D> 'Traffic Graphs', diff --git a/langs/es/cgi-bin/es.pl b/langs/es/cgi-bin/es.pl index ede7b661d..b1fb65e9c 100644 --- a/langs/es/cgi-bin/es.pl +++ b/langs/es/cgi-bin/es.pl @@ -1256,7 +1256,6 @@ 'no eciadsl synch.bin file' =3D> 'No existe archi ECI ADSL synch.bin. Favor = de cargarlo', 'no filter pass' =3D> 'Introduzca la clase est=C3=A1ndar para paquetes no fi= ltrados.', 'no fritzdsl driver' =3D> 'No hay drivers Fritz!DSL. Favor de cargarlos', -'no information available' =3D> 'No hay informaci=C3=B3n disponible', 'no log selected' =3D> 'No ha seleccionado registro log', 'no modem selected' =3D> 'No ha seleccionado m=C3=B3dem', 'no set selected' =3D> 'Ning=C3=BAn conjunto se ha seleccionado', @@ -1437,7 +1436,6 @@ 'proto' =3D> 'Proto', 'protocol' =3D> 'Protocolo:', 'proxy' =3D> 'Proxy', -'proxy access graphs' =3D> 'Gr=C3=A1ficas de acceso al proxy', 'proxy admin password' =3D> 'Password Administrador de Cach=C3=A9', 'proxy cachemgr' =3D> 'Activar Cachemanager', 'proxy errmsg filedescriptors' =3D> 'Cantidad incorrecta de descriptores de = archivos', @@ -1647,7 +1645,6 @@ 'ssnetwork status' =3D> 'Estado de la red', 'sspasswords' =3D> 'Contrase=C3=B1as', 'ssport forwarding' =3D> 'Reenv=C3=ADo de puertos', -'ssproxy graphs' =3D> 'Gr=C3=A1ficas de proxy', 'sssystem status' =3D> 'Status del sistema', 'sstraffic' =3D> 'Net-traffic', 'sstraffic graphs' =3D> 'Gr=C3=A1ficas de tr=C3=A1fico', diff --git a/langs/fr/cgi-bin/fr.pl b/langs/fr/cgi-bin/fr.pl index e896c9b2a..8041db982 100644 --- a/langs/fr/cgi-bin/fr.pl +++ b/langs/fr/cgi-bin/fr.pl @@ -1247,7 +1247,6 @@ 'no eciadsl synch.bin file' =3D> 'aucunfichier ECI ADSL synch.bin. Veuillez = le charger.', 'no filter pass' =3D> 'Entrez la classe standard pour les paquets non filtr= =C3=A9s.', 'no fritzdsl driver' =3D> 'Aucun pilote Fritz!DSL. Veuillez le charger.', -'no information available' =3D> 'Aucune information disponible.', 'no log selected' =3D> 'Aucun rapport s=C3=A9lectionn=C3=A9', 'no modem selected' =3D> 'Aucun modem s=C3=A9lectionn=C3=A9', 'no set selected' =3D> 'Aucun jeu s=C3=A9lectionn=C3=A9', @@ -1443,7 +1442,6 @@ 'proto' =3D> 'Proto', 'protocol' =3D> 'Protocole', 'proxy' =3D> 'Proxy', -'proxy access graphs' =3D> 'Graphiques des acc=C3=A8s proxy', 'proxy admin password' =3D> 'Mot de passe admnistrateur du Cache', 'proxy cachemgr' =3D> 'Activer le gestionnaire de cache', 'proxy errmsg filedescriptors' =3D> 'Mauvais montant de fichier descripteurs= ', @@ -1652,7 +1650,6 @@ 'ssnetwork status' =3D> 'Statut r=C3=A9seau', 'sspasswords' =3D> 'Mots de passe', 'ssport forwarding' =3D> 'Transfert de port', -'ssproxy graphs' =3D> 'Graphiques du proxy', 'sssystem status' =3D> 'Statut syst=C3=A8me', 'sstraffic' =3D> 'Trafic r=C3=A9seau', 'sstraffic graphs' =3D> 'Graphiques du trafic', diff --git a/langs/it/cgi-bin/it.pl b/langs/it/cgi-bin/it.pl index 02e047bb3..fc80a526d 100644 --- a/langs/it/cgi-bin/it.pl +++ b/langs/it/cgi-bin/it.pl @@ -1592,7 +1592,6 @@ 'no filter pass' =3D> 'Enter the standard class for non-filtered packets.', 'no fritzdsl driver' =3D> 'No Fritz!DSL driver. Please upload.', 'no hardware random number generator' =3D> 'This system has no source for en= tropy.', -'no information available' =3D> 'No information available.', 'no log selected' =3D> 'No log selected', 'no modem selected' =3D> 'No modem selected', 'no set selected' =3D> 'No set was selected', @@ -1827,7 +1826,6 @@ 'proto' =3D> 'Proto', 'protocol' =3D> 'Protocolo', 'proxy' =3D> 'Proxy', -'proxy access graphs' =3D> 'Proxy access graphs', 'proxy admin password' =3D> 'Cache administrator password', 'proxy cachemgr' =3D> 'Attiva cachemanager', 'proxy errmsg filedescriptors' =3D> 'Wrong amount of filedescriptors', @@ -2052,7 +2050,6 @@ 'ssnetwork status' =3D> 'Network Status', 'sspasswords' =3D> 'Passwords', 'ssport forwarding' =3D> 'Port Forwarding', -'ssproxy graphs' =3D> 'Proxy Graphs', 'sssystem status' =3D> 'Stato del sistema', 'sstraffic' =3D> 'Traffico di rete', 'sstraffic graphs' =3D> 'Traffic Graphs', diff --git a/langs/nl/cgi-bin/nl.pl b/langs/nl/cgi-bin/nl.pl index 49c0cced6..97553962c 100644 --- a/langs/nl/cgi-bin/nl.pl +++ b/langs/nl/cgi-bin/nl.pl @@ -1555,7 +1555,6 @@ 'no filter pass' =3D> 'Geef de standaard-klasse voor niet-gefilterde pakkett= en.', 'no fritzdsl driver' =3D> 'Geen Fritz!DSL driver. Bestand uploaden a.u.b.', 'no hardware random number generator' =3D> 'Dit systeem heeft geen mogelijkh= eden voor entropie.', -'no information available' =3D> 'Geen informatie beschikbaar.', 'no log selected' =3D> 'Geen log geselecteerd', 'no modem selected' =3D> 'Geen modem geselecteerd', 'no set selected' =3D> 'Geen set geselecteerd', @@ -1780,7 +1779,6 @@ 'proto' =3D> 'Proto', 'protocol' =3D> 'Protocol:', 'proxy' =3D> 'Proxy', -'proxy access graphs' =3D> 'Proxy toegangsgrafieken', 'proxy admin password' =3D> 'Cache beheerder wachtwoord', 'proxy cachemgr' =3D> 'Activeer cachebeheer', 'proxy errmsg filedescriptors' =3D> 'Verkeerd aantal bestandsindicators', @@ -2000,7 +1998,6 @@ 'ssnetwork status' =3D> 'Netwerkstatus', 'sspasswords' =3D> 'Wachtwoorden', 'ssport forwarding' =3D> 'Poort doorsturen', -'ssproxy graphs' =3D> 'Proxy grafieken', 'sssystem status' =3D> 'Systeemstatus', 'sstraffic' =3D> 'Netwerkgebruik', 'sstraffic graphs' =3D> 'Verkeersgrafieken', diff --git a/langs/pl/cgi-bin/pl.pl b/langs/pl/cgi-bin/pl.pl index e2f9da5c0..4788a8599 100644 --- a/langs/pl/cgi-bin/pl.pl +++ b/langs/pl/cgi-bin/pl.pl @@ -1255,7 +1255,6 @@ 'no eciadsl synch.bin file' =3D> 'Brak pliku ECI ADSL synch.bin. Prosz=C4=99= o jego wgranie.', 'no filter pass' =3D> 'Prosz=C4=99 wprowadzi=C4=87 standardow=C4=85 klas=C4= =99 dla pakiet=C3=B3w niefiltrowanych.', 'no fritzdsl driver' =3D> 'Brak sterownika Fritz!DSL. Prosz=C4=99 o jego wg= ranie.', -'no information available' =3D> 'Brak dost=C4=99pnych informacji.', 'no log selected' =3D> 'Nie wybrano logu', 'no modem selected' =3D> 'Nie wybrano modemu', 'no set selected' =3D> 'Nie wybrano ustawienia', @@ -1449,7 +1448,6 @@ 'proto' =3D> 'Proto', 'protocol' =3D> 'Protok=C3=B3=C5=82:', 'proxy' =3D> 'Proxy', -'proxy access graphs' =3D> 'Wykresy dost=C4=99pu do Proxy', 'proxy admin password' =3D> 'Has=C5=82o administratora Cache', 'proxy cachemgr' =3D> 'Aktywuj cachemanager', 'proxy errmsg filedescriptors' =3D> 'Niepoprawna warto=C5=9B=C4=87 w polu fi= ledescriptors', @@ -1659,7 +1657,6 @@ 'ssnetwork status' =3D> 'Stan sieci', 'sspasswords' =3D> 'Has=C5=82a', 'ssport forwarding' =3D> 'Przekierowanie port=C3=B3w', -'ssproxy graphs' =3D> 'Wykresy Proxy', 'sssystem status' =3D> 'Stan systemu', 'sstraffic' =3D> 'Net-Traffic', 'sstraffic graphs' =3D> 'Wykresy ruchu', diff --git a/langs/ru/cgi-bin/ru.pl b/langs/ru/cgi-bin/ru.pl index 4b0edb582..eefa3bc49 100644 --- a/langs/ru/cgi-bin/ru.pl +++ b/langs/ru/cgi-bin/ru.pl @@ -1247,7 +1247,6 @@ 'no eciadsl synch.bin file' =3D> 'No ECI ADSL synch.bin file. Please upload.= ', 'no filter pass' =3D> '=D0=97=D0=B0=D0=B4=D0=B0=D0=B9=D1=82=D0=B5 =D1=81=D1= =82=D0=B0=D0=BD=D0=B4=D0=B0=D1=80=D1=82=D0=BD=D1=8B=D0=B9 =D0=BA=D0=BB=D0=B0= =D1=81=D1=81 =D0=B4=D0=BB=D1=8F =D0=BD=D0=B5=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1= =80=D1=83=D0=B5=D0=BC=D1=8B=D1=85 =D0=BF=D0=B0=D0=BA=D0=B5=D1=82=D0=BE=D0=B2.= ', 'no fritzdsl driver' =3D> 'No Fritz!DSL driver. Please upload.', -'no information available' =3D> 'No information available.', 'no log selected' =3D> 'No log selected', 'no modem selected' =3D> 'No modem selected', 'no set selected' =3D> 'No set was selected', @@ -1444,7 +1443,6 @@ 'proto' =3D> 'Proto', 'protocol' =3D> '=D0=9F=D1=80=D0=BE=D1=82=D0=BE=D0=BA=D0=BE=D0=BB:', 'proxy' =3D> 'Proxy', -'proxy access graphs' =3D> 'Proxy access graphs', 'proxy admin password' =3D> 'Cache administrator password', 'proxy cachemgr' =3D> '=D0=92=D0=BA=D0=BB=D1=8E=D1=87=D0=B8=D1=82=D1=8C =D0= =BC=D0=B5=D0=BD=D0=B5=D0=B4=D0=B6=D0=B5=D1=80 =D0=BA=D1=8D=D1=88=D0=B0', 'proxy errmsg filedescriptors' =3D> 'Wrong amount of filedescriptors', @@ -1654,7 +1652,6 @@ 'ssnetwork status' =3D> '=D0=A1=D1=82=D0=B0=D1=82=D1=83=D1=81 =D1=81=D0=B5= =D1=82=D0=B8', 'sspasswords' =3D> '=D0=9F=D0=B0=D1=80=D0=BE=D0=BB=D0=B8', 'ssport forwarding' =3D> '=D0=9F=D0=B5=D1=80=D0=B5=D0=BD=D0=B0=D0=BF=D1=80= =D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5 =D0=BF=D0=BE=D1=80=D1=82=D0=BE=D0= =B2', -'ssproxy graphs' =3D> 'Proxy Graphs', 'sssystem status' =3D> '=D0=A1=D1=82=D0=B0=D1=82=D1=83=D1=81 =D1=81=D0=B8=D1= =81=D1=82=D0=B5=D0=BC=D1=8B', 'sstraffic' =3D> '=D0=A1=D0=B5=D1=82=D0=B5=D0=B2=D0=BE=D0=B9 =D1=82=D1=80=D0= =B0=D1=84=D0=B8=D0=BA', 'sstraffic graphs' =3D> 'Traffic Graphs', diff --git a/langs/tr/cgi-bin/tr.pl b/langs/tr/cgi-bin/tr.pl index 9eb300006..42e615799 100644 --- a/langs/tr/cgi-bin/tr.pl +++ b/langs/tr/cgi-bin/tr.pl @@ -1660,7 +1660,6 @@ 'no filter pass' =3D> 'Olmayan filtre paketleri i=C3=A7in standart s=C4=B1n= =C4=B1f=C4=B1 girin.', 'no fritzdsl driver' =3D> 'Fritz!DSL s=C3=BCr=C3=BCc=C3=BCs=C3=BC yok. L=C3= =BCtfen y=C3=BCkleyin.', 'no hardware random number generator' =3D> 'Bu sistemin entropi i=C3=A7in ka= yna=C4=9F=C4=B1 yok.', -'no information available' =3D> 'Herhangi bir bilgi bulunmamaktad=C4=B1r.', 'no log selected' =3D> 'G=C3=BCnl=C3=BCk se=C3=A7ilmedi', 'no modem selected' =3D> 'Modem se=C3=A7ilmedi', 'no set selected' =3D> 'Hi=C3=A7bir ayar se=C3=A7ilmedi', @@ -1902,7 +1901,6 @@ 'proto' =3D> 'Kural', 'protocol' =3D> 'Kural ', 'proxy' =3D> 'Vekil sunucu', -'proxy access graphs' =3D> 'Vekil sunucu eri=C5=9Fim grafi=C4=9Fi', 'proxy admin password' =3D> '=C3=96nbellek y=C3=B6netici parolas=C4=B1', 'proxy cachemgr' =3D> '=C3=96nbellek y=C3=B6neticisini aktifle=C5=9Ftir', 'proxy errmsg filedescriptors' =3D> 'Dosya tanimlay=C4=B1c=C4=B1 say=C4=B1s= =C4=B1 yanl=C4=B1=C5=9F miktarda', @@ -2131,7 +2129,6 @@ 'ssnetwork status' =3D> 'A=C4=9F Durumu', 'sspasswords' =3D> 'Parola', 'ssport forwarding' =3D> 'Ba=C4=9Flant=C4=B1 Noktas=C4=B1 Y=C3=B6nlendirme', -'ssproxy graphs' =3D> 'Vekil Sunucu Grafikleri', 'sssystem status' =3D> 'Sistem Durumu', 'sstraffic' =3D> 'A=C4=9F-Trafi=C4=9Fi', 'sstraffic graphs' =3D> 'Trafik Grafi=C4=9Fi', diff --git a/lfs/squid-graph b/lfs/squid-graph new file mode 100644 index 000000000..3d5147103 --- /dev/null +++ b/lfs/squid-graph @@ -0,0 +1,90 @@ +############################################################################= ### +# = # +# IPFire.org - A linux based firewall = # +# Copyright (C) 2007-2017 IPFire Team = # +# = # +# 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 . = # +# = # +############################################################################= ### + +############################################################################= ### +# Definitions +############################################################################= ### + +include Config + +VER =3D 3.2 + +THISAPP =3D squid-graph-$(VER) +DIR_APP =3D $(DIR_SRC)/$(THISAPP) +TARGET =3D $(DIR_INFO)/$(THISAPP) +PROG =3D squid-graph +PAK_VER =3D 1 + +DEPS =3D "" + +############################################################################= ### +# Top-level Rules +############################################################################= ### + +install : $(TARGET) + +check : + +download : + +md5 : + +dist: + @$(PAK) + +############################################################################= ### +# Installation Details +############################################################################= ### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && mkdir $(DIR_APP) && cp -R $(DIR_SRC)/src/squid-graph/= $(DIR_APP) + cd $(DIR_APP) + +# Install GUI + install -v -m 755 $(DIR_APP)/squid-graph/sgraph.cgi \ + /srv/web/ipfire/cgi-bin/sgraph.cgi + +# Create sgraph dir, install logo.png + -mkdir -p /srv/web/ipfire/html/sgraph + install -v -m 644 $(DIR_APP)/squid-graph/logo.png \ + /srv/web/ipfire/html/sgraph/logo.png + +# Install main program + install -v -m 755 $(DIR_APP)/squid-graph/squid-graph \ + /usr/bin/squid-graph + +# Install update script + install -v -m 755 $(DIR_APP)/squid-graph/update-squid-graph.sh \ + /usr/local/bin/update-squid-graph.sh + +# Create symlink for five-minute-update-interval + ln -sf /usr/local/bin/update-squid-graph.sh /etc/fcron.cyclic/update-squid-= graph + +# Install language files + install -v -m 004 $(DIR_APP)/squid-graph/squid-graph.*.pl \ + /var/ipfire/addon-lang/ + +# Install menu entry + install -v -m 644 $(DIR_APP)/squid-graph/EX-squid-graph.menu \ + /var/ipfire/menu.d/EX-squid-graph.menu + + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/make.sh b/make.sh index f8a2e5b34..efcee24b3 100755 --- a/make.sh +++ b/make.sh @@ -877,6 +877,7 @@ buildipfire() { lfsmake2 perl-Net-IP lfsmake2 wio lfsmake2 iftop + lfsmake2 squid-graph } =20 buildinstaller() { diff --git a/src/paks/squid-graph/install.sh b/src/paks/squid-graph/install.sh new file mode 100644 index 000000000..1e3b60c6e --- /dev/null +++ b/src/paks/squid-graph/install.sh @@ -0,0 +1,31 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire 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 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire 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 IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team . = # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh + +extract_files + +# Update language-cache +/usr/local/bin/update-lang-cache + +chown nobody.nobody /var/ipfire/menu.d/EX-squid-graph.menu diff --git a/src/paks/squid-graph/uninstall.sh b/src/paks/squid-graph/uninsta= ll.sh new file mode 100644 index 000000000..dac570c05 --- /dev/null +++ b/src/paks/squid-graph/uninstall.sh @@ -0,0 +1,28 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire 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 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire 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 IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team . = # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh + +remove_files + +/usr/local/bin/update-lang-cache diff --git a/src/paks/squid-graph/update.sh b/src/paks/squid-graph/update.sh new file mode 100644 index 000000000..89c40d0d7 --- /dev/null +++ b/src/paks/squid-graph/update.sh @@ -0,0 +1,26 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire 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 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire 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 IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team . = # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +./uninstall.sh +./install.sh diff --git a/src/squid-graph/EX-squid-graph.menu b/src/squid-graph/EX-squid-g= raph.menu new file mode 100644 index 000000000..a46bf6a79 --- /dev/null +++ b/src/squid-graph/EX-squid-graph.menu @@ -0,0 +1,6 @@ + $substatus->{'61.squid-graph'} =3D { + 'caption' =3D> "$Lang::tr{'ssproxy graphs'}", + 'uri' =3D> '/cgi-bin/sgraph.cgi', + 'title' =3D> "$Lang::tr{'ssproxy graphs'}", + 'enabled' =3D> 1, + }; diff --git a/src/squid-graph/logo.png b/src/squid-graph/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..e2fe57b703e2662ec3fd9b70b6cfb= 6de4425aadf GIT binary patch literal 3933 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 = # +# = # +# 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 . = # +# = # +############################################################################= ### + +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 =3D (); + +&Header::showhttpheaders(); + +my $dir =3D "/srv/web/ipfire/html/sgraph"; +my $sgraphdir =3D "/srv/web/ipfire/html/sgraph"; + +&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 =3D 1; + while () + { + $skip =3D 1 if /^
$/; + if ($skip) + { + $skip =3D 0 if /

/; + next; + } + s/]+)>/3D'Graph'/; + s/
/
/g; + s/
/
/g; + s/<([^>]*)>/\L<$1>\E/g; + s/(size|align|border|color)=3D([^'"> ]+)/$1=3D'$2'/g; + print; + } + close(IPACHTML); +} +else { + print $Lang::tr{'no information available'}; } + +&Header::closebox(); + +&Header::closebigbox(); + +&Header::closepage(); diff --git a/src/squid-graph/squid-graph b/src/squid-graph/squid-graph new file mode 100644 index 000000000..7b96d867f --- /dev/null +++ b/src/squid-graph/squid-graph @@ -0,0 +1,1280 @@ +#!/usr/bin/perl + +##################################################################### +# +# Squid Graph version 3.2 +# http://squid-graph.sourceforge.net +# +# This program is distributed under the GNU General Public License +# See gpl.txt for full license information +# +##################################################################### + +use strict; +use GD; + +require '/var/ipfire/general-functions.pl'; +require "${General::swroot}/lang.pl"; +#require "${General::swroot}/header.pl"; + + +# Program version (DO NOT TOUCH THIS) +my $VER =3D "3.2 release"; + +# Enable console logging? (1 =3D on, 0 =3D off) +my $CONSOLELOG =3D 0; + +# "Global" variables (DO NOT TOUCH THESE) +my %config; # configuration details here +my %color; # colours configuration + +# Define graph colours [RRR,GGG,BBB] +$color{'bg'} =3D ['F5','F5','F5']; # graph background color +$color{'fg'} =3D ['00','00','00']; # graph foreground color +$color{'gr'} =3D ['33','33','99']; # graph total line color +$color{'hit'} =3D ['99','33','33']; # graph hit line color +$color{'miss'} =3D ['33','99','33']; # graph miss line color +$color{'ims'} =3D ['99','33','99']; # graph ims hit line color +$color{'hbg'} =3D ['FF','FF','FF']; # html report background color + +############ DO NOT EDIT ANYTHING BELOW THIS LINE ############## + +# Forward subroutine declaration +sub main(); # main program body +sub error($); # error(string: $msg); +sub warning($); # warning(string: $msg); +sub console_log($); # console_log(string: $msg); +sub parse_argv(); # requires defined %config +sub config_check(); # requires defined %config +sub create_gd(); # returns $imgAccess, $graphAccess; +sub write_img($$); # write image to file +sub plot($$\$\@\@\@\@); # plot($type,$gdimg,@totalData,@hitData,@missData,$i= msData); +sub hr_units($); # hr_units(int: $num); +sub hr_bytes($); # hr_bytes(int: $num); +sub hr_digits($$); # hr_digits(int: $num, char: $units); +sub dec_truncate($$); # dec_truncate($num,$decplaces); +sub comma_sep($); # comma_sep($num); +sub help(); # help(string: $helpCmd); + +# Parse and check arguments +parse_argv(); +if (config_check()) { + main(); +} +else { + error("Configuration check failed."); +} + +# Main subroutine +sub main() { + + # + # NOTES + # + # Graph stats: Total, Hit, Miss, IMS/Err + # TCP, UDP + # Access, Transfer + # + + my ($have_tcp, $have_udp) =3D (0,0); + my $have_cumulative =3D 0; + my $have_transfer =3D 1; + my $logStart =3D 0; + my $title =3D "Squid Graph Logfile Analysis Report"; + my $graphLength =3D 60*60*24; # Graph is 24 hours long + my $progStart =3D $^T; + my $progSpeed =3D 0; + my $duration =3D 0; + my $lineCounter =3D 0; + my $errorLines =3D 0; + + # Statistics data + my @tcpAccessTotal; + my @tcpAccessHit; + my @tcpAccessMiss; + my @tcpAccessIMS; + my @tcpTransferTotal; + my @tcpTransferHit; + my @tcpTransferMiss; + my @tcpTransferIMS; + my @tcpTimeTotal; + my @tcpTimeHit; + my @tcpTimeMiss; + my @tcpTimeIMS; + my @udpAccessTotal; + my @udpAccessHit; + my @udpAccessMiss; + my @udpTransferTotal; + my @udpTransferHit; + my @udpTransferMiss; + my @udpTimeTotal; + my @udpTimeHit; + my @udpTimeMiss; + + # Image objects + my ($tcpAccessImg, $tcpTransferImg, $tcpTimeImg); + my ($udpAccessImg, $udpTransferImg, $udpTimeImg); + + # Stats counter + my $i =3D 0; + + console_log("Squid-graph $VER OK. Program started."); + console_log("Graph domain is $graphLength seconds."); + + # Report title specified + if (exists $config{'title'}) { + $title =3D $config{'title'}; + } + console_log("Setting report title to \"$title\"."); + + # Determine if cumulative graps were configured + if (exists $config{'cumulative'}) { + console_log("Configured for cumulative curves."); + $have_cumulative =3D 1; + } + else { + console_log("Configured for default histograms."); + } + + # Determine if TCP or UDP configured + if (exists $config{'tcp-only'}) { + console_log('Configured have_tcp.'); + ($have_tcp, $have_udp) =3D (1,0); + } + elsif (exists $config{'udp-only'}) { + console_log('Configured have_udp.'); + ($have_tcp, $have_udp) =3D (0,1); + } + else { + console_log('Configured have_tcp and have_udp.'); + ($have_tcp, $have_udp) =3D (1,1); + } + + # Determine have_transfer + if (exists $config{'no-transfer-duration'}) { + console_log("Transfer duration graph(s) disabled."); + $have_transfer =3D 0; + } + elsif ($have_cumulative) { + console_log("Transfer duration graph(s) automatically disabled."); + $have_transfer =3D 0; + } + else { + console_log("Transfer duration graph(s) enabled."); + } + + # Was --start or --end specified? + if (exists $config{'start'}) { + $logStart =3D $config{'start'}; + } + elsif (exists $config{'end'}) { + $logStart =3D $config{'end'} - $graphLength; + } + else { + $logStart =3D time() - $graphLength; + } + console_log("Configured start time to $logStart."); + + # Are we ready? + console_log("Reading STDIN for logfile input."); + + foreach () { + # Increment line counter + $lineCounter++; + + # Activity log + #console_log("Read $lineCounter lines from STDIN.") if ($lineCounter%80000= =3D=3D 0); + + # Split the line + my @logParts =3D split(' '); + + # Check if lines are erroneous, i.e. incorrect number of parts + if ($#logParts !=3D 9) { + $errorLines++; + console_log("Invalid log data at line $lineCounter. Error #$errorLines."); + } + + # Skip irrelevant lines + elsif (($logParts[0] >=3D $logStart) && ($i < 288)) { + + # Gets the x value correct + while ($logStart + (300 * ($i + 1)) < $logParts[0]) { $i++; } + + # Declare vars + my $isTCP =3D 0; + my $isUDP =3D 0; + my $isHit =3D 0; + my $isMiss =3D 0; + + # Is this a hit or miss? + $isHit =3D 1 if ($logParts[3] =3D~ /HIT/); + $isMiss =3D 1 if ($logParts[3] =3D~ /MISS/); + + # Protocol check + if ($logParts[3] =3D~ /TCP/) { $isTCP =3D 1 if ($have_tcp); } + elsif ($logParts[3] =3D~ /UDP/) { $isUDP =3D 1 if ($have_udp); } + + # Unknown protocol? Can't be! + else { + $errorLines++; + console_log("Invalid log data at line $lineCounter. Error #$errorLines."= ); + } + + # Collect data + if ($isTCP) { + $tcpAccessTotal[$i]++; + $tcpTransferTotal[$i] +=3D $logParts[4]; + $tcpTimeTotal[$i] +=3D $logParts[1]/1000; + if ($isHit) { + $tcpAccessHit[$i]++; + $tcpTransferHit[$i] +=3D $logParts[4]; + $tcpTimeHit[$i] +=3D $logParts[1]/1000; + if ($logParts[3] =3D~ /IMS/) { + $tcpAccessIMS[$i]++; + $tcpTransferIMS[$i] +=3D $logParts[4]; + } + } + elsif ($isMiss) { + $tcpAccessMiss[$i]++; + $tcpTransferMiss[$i] +=3D $logParts[4]; + $tcpTimeMiss[$i] +=3D $logParts[1]/1000; + } + } + elsif ($isUDP) { + $udpAccessTotal[$i]++; + $udpTransferTotal[$i] +=3D $logParts[4]; + $udpTimeTotal[$i] +=3D $logParts[1]/1000; + if ($isHit) { + $udpAccessHit[$i]++; + $udpTransferHit[$i] +=3D $logParts[4]; + $udpTimeHit[$i] +=3D $logParts[1]/1000; + } + elsif ($isMiss) { + $udpAccessMiss[$i]++; + $udpTransferMiss[$i] +=3D $logParts[4]; + $udpTimeMiss[$i] +=3D $logParts[1]/1000; + } + } + + # Undefine vars + undef $isTCP; + undef $isUDP; + undef $isHit; + undef $isMiss; + } + + undef @logParts; + } + + # Calculate transfer duration averages + if ($have_transfer) { + # Activity log + console_log("Calculating averages for TCP/UDP transfer duration."); + + # Start looping + my $i; + for ($i =3D 0; $i < 288; $i++) { + if ($have_tcp) { + $tcpTimeTotal[$i] =3D ($tcpAccessTotal[$i] =3D=3D 0)?0:$tcpTimeTotal[$i]= /$tcpAccessTotal[$i]; + $tcpTimeHit[$i] =3D ($tcpAccessHit[$i] =3D=3D 0)?0:$tcpTimeHit[$i]/$tcpA= ccessHit[$i]; + $tcpTimeMiss[$i] =3D ($tcpAccessMiss[$i] =3D=3D 0)?0:$tcpTimeMiss[$i]/$t= cpAccessMiss[$i];=20 + } + if ($have_udp) { + $udpTimeTotal[$i] =3D ($udpAccessTotal[$i] =3D=3D 0)?0:$udpTimeTotal[$i]= /$udpAccessTotal[$i]; + $udpTimeHit[$i] =3D ($udpAccessHit[$i] =3D=3D 0)?0:$udpTimeHit[$i]/$udpA= ccessHit[$i]; + $udpTimeMiss[$i] =3D ($udpAccessMiss[$i] =3D=3D 0)?0:$udpTimeMiss[$i]/$u= dpAccessMiss[$i]; + } + } + undef $i; + } + + # Cumulate the data + if ($have_cumulative) { + # Activity log + console_log("Cumulating log data for TCP/UDP graphs."); + + # Start looping + my $i; + for ($i =3D 0; $i < 288; $i++) { + if ($have_tcp) { + $tcpAccessTotal[$i + 1] +=3D $tcpAccessTotal[$i]; + $tcpAccessHit[$i + 1] +=3D $tcpAccessHit[$i]; + $tcpAccessMiss[$i + 1] +=3D $tcpAccessMiss[$i]; + $tcpAccessIMS[$i + 1] +=3D $tcpAccessIMS[$i]; + $tcpTransferTotal[$i + 1] +=3D $tcpTransferTotal[$i]; + $tcpTransferHit[$i + 1] +=3D $tcpTransferHit[$i]; + $tcpTransferMiss[$i + 1] +=3D $tcpTransferMiss[$i]; + $tcpTransferIMS[$i + 1] +=3D $tcpTransferIMS[$i]; + } + if ($have_udp) { + $udpAccessTotal[$i + 1] +=3D $udpAccessTotal[$i]; + $udpAccessHit[$i + 1] +=3D $udpAccessHit[$i]; + $udpAccessMiss[$i + 1] +=3D $udpAccessMiss[$i]; + $udpTransferTotal[$i + 1] +=3D $udpTransferTotal[$i]; + $udpTransferHit[$i + 1] +=3D $udpTransferHit[$i]; + $udpTransferMiss[$i + 1] +=3D $udpTransferMiss[$i]; + } + } + undef $i; + } + + # Done parsing, now calculate some stats + $duration =3D time() - $progStart; + $duration =3D 1 if ($duration <=3D 0); + $progSpeed =3D dec_truncate($lineCounter/$duration,2); + + # Do some console logging + console_log("Done reading $lineCounter lines from logfile on STDIN. ($error= Lines $Lang::tr{'errors'})"); + console_log("Analysis duration is $duration seconds, $progSpeed lines/sec."= ); + + # Create image objects + if ($have_tcp) { + console_log('Creating TCP image objects.'); + $tcpAccessImg =3D create_gd(); + $tcpTransferImg =3D create_gd(); + $tcpTimeImg =3D create_gd() if ($have_transfer); + } + if ($have_udp) { + console_log('Creating UDP image objects.'); + $udpAccessImg =3D create_gd(); + $udpTransferImg =3D create_gd(); + $udpTimeImg =3D create_gd() if ($have_transfer); + } + + # Plot the graphs + my $c; + my @nullArr; + $c =3D 'C' if ($have_cumulative); + if ($have_tcp) { + console_log("Plotting graph of TCP accesses."); + plot("TA$c", $logStart, $tcpAccessImg,@tcpAccessTotal,@tcpAccessHit,@tcpAc= cessMiss,@tcpAccessIMS); + console_log("Plotting graph of TCP transfers."); + plot("TX$c", $logStart, $tcpTransferImg,@tcpTransferTotal,@tcpTransferHit,= @tcpTransferMiss,@tcpAccessIMS); + if ($have_transfer) { + console_log("Plotting graph of TCP transfer duration."); + plot("TD", $logStart, $tcpTimeImg,@tcpTimeTotal,@tcpTimeHit,@tcpTimeMiss,= @nullArr); + } + } + if ($have_udp) { + console_log("Plotting graph of UDP accesses."); + plot("UA$c", $logStart, $udpAccessImg,@udpAccessTotal,@udpAccessHit,@udpTr= ansferMiss,@nullArr); + console_log("Plotting graph of UDP transfers."); + plot("UX$c", $logStart, $udpTransferImg,@udpTransferTotal,@udpTransferHit,= @udpTransferMiss,@nullArr); + if ($have_transfer) { + console_log("Plotting graph of UDP transfer duration."); + plot("UD", $logStart, $udpTimeImg,@udpTimeTotal,@udpTimeHit,@udpTimeMiss,= @nullArr); + } + } + undef @nullArr; + undef $c; + + # Graph plotted! Now we save it + if ($have_tcp) { + write_img($tcpAccessImg,'tcp-access.png'); + write_img($tcpTransferImg,'tcp-transfer.png'); + write_img($tcpTimeImg,'tcp-duration.png') if ($have_transfer); + } + if ($have_udp) { + write_img($udpAccessImg,'udp-access.png'); + write_img($udpTransferImg,'udp-transfer.png'); + write_img($udpTimeImg,'udp-duration.png') if ($have_transfer); + } + + # Time to gather additional statistics which are not on the graph :) + console_log("Gathering additional statistics."); + + my $tcpAccessTotals =3D 0; + my $tcpAccessAverage =3D 0; + + my $tcpAccessMissTotals =3D 0; + my $tcpAccessMissPercentage =3D 0; + my $tcpAccessMissAverage =3D 0; + + my $tcpAccessHitTotals =3D 0; + my $tcpAccessHitPercentage =3D 0; + my $tcpAccessHitAverage =3D 0; + + my $tcpAccessIMSTotals =3D 0; + my $tcpAccessIMSPercentage =3D 0; + my $tcpAccessIMSAverage =3D 0; + + my $tcpTransferTotals =3D 0; + my $tcpTransferAverage =3D 0; + + my $tcpTransferHitTotals =3D 0; + my $tcpTransferHitPercentage =3D 0; + my $tcpTransferHitAverage =3D 0; + + my $tcpTransferMissTotals =3D 0; + my $tcpTransferMissPercentage =3D 0; + my $tcpTransferMissAverage =3D 0; + + my $tcpTransferIMSTotals =3D 0; + my $tcpTransferIMSPercentage =3D 0; + my $tcpTransferIMSAverage =3D 0; + + my $tcpTimeTotals =3D 0; + my $tcpTimeAverage =3D 0; + my $tcpTimeHitTotals =3D 0; + my $tcpTimeHitAverage =3D 0; + my $tcpTimeMissTotals =3D 0; + my $tcpTimeMissAverage =3D 0; + + my $udpAccessTotals =3D 0; + my $udpAccessAverage =3D 0; + + my $udpAccessMissTotals =3D 0; + my $udpAccessMissPercentage =3D 0; + my $udpAccessMissAverage =3D 0; + + my $udpAccessHitTotals =3D 0; + my $udpAccessHitPercentage =3D 0; + my $udpAccessHitAverage =3D 0; + + my $udpTransferTotals =3D 0; + my $udpTransferAverage =3D 0; + + my $udpTransferMissTotals =3D 0; + my $udpTransferMissPercentage =3D 0; + my $udpTransferMissAverage =3D 0; + + my $udpTransferHitTotals =3D 0; + my $udpTransferHitPercentage =3D 0; + my $udpTransferHitAverage =3D 0; + + my $udpTimeTotals =3D 0; + my $udpTimeAverage =3D 0; + my $udpTimeHitTotals =3D 0; + my $udpTimeHitAverage =3D 0; + my $udpTimeMissTotals =3D 0; + my $udpTimeMissAverage =3D 0; + + + # Get the totals + + if ($have_cumulative) { + if ($have_tcp) { + $tcpAccessTotals =3D $tcpAccessTotal[$#tcpAccessTotal]; + $tcpAccessHitTotals =3D $tcpAccessHit[$#tcpAccessHit]; + $tcpAccessMissTotals =3D $tcpAccessMiss[$#tcpAccessMiss]; + $tcpAccessIMSTotals =3D $tcpAccessIMS[$#tcpAccessIMS]; + + $tcpTransferTotals =3D $tcpTransferTotal[$#tcpTransferTotal]; + $tcpTransferHitTotals =3D $tcpTransferHit[$#tcpTransferHit]; + $tcpTransferMissTotals =3D $tcpTransferMiss[$#tcpTransferMiss]; + $tcpTransferIMSTotals =3D $tcpTransferIMS[$#tcpTransferIMS]; + } + if ($have_udp) { + $udpAccessTotals =3D $udpAccessTotal[$#udpAccessTotal]; + $udpAccessHitTotals =3D $udpAccessHit[$#udpAccessHit]; + $udpAccessMissTotals =3D $udpAccessMiss[$#udpAccessMiss]; + + $udpTransferTotals =3D $udpTransferTotal[$#udpTransferTotal]; + $udpTransferHitTotals =3D $udpTransferHit[$#udpTransferHit]; + $udpTransferMissTotals =3D $udpTransferMiss[$#udpTransferMiss]; + } + + } + else { + my $i; + for ($i =3D 0; $i < 288; $i++) { + if ($have_tcp) { + $tcpAccessTotals +=3D $tcpAccessTotal[$i]; + $tcpAccessHitTotals +=3D $tcpAccessHit[$i]; + $tcpAccessMissTotals +=3D $tcpAccessMiss[$i]; + $tcpAccessIMSTotals +=3D $tcpAccessIMS[$i]; + + $tcpTransferTotals +=3D $tcpTransferTotal[$i]; + $tcpTransferHitTotals +=3D $tcpTransferHit[$i]; + $tcpTransferMissTotals +=3D $tcpTransferMiss[$i]; + $tcpTransferIMSTotals +=3D $tcpTransferIMS[$i]; + + if ($have_transfer) { + $tcpTimeTotals +=3D $tcpTimeTotal[$i]; + $tcpTimeHitTotals +=3D $tcpTimeHit[$i]; + $tcpTimeMissTotals +=3D $tcpTimeMiss[$i]; + } + } + + if ($have_udp) { + $udpAccessTotals +=3D $udpAccessTotal[$i]; + $udpAccessHitTotals +=3D $udpAccessHit[$i]; + $udpAccessMissTotals +=3D $udpAccessMiss[$i]; + + $udpTransferTotals +=3D $udpTransferTotal[$i]; + $udpTransferHitTotals +=3D $udpTransferHit[$i]; + $udpTransferMissTotals +=3D $udpTransferMiss[$i]; + + if ($have_transfer) { + $udpTimeTotals +=3D $udpTimeTotal[$i]; + $udpTimeHitTotals +=3D $udpTimeHit[$i]; + $udpTimeMissTotals +=3D $udpTimeMiss[$i]; + } + } + } + undef $i; + } + + # Calculate averages and percentages + + sub percentage($$) { + my $val =3D shift; + my $tot =3D shift; + return dec_truncate(($tot =3D=3D 0)?0:(($val/$tot) * 100),2); + }; + + if ($have_tcp) { + $tcpAccessAverage =3D dec_truncate($tcpAccessTotals/24,2); + $tcpAccessHitAverage =3D dec_truncate($tcpAccessHitTotals/24,2); + $tcpAccessMissAverage =3D dec_truncate($tcpAccessMissTotals/24,2); + $tcpAccessIMSAverage =3D dec_truncate($tcpAccessIMSTotals/24,2); + + $tcpTransferAverage =3D hr_bytes($tcpTransferTotals/24); + $tcpTransferHitAverage =3D hr_bytes($tcpTransferHitTotals/24); + $tcpTransferMissAverage =3D hr_bytes($tcpTransferMissTotals/24); + $tcpTransferIMSAverage =3D hr_bytes($tcpTransferIMSTotals/24); + + $tcpAccessHitPercentage =3D percentage($tcpAccessHitTotals,$tcpAccessTota= ls); + $tcpAccessMissPercentage =3D percentage($tcpAccessMissTotals,$tcpAccessTo= tals); + + $tcpTransferHitPercentage =3D percentage($tcpTransferHitTotals,$tcpTransf= erTotals); + $tcpTransferMissPercentage =3D percentage($tcpTransferMissTotals,$tcpTran= sferTotals); + + if ($have_transfer) { + $tcpTimeAverage =3D dec_truncate($tcpTimeTotals/288,2); + $tcpTimeHitAverage =3D dec_truncate($tcpTimeHitTotals/288,2); + $tcpTimeMissAverage =3D dec_truncate($tcpTimeMissTotals/288,2); + } + } + + if ($have_udp) { + $udpAccessAverage =3D dec_truncate($udpAccessTotals/24,2); + $udpAccessHitAverage =3D dec_truncate($udpAccessHitTotals/24,2); + $udpAccessMissAverage =3D dec_truncate($udpAccessMissTotals/24,2); + + $udpTransferAverage =3D hr_bytes($udpTransferTotals/24); + $udpTransferHitAverage =3D hr_bytes($udpTransferHitTotals/24); + $udpTransferMissAverage =3D hr_bytes($udpTransferMissTotals/24); + + $udpAccessHitPercentage =3D percentage($udpAccessHitTotals,$udpAccessTota= ls); + $udpAccessMissPercentage =3D percentage($udpAccessMissTotals,$udpAccessTo= tals); + + $udpTransferHitPercentage =3D percentage($udpTransferHitTotals,$udpTransf= erTotals); + $udpTransferMissPercentage =3D percentage($udpTransferMissTotals,$udpTran= sferTotals); + + if ($have_transfer) { + $udpTimeAverage =3D dec_truncate($udpTimeTotals/288,2); + $udpTimeHitAverage =3D dec_truncate($udpTimeHitTotals/288,2); + $udpTimeMissAverage =3D dec_truncate($udpTimeMissTotals/288,2); + } + } + + # Some tiny date/time conversions + my $progStartTime =3D localtime($progStart); + my $logStartTime =3D localtime($logStart); + my $logEndTime =3D localtime($logStart + 86400); + + # Colours + my $bgcolor =3D "$color{'hbg'}[0]$color{'hbg'}[1]$color{'hbg'}[2]"; + my $fgcolor =3D "$color{'fg'}[0]$color{'fg'}[1]$color{'fg'}[2]"; + my $grcolor =3D "$color{'gr'}[0]$color{'gr'}[1]$color{'gr'}[2]"; + my $hitcolor =3D "$color{'hit'}[0]$color{'hit'}[1]$color{'hit'}[2]"; + my $misscolor =3D "$color{'miss'}[0]$color{'miss'}[1]$color{'miss'}[2]"; + my $imscolor =3D "$color{'ims'}[0]$color{'ims'}[1]$color{'ims'}[2]" if ($ha= ve_tcp); + + # Make some things more redable to the human eye + if ($have_tcp) { + $tcpAccessTotals =3D dec_truncate($tcpAccessTotals,2); + $tcpAccessHitTotals =3D dec_truncate($tcpAccessHitTotals,2); + $tcpAccessMissTotals =3D dec_truncate($tcpAccessMissTotals,2); + $tcpAccessIMSTotals =3D dec_truncate($tcpAccessIMSTotals,2); + $tcpTransferTotals =3D hr_bytes($tcpTransferTotals); + $tcpTransferHitTotals =3D hr_bytes($tcpTransferHitTotals); + $tcpTransferMissTotals =3D hr_bytes($tcpTransferMissTotals); + $tcpTransferIMSTotals =3D hr_bytes($tcpTransferIMSTotals); + } + if ($have_udp) { + $udpAccessTotals =3D dec_truncate($udpAccessTotals,2); + $udpAccessHitTotals =3D dec_truncate($udpAccessHitTotals,2); + $udpAccessMissTotals =3D dec_truncate($udpAccessMissTotals,2); + $udpTransferTotals =3D hr_bytes($udpTransferTotals); + $udpTransferHitTotals =3D hr_bytes($udpTransferHitTotals); + $udpTransferMissTotals =3D hr_bytes($udpTransferMissTotals); + } + + + console_log("Writing index.html file."); + + open(IDX, ">$config{'output-dir'}/index.html") || + error("Can't write to file $config{'output-dir'}/index.html. Check directo= ry permissions?"); + + print IDX "\n"; + print IDX "\n"; + print IDX "$title\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "

$title

\n"; + print IDX "
\n"; + + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "
$Lang::tr{'generated'}:$progStartTime
$Lang::tr{'lines analyzed'}:$lineCounter $Lang::tr{'lines'} ($errorLines $Lang::tr{'errors'}= )
$Lang::tr{'analysis duration'}:$duration $Lang::tr{'seconds'}
$Lang::tr{'analysis speed'}:$progSpeed $Lang::tr{'lines sec'}
$Lang::tr{'graph start'}:$logStartTime
$Lang::tr{'graph end'}:$logEndTime
$Lang::tr{'graph domain'}:24 $Lang::tr{'hours'} ($Lang::tr{'24hseconds'})
\n"; + + sub generate_html_row($$$) { + my $color =3D shift; + my $key =3D shift; + my $value =3D shift; + my $ret; + + $ret =3D ""; + $ret .=3D "$key:<= /FONT>"; + $ret .=3D "$valu= e"; + $ret .=3D "\n"; + + undef $color; + undef $key; + undef $value; + + return $ret; + } + + if ($have_tcp) { + print IDX "


\n"; + print IDX "

$Lang::tr{'graph of tcp accesses'}

\n" if (!$have_cumul= ative); + print IDX "

$Lang::tr{'cumulative graph of tcp accesses'}

\n" if ($= have_cumulative); + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "
\n"; + print IDX "\n"; + print IDX generate_html_row($grcolor,"$Lang::tr{'total accesses'}",$tcpAcc= essTotals); + print IDX generate_html_row($grcolor,"$Lang::tr{'average accesses'}","$tcp= AccessAverage $Lang::tr{'per hour'}"); + print IDX generate_html_row($hitcolor,"$Lang::tr{'total cache hits'}",$tcp= AccessHitTotals); + print IDX generate_html_row($hitcolor,"$Lang::tr{'average cache hits'}","$= tcpAccessHitAverage $Lang::tr{'per hour'}"); + print IDX generate_html_row($hitcolor,"$Lang::tr{'percent cache hits'}","$= tcpAccessHitPercentage %"); + print IDX generate_html_row($imscolor,"$Lang::tr{'total cache ims hits'}",= $tcpAccessIMSTotals); + print IDX generate_html_row($imscolor,"$Lang::tr{'average cache ims hits'}= ","$tcpAccessIMSAverage $Lang::tr{'per hour'}"); + print IDX generate_html_row($misscolor,"$Lang::tr{'total cache misses'}",$= tcpAccessMissTotals); + print IDX generate_html_row($misscolor,"$Lang::tr{'average cache misses'}"= ,"$tcpAccessMissAverage $Lang::tr{'per hour'}"); + print IDX generate_html_row($misscolor,"$Lang::tr{'percent cache misses'}"= ,"$tcpAccessMissPercentage %"); + print IDX "
\n"; + print IDX "
\n"; + print IDX "

$Lang::tr{'graph of tcp transfers'}

\n" if (!$have_cumu= lative); + print IDX "

$Lang::tr{'cumulative graph of tcp transfers'}

\n" if (= $have_cumulative); + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "
\n"; + print IDX "\n"; + print IDX generate_html_row($grcolor,"$Lang::tr{'total transfers'}",$tcpTr= ansferTotals); + print IDX generate_html_row($grcolor,"$Lang::tr{'average transfers'}","$tc= pTransferAverage $Lang::tr{'per hour'}"); + print IDX generate_html_row($hitcolor,"$Lang::tr{'total cache hits'}",$tcp= TransferHitTotals); + print IDX generate_html_row($hitcolor,"$Lang::tr{'average cache hits'}","$= tcpTransferHitAverage $Lang::tr{'per hour'}"); + print IDX generate_html_row($hitcolor,"$Lang::tr{'percent cache hits'}","$= tcpTransferHitPercentage %"); + print IDX generate_html_row($imscolor,"$Lang::tr{'total cache ims hits'}",= $tcpTransferIMSTotals); + print IDX generate_html_row($imscolor,"$Lang::tr{'average cache ims hits'}= ","$tcpTransferIMSAverage $Lang::tr{'per hour'}"); + print IDX generate_html_row($misscolor,"$Lang::tr{'total cache misses'}",$= tcpTransferMissTotals); + print IDX generate_html_row($misscolor,"$Lang::tr{'average cache misses'}"= ,"$tcpTransferMissAverage $Lang::tr{'per hour'}"); + print IDX generate_html_row($misscolor,"$Lang::tr{'percent cache misses'}"= ,"$tcpTransferMissPercentage %"); + print IDX "
\n"; + print IDX "
\n"; + if ($have_transfer) { + print IDX "

$Lang::tr{'graph of average tcp transfer duration'}

\n= "; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "
\n"; + print IDX "\n"; + print IDX generate_html_row($grcolor,"$Lang::tr{'avg transfer duration'}"= ,"$tcpTimeAverage $Lang::tr{'seconds'}"); + print IDX generate_html_row($hitcolor,"$Lang::tr{'avg cache hit duration'= }","$tcpTimeHitAverage $Lang::tr{'seconds'}"); + print IDX generate_html_row($misscolor,"$Lang::tr{'avg cache miss duratio= n'}","$tcpTimeMissAverage $Lang::tr{'seconds'}"); + print IDX "
\n"; + print IDX "
\n"; + } + } + + if ($have_udp) { + print IDX "


\n"; + print IDX "

$Lang::tr{'graph of udp accesses'}

\n" if (!$have_cumul= ative); + print IDX "

$Lang::tr{'cumulative graph of udp accesses'}

\n" if ($= have_cumulative); + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "
\n"; + print IDX "\n"; + print IDX generate_html_row($grcolor,"$Lang::tr{'total accesses'}",$udpAcc= essTotals); + print IDX generate_html_row($grcolor,"$Lang::tr{'average accesses'}","$udp= AccessAverage $Lang::tr{'per hour'}"); + print IDX generate_html_row($hitcolor,"$Lang::tr{'total cache hits'}",$udp= AccessHitTotals); + print IDX generate_html_row($hitcolor,"$Lang::tr{'average cache hits'}","$= udpAccessHitAverage $Lang::tr{'per hour'}"); + print IDX generate_html_row($hitcolor,"$Lang::tr{'percent cache hits'}","$= udpAccessHitPercentage %"); + print IDX generate_html_row($misscolor,"$Lang::tr{'total cache misses'}",$= udpAccessMissTotals); + print IDX generate_html_row($misscolor,"$Lang::tr{'average cache misses'}"= ,"$udpAccessMissAverage $Lang::tr{'per hour'}"); + print IDX generate_html_row($misscolor,"$Lang::tr{'percent cache misses'}"= ,"$udpAccessMissPercentage %"); + print IDX "
\n"; + print IDX "
\n"; + print IDX "

$Lang::tr{'graph of udp transfers'}

\n" if (!$have_cumu= lative); + print IDX "

$Lang::tr{'cumulative graph of udp transfers'}

\n" if (= $have_cumulative); + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "
\n"; + print IDX "\n"; + print IDX generate_html_row($grcolor,"$Lang::tr{'total transfers'}",$udpTr= ansferTotals); + print IDX generate_html_row($grcolor,"$Lang::tr{'average transfers'}","$ud= pTransferAverage $Lang::tr{'per hour'}"); + print IDX generate_html_row($hitcolor,"$Lang::tr{'total cache hits'}",$udp= TransferHitTotals); + print IDX generate_html_row($hitcolor,"$Lang::tr{'average cache hits'}","$= udpTransferHitAverage $Lang::tr{'per hour'}"); + print IDX generate_html_row($hitcolor,"$Lang::tr{'percent cache hits'}","$= udpTransferHitPercentage %"); + print IDX generate_html_row($misscolor,"$Lang::tr{'total cache misses'}",$= udpTransferMissTotals); + print IDX generate_html_row($misscolor,"$Lang::tr{'average cache misses'}"= ,"$udpTransferMissAverage $Lang::tr{'per hour'}"); + print IDX generate_html_row($misscolor,"$Lang::tr{'percent cache misses'}"= ,"$udpTransferMissPercentage %"); + print IDX "
\n"; + print IDX "
\n"; + if ($have_transfer) { + print IDX "

$Lang::tr{'graph of average udp transfer duration'}

\n= "; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "\n"; + print IDX "
\n"; + print IDX "\n"; + print IDX generate_html_row($grcolor,"$Lang::tr{'avg transfer duration'}"= ,"$udpTimeAverage $Lang::tr{'seconds'}"); + print IDX generate_html_row($hitcolor,"$Lang::tr{'avg cache hit duration'= }","$udpTimeHitAverage $Lang::tr{'seconds'}"); + print IDX generate_html_row($misscolor,"$Lang::tr{'avg cache miss duratio= n'}","$udpTimeMissAverage $Lang::tr{'seconds'}"); + print IDX "
\n"; + print IDX "
\n"; + } + } + + print IDX < +
+
+ + +
+version $VER + + + + +EOF + close(IDX); + + console_log("Done."); + console_log("Remember to copy logo.png found in your Squid Graph images/ di= rectory to $config{'output-dir'}!"); + +} + +# Error output +sub error($) { + my $LOG =3D shift; + die "ERROR: $LOG Exiting.\n"; +} + +# Warning output +sub warning($) { + my $LOG =3D shift; + print STDERR "WARNING: $LOG\n"; + undef $LOG; +} + +# Just for console logging +sub console_log($) { + if ($CONSOLELOG) { + my $TIME =3D localtime(time()); + my $LOG =3D shift; + print "[$TIME] $LOG\n"; + undef $LOG; + } +} + +# Help +sub help() { +print <interlaced('true'); + $IMG->rectangle(0,0,$width-1,$height-1, + $IMG->colorAllocate(hex($color{'bg'}[0]),hex($color{'bg'}[1]),hex($color{'= bg'}[2]))); + + undef $width; + undef $height; + + return $IMG; +} + +# Write images +sub write_img($$) { + my $IMG =3D shift; + my $filename =3D shift; + + console_log("Writing to file $config{'output-dir'}/$filename"); + open(GD, ">$config{'output-dir'}/$filename") || + error("Cannot write to file $config{'output-dir'}/$filename. Check directo= ry permissions?"); + binmode GD; + print GD $IMG->png(); + close(GD); +} + +sub plot($$\$\@\@\@\@) { + my $type =3D shift; + my $logStart =3D shift; + my $imgRef =3D shift; + my $totalRef =3D shift; + my $hitRef =3D shift; + my $missRef =3D shift; + my $imsRef =3D shift; + my ($isTCP, $isUDP) =3D (0,0); + my $isCum =3D 0; + my ($width, $height) =3D $$imgRef->getBounds(); + my $font =3D gdSmallFont; + my $fontWidth =3D $font->width(); + my $fontHeight =3D $font->height(); + + # Check type options + $isCum =3D 1 if ($type =3D~ /C/); + $isTCP =3D 1 if ($type =3D~ /T/); + $isUDP =3D 1 if ($type =3D~ /U/); + + # Colour tables + my $fgcolor =3D $$imgRef->colorAllocate(hex($color{'fg'}[0]),hex($color{'= fg'}[1]),hex($color{'fg'}[2])); + my $grcolor =3D $$imgRef->colorAllocate(hex($color{'gr'}[0]),hex($color{'= gr'}[1]),hex($color{'gr'}[2])); + my $hitcolor =3D $$imgRef->colorAllocate(hex($color{'hit'}[0]),hex($color{= 'hit'}[1]),hex($color{'hit'}[2])); + my $misscolor =3D $$imgRef->colorAllocate(hex($color{'miss'}[0]),hex($color= {'miss'}[1]),hex($color{'miss'}[2])); + my $imscolor =3D $$imgRef->colorAllocate(hex($color{'ims'}[0]),hex($color{= 'ims'}[1]),hex($color{'ims'}[2])); + + # Dotted brush + $$imgRef->setStyle($fgcolor,gdTransparent,gdTransparent); + + # + # NOTES + # + # graph area w/h =3D 288/200 + # graph area l/t =3D 62/20 + # graph area eff =3D 62,20,350,220 + # + + # Draw the border + $$imgRef->rectangle(0,0,$width-1,$height-1,$fgcolor); +=09 + # Draw the title at the left side + my $title; + $title =3D "Cumulative " if ($isCum); + $title =3D "Average " if ($type =3D~ /D/); + $title .=3D "TCP " if ($isTCP); + $title .=3D "UDP " if ($isUDP); + $title .=3D "Accesses" if ($type =3D~ /A/); + $title .=3D "Transfers (bytes)" if ($type =3D~ /X/); + $title .=3D "Transfer Duration (secs)" if ($type =3D~ /D/); + my $titlewidth =3D ($fontWidth * length($title)); + my $titlestart =3D ((($height - $titlewidth) / 2) + $titlewidth); + $$imgRef->stringUp($font,5,$titlestart,$title,$fgcolor); + undef $titlewidth; + undef $titlestart; + undef $title; + + # Determine the maximal and per pixel size of the graph + my ($graphMax) =3D sort {$b <=3D> $a} @$totalRef; + if ((sort {$b <=3D> $a} @$hitRef)[0] > $graphMax) { + $graphMax =3D (sort {$b <=3D> $a} @$hitRef)[0]; + } + if ((sort {$b <=3D> $a} @$missRef)[0] > $graphMax) { + $graphMax =3D (sort {$b <=3D> $a} @$missRef)[0]; + } + # Over-estimate max by 0.5% + $graphMax =3D ($graphMax < 1)?1:$graphMax * 1.05; + my $dotSize =3D $graphMax / 200; + + # Plot the graph + my $i; + my $lastTotalPos =3D 0; + my $lastHitPos =3D 0; + my $lastMissPos =3D 0; + my $lastIMSPos =3D 0; + for ($i =3D 0; $i < 288; $i++) { + my $totalPos =3D int($$totalRef[$i] / $dotSize); + my $hitPos =3D int($$hitRef[$i] / $dotSize); + my $missPos =3D int($$missRef[$i] / $dotSize); + my $imsPos; + $imsPos =3D int($$imsRef[$i] / $dotSize) if ($isTCP); + + # Draw in sequence. Drawing later will make line appear "on-top" + $$imgRef->line($i + 62, 219 - $lastIMSPos, $i + 63, 219 - $imsPos, $imscol= or) if ($isTCP); + $$imgRef->line($i + 62, 219 - $lastMissPos, $i + 63, 219 - $missPos, $miss= color); + $$imgRef->line($i + 62, 219 - $lastHitPos, $i + 63, 219 - $hitPos, $hitcol= or); + $$imgRef->line($i + 62, 219 - $lastTotalPos, $i + 63, 219 - $totalPos, $gr= color); + =09 + $lastTotalPos =3D $totalPos; + $lastHitPos =3D $hitPos; + $lastMissPos =3D $missPos; + $lastIMSPos =3D $imsPos if ($isTCP); + undef $totalPos; + undef $hitPos; + undef $missPos; + undef $imsPos; + } + undef $i; + undef $lastTotalPos; + undef $lastHitPos; + undef $lastMissPos; + undef $lastIMSPos; + + # Draw the graph plotting area bounding boxes and quarter markings + $$imgRef->line(62,70,350,70,gdStyled); + $$imgRef->line(62,120,350,120,gdStyled); + $$imgRef->line(62,170,350,170,gdStyled); + $$imgRef->rectangle(62,20,350,220,$fgcolor); + + # Label the vertical (Y) axis + my $Q =3D $graphMax/4; + my $Q1 =3D hr_digits($graphMax,hr_units($graphMax)); + my $Q2 =3D hr_digits($Q * 3,hr_units($graphMax)); + my $Q3 =3D hr_digits($Q * 2,hr_units($graphMax)); + my $Q4 =3D hr_digits($Q * 1,hr_units($graphMax)); + + $$imgRef->string($font,58-(length($Q1)*$fontWidth),20-($fontHeight/2),"$Q1"= ,$fgcolor); + $$imgRef->string($font,58-(length($Q2)*$fontWidth),70-($fontHeight/2),"$Q2"= ,$fgcolor); + $$imgRef->string($font,58-(length($Q3)*$fontWidth),120-($fontHeight/2),"$Q3= ",$fgcolor); + $$imgRef->string($font,58-(length($Q4)*$fontWidth),170-($fontHeight/2),"$Q4= ",$fgcolor); + + $$imgRef->line(59,20,62,20,$fgcolor); + $$imgRef->line(59,70,62,70,$fgcolor); + $$imgRef->line(59,120,62,120,$fgcolor); + $$imgRef->line(59,170,62,170,$fgcolor); + + # Write down the max value + # The max was overestimated. We shall get it again. + my ($graphMax) =3D sort {$b <=3D> $a} @$totalRef; + if ((sort {$b <=3D> $a} @$hitRef)[0] > $graphMax) { + $graphMax =3D (sort {$b <=3D> $a} @$hitRef)[0]; + } + if ((sort {$b <=3D> $a} @$missRef)[0] > $graphMax) { + $graphMax =3D (sort {$b <=3D> $a} @$missRef)[0]; + } + $graphMax =3D dec_truncate($graphMax,1); + $$imgRef->string($font,350-(length("Max: $graphMax") * $fontWidth),(20-$fon= tHeight)/2+1,"Max: $graphMax",$fgcolor); + + undef $Q; + undef $Q1; + undef $Q2; + undef $Q3; + undef $Q4; + + undef $dotSize;=09 + undef $graphMax; + + # Label the horizontal (X) axis + my $i =3D 0; + my $alt =3D 0; + for ($i =3D 0; $i < 288; $i++) { + my ($sec, $min, $hour) =3D localtime($logStart + (300 * $i)); + if (($min > 57) || ($min < 3)) { + $$imgRef->line(63 + $i, 20, 63 + $i, 220, gdStyled); + $$imgRef->line(63 + $i, 220, 63 + $i, 223, $fgcolor); + if ($alt) { + $$imgRef->string($font,63+$i-((length($hour) * $fontWidth)/2),224,"$hour= ",$fgcolor); + $alt =3D 0; + } + else { $alt =3D 1; } + } + undef $sec; + undef $min; + undef $hour; + + } + + undef $i; + undef $alt; + + + # Undefine all the vars used + undef $type; + undef $logStart; + undef $imgRef; + undef $totalRef; + undef $hitRef; + undef $missRef; + undef $imsRef; + undef $isTCP; + undef $isUDP; + undef $width; + undef $height; + undef $fgcolor; + undef $grcolor; + undef $hitcolor; + undef $misscolor; + undef $imscolor; + +} + + +sub dec_truncate($$) { + my $num =3D shift; + my $dp =3D shift; + if ($dp eq '') { + $dp =3D 1; + } + my $power =3D 10; + my $i =3D 0; + for ($i =3D 1; $i < $dp; $i++) { + $power =3D $power * 10; + } + return int($num * $power)/$power; +} + +sub comma_sep($) { + my $num =3D shift; + my $len =3D length($num); + my @str =3D split('', "$num"); + my $val; + my $i; + for ($i =3D $len - 1; $i >=3D 0; $i--) { + if ((($len - $i - 1)%3 =3D=3D 0) && ($i > 0) && ($i < $len - 1)) { + $val =3D "$str[$i]\,$val" + } + else { + $val =3D "$str[$i]$val"; + } + } + undef $i; + undef $len; + undef $num; + undef @str; + return $val; +} + +sub hr_units($) { + my $num =3D shift; + if ($num >=3D 1000000000) { + return 'G'; + } + elsif ($num >=3D 1000000) { + return 'M'; + } + elsif ($num >=3D 1000) { + return 'K'; + } + else { + return ''; + } +} + +# hr_digits(int: $num, char: $units); +sub hr_digits($$) { + my $num =3D shift; + my $unit =3D shift; + my $val =3D dec_truncate($num,1); + + $val =3D dec_truncate($num/1000000000,1) if ($unit eq 'G'); + $val =3D dec_truncate($num/1000000,1) if ($unit eq 'M'); + $val =3D dec_truncate($num/1000,1) if ($unit eq 'K'); + + return "$val$unit"; +} + +sub hr_bytes($) { + my $num =3D shift; + my $val; + if ($num > 1000000000) { + $val =3D dec_truncate($num/1000000000,1); + return "$val Gb"; + } + elsif ($num > 1000000) { + $val =3D dec_truncate($num/1000000,1); + return "$val Mb"; + } + elsif ($num > 1000) { + $val =3D dec_truncate($num/1000,1); + return "$val Kb"; + } + else { + $val =3D dec_truncate($num,1); + return "$val bytes"; + } +} + +# Undefine "global" vars +undef %config; +undef %color; +undef $CONSOLELOG; +undef $VER; diff --git a/src/squid-graph/squid-graph.de.pl b/src/squid-graph/squid-graph.= de.pl new file mode 100644 index 000000000..54d1d414d --- /dev/null +++ b/src/squid-graph/squid-graph.de.pl @@ -0,0 +1,49 @@ +%tr =3D ( +%tr, + +'24hseconds' =3D> '86400 Sekunden', +'analysis duration' =3D> 'Analyse - Dauer', +'analysis speed' =3D> 'Analyse - Geschwindigkeit', +'average accesses' =3D> 'Zugriffe - Durchschnitt', +'average cache hits' =3D> 'Cache-Treffer - Durchschnitt', +'average cache ims hits' =3D> 'Cache-IMS-Treffer - Durchschnitt', +'average cache misses' =3D> 'Cache verfehlt - Durchschnitt', +'average transfers' =3D> 'Transfers - Durchschnitt', +'avg cache hit duration' =3D> 'Cache-Dauer (Treffer)', +'avg cache miss duration' =3D> 'Cache-Dauer (verfehlt)', +'avg transfer duration' =3D> 'Transfer-Dauer', +'cumulative graph of tcp accesses' =3D> 'TCP-Zugriffe (Zusammenfassung)', +'cumulative graph of tcp transfers' =3D> 'TCP-Transfers (Zusammenfassung)', +'cumulative graph of udp accesses' =3D> 'UDP-Zugriffe (Zusammenfassung)', +'cumulative graph of udp transfers' =3D> 'UDP-Transfers (Zusammenfassung)', +'errors' =3D> 'Fehler', +'generated' =3D> 'Erstellt', +'graph domain' =3D> 'Diagramm - Zeitraum', +'graph end' =3D> 'Diagramm - Ende', +'graph of average tcp transfer duration' =3D> 'TCP-Transfer-Dauer (Durchschn= itt)', +'graph of average udp transfer duration' =3D> 'UDP-Transfer-Dauer (Durchschn= itt)', +'graph of tcp accesses' =3D> 'TCP-Zugriffe (alle 5 Minuten)', +'graph of tcp transfers' =3D> 'TCP-Transfers (alle 5 Minuten)', +'graph of udp accesses' =3D> 'UDP-Zugriffe (alle 5 Minuten)', +'graph of udp transfers' =3D> 'UDP-Transfers (alle 5 Minuten)', +'graph start' =3D> 'Diagramm - Start', +'hours' =3D> 'Stunden', +'lines analyzed' =3D> 'Analysierte Zeilen
(access.log)', +'lines sec' =3D> 'Zeilen/Sekunde', +'lines' =3D> 'Zeilen', +'no information available' =3D> 'Keine Informationen verf=C3=BCgbar.', +'percent cache hits' =3D> 'Cache-Treffer - Prozent', +'percent cache misses' =3D> 'Cache verfehlt - Prozent', +'per hour' =3D> 'pro Stunde', +'proxy access graphs' =3D> 'Diagramme zur Proxyauslastung', +'seconds' =3D> 'Sekunde(n)', +'ssproxy graphs' =3D> 'Proxy-Diagramme', +'total accesses' =3D> 'Zugriffe - gesamt', +'total cache hits' =3D> 'Cache-Treffer - gesamt', +'total cache ims hits' =3D> 'Cache-IMS-Treffer - gesamt', +'total cache misses' =3D> 'Cache verfehlt - gesamt', +'total transfers' =3D> 'Transfers - gesamt', + +); + +#EOF diff --git a/src/squid-graph/squid-graph.en.pl b/src/squid-graph/squid-graph.= en.pl new file mode 100644 index 000000000..385729352 --- /dev/null +++ b/src/squid-graph/squid-graph.en.pl @@ -0,0 +1,49 @@ +%tr =3D ( +%tr, + +'24hseconds' =3D> '86400 seconds', +'analysis duration' =3D> 'Analysis Duration', +'analysis speed' =3D> 'Analysis Speed', +'average accesses' =3D> 'Average Accesses', +'average cache hits' =3D> 'Average Cache Hits', +'average cache ims hits' =3D> 'Average Cache IMS Hits', +'average cache misses' =3D> 'Average Cache Misses', +'average transfers' =3D> 'Average Transfers', +'avg cache hit duration' =3D> 'Avg. Cache Hit Duration', +'avg cache miss duration' =3D> 'Avg. Cache Miss Duration', +'avg transfer duration' =3D> 'Avg. Transfer Duration', +'cumulative graph of tcp accesses' =3D> 'TCP Accesses - cumulative', +'cumulative graph of tcp transfers' =3D> 'TCP Transfers - cumulative', +'cumulative graph of udp accesses' =3D> 'UDP Accesses - cumulative', +'cumulative graph of udp transfers' =3D> 'UDP Transfers - cumulative', +'errors' =3D> 'error(s)', +'generated' =3D> 'Generated', +'graph domain' =3D> 'Graph Domain', +'graph end' =3D> 'Graph End', +'graph of average tcp transfer duration' =3D> 'Average TCP Transfer Duration= ', +'graph of average udp transfer duration' =3D> 'Average UDP Transfer Duration= ', +'graph of tcp accesses' =3D> 'TCP Accesses (5 minute total)', +'graph of tcp transfers' =3D> 'TCP Transfers (5 minute total)', +'graph of udp accesses' =3D> 'UDP Accesses (5 minute total)', +'graph of udp transfers' =3D> 'UDP Transfers (5 minute total)', +'graph start' =3D> 'Graph Start', +'hours' =3D> 'hours', +'lines analyzed' =3D> 'Lines analyzed
(access.log)', +'lines sec' =3D> 'lines/sec', +'lines' =3D> 'lines', +'no information available' =3D> 'No information available.', +'percent cache hits' =3D> '% Cache Hits', +'percent cache misses' =3D> '% Cache Misses', +'per hour' =3D> 'per hour', +'proxy access graphs' =3D> 'Proxy access graphs', +'seconds' =3D> 'second(s)', +'ssproxy graphs' =3D> 'Proxy Graphs', +'total accesses' =3D> 'Total Accesses', +'total cache hits' =3D> 'Total Cache Hits', +'total cache ims hits' =3D> 'Total Cache IMS Hits', +'total cache misses' =3D> 'Total Cache Misses', +'total transfers' =3D> 'Total Transfers', + +); + +#EOF diff --git a/src/squid-graph/squid-graph.es.pl b/src/squid-graph/squid-graph.= es.pl new file mode 100644 index 000000000..a113e1203 --- /dev/null +++ b/src/squid-graph/squid-graph.es.pl @@ -0,0 +1,10 @@ +%tr =3D (=20 +%tr, + +'no information available' =3D> 'No hay informaci=C3=B3n disponible', +'proxy access graphs' =3D> 'Gr=C3=A1ficas de acceso al proxy', +'ssproxy graphs' =3D> 'Gr=C3=A1ficas de proxy', + +); + +#EOF diff --git a/src/squid-graph/squid-graph.fr.pl b/src/squid-graph/squid-graph.= fr.pl new file mode 100644 index 000000000..a2c59f50d --- /dev/null +++ b/src/squid-graph/squid-graph.fr.pl @@ -0,0 +1,9 @@ +%tr =3D (=20 +%tr, + +'no information available' =3D> 'Aucune information disponible.', +'proxy access graphs' =3D> 'Graphiques des acc=C3=A8s proxy', +'ssproxy graphs' =3D> 'Graphiques du proxy', +); + +#EOF diff --git a/src/squid-graph/squid-graph.it.pl b/src/squid-graph/squid-graph.= it.pl new file mode 100644 index 000000000..6d2a3a5a9 --- /dev/null +++ b/src/squid-graph/squid-graph.it.pl @@ -0,0 +1,9 @@ +%tr =3D (=20 +%tr, + +'no information available' =3D> 'No information available.', +'proxy access graphs' =3D> 'Proxy access graphs', +'ssproxy graphs' =3D> 'Proxy Graphs', +); + +#EOF diff --git a/src/squid-graph/squid-graph.nl.pl b/src/squid-graph/squid-graph.= nl.pl new file mode 100644 index 000000000..b3a2105e0 --- /dev/null +++ b/src/squid-graph/squid-graph.nl.pl @@ -0,0 +1,9 @@ +%tr =3D (=20 +%tr, + +'no information available' =3D> 'Geen informatie beschikbaar.', +'proxy access graphs' =3D> 'Proxy toegangsgrafieken', +'ssproxy graphs' =3D> 'Proxy grafieken', +); + +#EOF diff --git a/src/squid-graph/squid-graph.pl.pl b/src/squid-graph/squid-graph.= pl.pl new file mode 100644 index 000000000..254286f1a --- /dev/null +++ b/src/squid-graph/squid-graph.pl.pl @@ -0,0 +1,9 @@ +%tr =3D (=20 +%tr, + +'no information available' =3D> 'Brak dost=C4=99pnych informacji.', +'proxy access graphs' =3D> 'Wykresy dost=C4=99pu do Proxy', +'ssproxy graphs' =3D> 'Wykresy Proxy', +); + +#EOF diff --git a/src/squid-graph/squid-graph.ru.pl b/src/squid-graph/squid-graph.= ru.pl new file mode 100644 index 000000000..6d2a3a5a9 --- /dev/null +++ b/src/squid-graph/squid-graph.ru.pl @@ -0,0 +1,9 @@ +%tr =3D (=20 +%tr, + +'no information available' =3D> 'No information available.', +'proxy access graphs' =3D> 'Proxy access graphs', +'ssproxy graphs' =3D> 'Proxy Graphs', +); + +#EOF diff --git a/src/squid-graph/squid-graph.tr.pl b/src/squid-graph/squid-graph.= tr.pl new file mode 100644 index 000000000..139fa2aa1 --- /dev/null +++ b/src/squid-graph/squid-graph.tr.pl @@ -0,0 +1,9 @@ +%tr =3D (=20 +%tr, + +'no information available' =3D> 'Herhangi bir bilgi bulunmamaktad=C4=B1r.', +'proxy access graphs' =3D> 'Vekil sunucu eri=C5=9Fim grafi=C4=9Fi', +'ssproxy graphs' =3D> 'Vekil Sunucu Grafikleri', +); + +#EOF diff --git a/src/squid-graph/update-squid-graph.sh b/src/squid-graph/update-s= quid-graph.sh new file mode 100644 index 000000000..4251607f7 --- /dev/null +++ b/src/squid-graph/update-squid-graph.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +### +### Squid-Graphs +### +if [ -e "/var/log/squid/access.log" ]; then + /usr/bin/squid-graph --no-console-log --tcp-only --output-dir=3D/srv/web/ip= fire/html/sgraph < /var/log/squid/access.log >/dev/null 2>&1; +fi --=20 2.15.0 --===============1495973767325707546==--