The *BSDstats Project

FreeBSD: Install from /usr/ports/sysutils/bsdstats

OpenBSD: OpenBSD does not have the 'periodic' system, but instead has the /etc/daily, /etc/weekly and /etc/monthly scripts, all of which are executed at the corresponding intervals from root's crontab[1].

The daily, weekly and monthly scripts will run the contents of corresponding .local files, so to run the bsdstats script once a month you either

create an /etc/monthly.local script which calls the 300.statistics script,

or, if the the 300.statistics script is the only local script you want to run each month, copy 300.statistics to /etc/monthly.local.

The bsdstats script depends on the setting of some environment variables which on FreeBSD are kept in /etc/periodic.conf. On OpenBSD, the place for locally defined system variables is /etc/rc.conf.local, where you put the lines

monthly_statistics_enable="YES" # needed for bsdstats to work at all
monthly_statistics_report_devices="YES" # optionally report devices too

As indicated by the comments, only the first of those is mandatory for the script to work; the second lets you submit hardware information too if you want to.

With a valid /etc/monthly.local script which runs the statistics script and the /etc/rc.conf.local lines in place, you can either sit back and wait for the monthly script to execute at some point in the future or run the script manually.

[1] sudo crontab -u root -e will show the times and other data about how the scripts are run.

Other BSDs:

  1. Download the script to /usr/local/sbin:
  2. Add a cron entry, as root, to run the script once per month, similar to:
    • 59 00 1 * * /usr/local/sbin/300.statistics

The following variables can be set in /etc/rc.conf.local to enable the statistics, as well as fine tune various parts of it:

After downloading, run it once initially.