Check and monitor the server
bugsoft status and production:check show at a glance whether the server is all right; how to connect them to your monitoring.
Two commands show whether Bugsoft Portal runs well. Use them after the installation, after every update, and in your monitoring.
bugsoft status
sudo bugsoft status
It shows:
- the version;
- whether PHP-FPM, the web server and MariaDB (if it is on this server) are running;
- whether
/healthzanswers; - how old the last backup is;
- how many days the certificate is still valid;
- whether the keys still need to go into the password vault;
- the result of
production:check.
| Exit code | Meaning |
|---|---|
0 | Everything is all right. |
1 | Advice: for example, the backup is older than 36 hours, or the certificate expires within 30 days. |
2 | Error: a service is not running, /healthz does not answer, or production:check reports an error. |
These codes work like those of Nagios and similar monitoring tools.
production:check
sudo bugsoft production:check sudo bugsoft production:check --json
One list: ✓ good, ! advice, ✗ fix this first. With a ✗ the command exits with code 1.
With --json you get the same rows as JSON (passes, and per row key,
status and text), for a script or your monitoring.
It checks, among other things: the environment and debug, the keys, the address (https), PHP and its extensions, the database, the last backup, free disk space, the permissions of the configuration file, the scheduled tasks, sign-in, the emergency account and the licence. Every row is explained below, under Every row of production:check.
Every row of production:check
The first column is the key of the row in --json. Rows that do not apply to your server, such as
the SQLite rows with MariaDB, are not shown.
| Row | Good when | How to fix it |
|---|---|---|
env | APP_ENV is production | Change the configuration file (The configuration file). |
debug | APP_DEBUG is off | Set APP_DEBUG=false: with debug on, visitors see error details. |
demo | Demo mode is off | Set APP_DEMO=false. A demo belongs on a server of its own. |
key | APP_KEY is set | sudo bugsoft key:generate on a new server; see Keys and secrets on the server. |
vault | VAULT_KEKS is set | sudo bugsoft vault:keygen; see Keys and secrets on the server. |
url | APP_URL starts with https:// | Set up HTTPS on the web server or the proxy (HTTPS, proxy and load balancer). |
installed | The installation is locked and install.token is gone | sudo bugsoft install:lock |
bug_mark | The BugOS ladybird (the favicon and the assistant mark) is unchanged | Put back the files from the package, and contact the vendor. |
php | PHP 8.2 or newer with all extensions | Install what the row names (What the server needs). |
php_eol | The PHP version still gets security updates | Plan PHP 8.3 or 8.4. A PHP package of your distribution gets fixes from the distribution itself. |
crypto | Encryption works and CRYPTO_SUITE is fixed | Set CRYPTO_SUITE to the suite the row names, and never change it again. |
opcache | OPcache is on | Install and enable php-opcache. |
uploads | upload_max_filesize is at least 6M | In the php.ini of the website, set upload_max_filesize=6M and post_max_size=8M. |
migrations | All database changes have been made | sudo bugsoft migrate (an update does this by itself). |
sqlite_place | The SQLite database is outside the web folder | Move it at once, and change DB_DATABASE. |
sqlite_write | The database and its folder are writable for PHP | Make the PHP-FPM user the owner of the folder. With SELinux: give the folder the type httpd_sys_rw_content_t (semanage fcontext and restorecon); install.sh does this itself. |
sqlite_wal | SQLite runs in WAL mode | Bugsoft Portal switches WAL on itself. If it is off, the database is often on a network disk. Move it to a local disk. |
sqlite_health | The database is not damaged | Restore a backup (Backups and restoring). |
backup | There is a backup from the last 36 hours | See Backups and restoring. With MariaDB in Docker, the backup is made outside Bugsoft Portal; the row then says so. |
db_tls | The database is on this server, or the connection uses TLS and checks the certificate | Set DB_SSL_CA (and if needed DB_SSL_CERT and DB_SSL_KEY); see Encryption and keys. |
storage | The folder storage/ is writable | Make the PHP-FPM user the owner. |
disk | More than 1 GB is free | Make space, or remove old backups. |
env_file | The configuration file is only readable by its owner | chmod 600 on the file. |
env_place | The configuration file is outside the web folder | Move it at once. If it could be downloaded, make new keys. |
cron | The scheduled tasks ran in the last 15 minutes | See Scheduled tasks (cron). |
mail | Bugsoft Portal can send e-mail | See Set up e-mail. |
signin | A sign-in system is set up and switched on | See Sign-in and sign-in systems. |
saml_dom | No SAML connection is on, or the PHP extension dom (php-xml) is loaded | Install php-xml (sudo ./install.sh --saml) and restart PHP-FPM; see Sign in with SAML. Without a SAML connection you do not need the extension. |
breakglass | There is an emergency account with TOTP | sudo bugsoft breakglass:create; see The emergency account. |
breakglass_totp | BREAKGLASS_SKIP_TOTP is off | Switch it off as soon as the authenticator app is linked. |
license | The licence is valid | Advice during the last days of the trial and during the grace period; a fail while the portal is locked. See The licence. |
license_check | The online licence check got an answer, or it is off, or this is an offline licence | Advice when there is no answer yet or the last attempt failed: check that cron runs and that the firewall allows the licence server (Outbound connections), then choose Check now on the Licence page. A fail when the package has a check address that is not https, or no key to verify the answers: install an official package from Bugsoft. |
license_vendor_key | The package has the public key of the vendor | Install an official package from Bugsoft. |
version_age | The version is an official package with a release date | Check whether there is a newer version (What's new). Support covers the latest version and the one before it. |
security_update | The last licence check names no security update for this version | Advice, never a fail. Install the new version soon: the download and the command are on the Licence page (Update Bugsoft Portal). |
audit_retention | The audit log has a retention period | Choose one in Settings. |
Scheduled tasks (cron)
Bugsoft Portal does a few things by itself every minute: send reminders and e-mail, summarise the statistics, clean up
old data, anchor the audit log, make the SQLite backup, and send the e-mails about the licence and expiring secrets. For this,
cron:run must run every minute.
- With install.sh, the server arranges this itself with the timer
bugsoft-cron. During maintenance it skips a turn. Check it withjournalctl -u bugsoft-cron.service. - By hand: a crontab line for the website user, for example
* * * * * php /path/to/bugsoft/bin/console cron:run. - Without access to cron, for example at a hosting provider: set
CRON_TOKEN, and let a scheduler callPOST /cron/runevery minute with the headerX-Cron-Token.
In Admin › Settings › System › System status, under Scheduled tasks, you see when cron last ran. If
it did not run in the last 15 minutes, production:check gives advice, and the step stays open on
Start and the first steps.
/healthz for a load balancer
https://portal.klaverveld.example/healthz answers 200 with {"status":"ok"} when the
database answers, and 503 when it does not. Use this address for a load balancer or uptime monitor; it creates no
session. During an update, /healthz stays reachable.
Log files
- The installation and updates:
/var/log/bugsoft-install.log - Bugsoft Portal itself:
/var/lib/bugsoft/logs/ - The scheduled tasks:
journalctl -u bugsoft-cron.serviceandjournalctl -u bugsoft-backup.service
Stuck? See Questions and problems or contact Bugsoft at ugurs156@gmail.com.