Some CLI Fun

  • User count:find /var/log/usercache/ -name "*.sqlite3" -exec sqlite3 {} "select strftime('%Y-%m-%d',datetime(timestamp,'unixepoch')), count(*) from data group by 1;" \;
  • Unique IP count:find /var/log/woodshed/*/guardian3/idx -name "*.idx3" -mtime -7 -exec sqlite3 {} "select strftime('%Y-%m-%d',datetime(date,'unixepoch')), count(DISTINCT ip) from data group by 1;" \;
  • Take a full backup:su -c '/usr/bin/smoothwall/backupall.pl $(date +%Y%m%d_%H%M)' nobody
  • Bandwidth logs:find /var/log/woodshed/*/traffic/idx/ -type f -name "*.idx3" -exec sqlite3 {} "select strftime('%Y-%m-%d',date,'unixepoch'), protocol, max(bytes) from data where direction = 'out' group by 2;" \;
  • Bandwidth logs with IP:find /var/log/woodshed/*/traffic/idx/ -type f -name "*.idx3" -exec sqlite3 {} "select strftime('%Y-%m-%d',date,'unixepoch'), protocol, address, max(bytes) from data where direction = 'in' group by 2;" \;
  • Send me your stats:curl --upload-file /var/log/dansguardian3/error.log https://smoothwall.io/g3stats

What's this all about then?

This tool contains a number of tools across various domains to help Smoothwall customers, partners, and engineers to test various aspects of the system.