Responsive web page for project pfstat
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
HUC Stéphane 342cdec074
Start Builder Project and Translation
3 months ago
share/locale Start Builder Project and Translation 3 months ago
tmpl Start Builder Project and Translation 3 months ago
LICENSE First deploiement 3 months ago
README.md Fix informations! 3 months ago
TODO Start Builder Project and Translation 3 months ago
convert-img.sh Fix clear if no TERM 3 months ago
i18n.sh Start Builder Project and Translation 3 months ago
pfstat-builder.sh Start Builder Project and Translation 3 months ago
pfstat.conf First deploiement 3 months ago
pfstat.html Add br 3 months ago
pfstats.html.png Add screenshot 3 months ago
pure-min.css First deploiement 3 months ago
styles.css First deploiement 3 months ago
ui.js First deploiement 3 months ago

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!