Responsive web page for project pfstat
Go to file
HUC Stéphane 342cdec074
Start Builder Project and Translation
2021-07-31 21:54:53 +02:00
share/locale Start Builder Project and Translation 2021-07-31 21:54:53 +02:00
tmpl Start Builder Project and Translation 2021-07-31 21:54:53 +02:00
LICENSE First deploiement 2021-07-27 23:46:13 +02:00
README.md Fix informations! 2021-07-29 19:49:44 +02:00
TODO Start Builder Project and Translation 2021-07-31 21:54:53 +02:00
convert-img.sh Fix clear if no TERM 2021-07-28 01:43:34 +02:00
i18n.sh Start Builder Project and Translation 2021-07-31 21:54:53 +02:00
pfstat-builder.sh Start Builder Project and Translation 2021-07-31 21:54:53 +02:00
pfstat.conf First deploiement 2021-07-27 23:46:13 +02:00
pfstat.html Add br 2021-07-28 01:52:57 +02:00
pfstats.html.png Add screenshot 2021-07-28 00:00:29 +02:00
pure-min.css First deploiement 2021-07-27 23:46:13 +02:00
styles.css First deploiement 2021-07-27 23:46:13 +02:00
ui.js First deploiement 2021-07-27 23:46:13 +02:00

README.md

pfstats

Description

dataviz projet to view the images created by pfstat project.

BSD Licensed 2-Clause

⇒ pfstat.conf: personnal config files for IPv4, IPv6 (no Queue), for pfstat

  • network interface: em0
  • directory web: /var/www/htdocs/pfstat

⇒ pfstat.html: Responsive web page for project pfstat

  • CSS: pure-min.css, styles.css
  • JS: ui.js — short JS to manipulate UI correctly.
  • based on PureCSS Framework

⇒ convert-img.sh: script sh to convert JPEG image to Webp and Avif format (tested on pdksh, on OpenBSD 6.9)


Installation

  1. Install pfstat package: # pkg_add pfstat
  2. Copy pfstat.conf to /etc
  3. Set and active httpd
  4. Set crontab
  5. Install needed packages for convert-img.sh: # pkg_add libavif libwebp

Configuration

PF

⇒ modify your /etc/pf.conf to add:

set loginterface em0

Restart your PF:

# pfctl -nf /etc/pf.conf && pfctl -f /etc/pf.conf

httpd

⇒ create need directory to publish the pfstat images:

# mkdir -p /var/www/htdocs/pfstat/

⇒ create/copy httpd.conf file into /etc:

types {
    include "/usr/share/misc/mime.types"

    image/avif	avif
}

server "pfstat" {
	listen on 127.0.0.1 port 80
 
	location "/pfstat/" {
		directory auto index
		root "/htdocs/"
	}

}

⇒ check file config and start the daemon:

# httpd -n && rcctl start httpd

pfstat.(conf,html)

⇒ copy file config to /etc

⇒ copy files html and needed css, js on the httpd directory.

  • Yearly views:

It's possible to obtain and see yearly views. Uncomment blocks view on both pfstat* files; this need to change too the crontab time to delete — (the third line).

crontab

### pfstat
*  * * * * /usr/local/bin/pfstat -q -d /var/db/pfstat/pfstat.db
*/15 * * * * /usr/local/bin/pfstat -p -d /var/db/pfstat/pfstat.db; /dir/convert-img.sh ; chown -R www /var/www/htdocs/pfstat
30 0 * * * /usr/local/bin/pfstat -t 30 -d /var/db/pfstat/pfstat.db

Think to mkdir:

# mkdir -p /var/db/pfstat/

convert-img.sh

  1. chmod 0700

Screenshot

Screenshot about the PFstats page

Troubleshooting

ALTQ-style queues not supported anymore

It seems collectors on queues are not more supported. Comment or delete all relevent collectors and images lines.

dbopen: /var/db/pfstat/pfstat.db: No such file or directory

Have-you really created the needed directory‽


Enjoy-ID!
Enjoy-IT!