Monitoring plugin to check Forgejo instance upgrade status
Find a file
Benjamin Renard 7902b42a5c
All checks were successful
Run tests / test-precommit (push) Successful in 50s
Upgrade pre-commit hooks
2025-11-16 18:43:52 +01:00
.forgejo/workflows CI: switch using nfpm to build Debian package 2025-11-16 18:43:52 +01:00
.chglog.yml CI: switch using nfpm to build Debian package 2025-11-16 18:43:52 +01:00
.gitignore Upgrade pre-commit hooks 2025-11-16 18:43:52 +01:00
.pre-commit-config.yaml Upgrade pre-commit hooks 2025-11-16 18:43:52 +01:00
.pylintrc Add check_forgejo_runner_upgrade 2025-11-16 18:32:04 +01:00
.yamllint.yml Upgrade pre-commit hooks 2025-11-16 18:43:52 +01:00
check_forgejo_runner_upgrade Add check_forgejo_runner_upgrade 2025-11-16 18:32:04 +01:00
check_forgejo_upgrade Add check_forgejo_runner_upgrade 2025-11-16 18:32:04 +01:00
nfpm.yaml CI: switch using nfpm to build Debian package 2025-11-16 18:43:52 +01:00
README.md Add check_forgejo_runner_upgrade 2025-11-16 18:32:04 +01:00

Monitoring plugins to check Forgejo & Forgejo runner instance upgrade status

These Icinga/Nagios check plugins permit to check Forgejo & Forgejo runner instance upgrade status by comparing the local binary version against the latest stable release.

Installation

apt install git python3-requests
git clone https://gitea.zionetrix.net/bn8/check_forgejo_upgrade.git /usr/local/src/check_forgejo_upgrade
mkdir -p /usr/local/lib/nagios/plugins
ln -s /usr/local/src/check_forgejo_upgrade/check_forgejo_upgrade /usr/local/lib/nagios/plugins/
ln -s /usr/local/src/check_forgejo_upgrade/check_forgejo_runner_upgrade /usr/local/lib/nagios/plugins/
cat << EOF > /etc/sudoers.d/nagios-forgejo
nagios ALL=NOPASSWD: /usr/local/lib/nagios/plugins/check_forgejo_upgrade
nagios ALL=NOPASSWD: /usr/local/lib/nagios/plugins/check_forgejo_runner_upgrade
EOF
chmod 0400 /etc/sudoers.d/nagios-forgejo
cat << EOF > /etc/nagios/nrpe.d/forgejo.cfg
command[check_forgejo_upgrade]=sudo /usr/local/lib/nagios/plugins/check_forgejo_upgrade
command[check_forgejo_runner_upgrade]=sudo /usr/local/lib/nagios/plugins/check_forgejo_runner_upgrade
EOF
service nagios-nrpe-server reload

Usage

usage: check_forgejo_upgrade [-h] [-d] [-p PATH] [-U URL] [--pre-release] [--draft] [-t TIMEOUT]

Icinga/Nagios plugin to check Forgejo instance upgrade status.

options:
  -h, --help            show this help message and exit
  -d, --debug
  -p PATH, --path PATH  Forgejo bin path
  -U URL, --url URL     Forgejo releases URL
  --pre-release         Allow pre-release (default: only stable release are considered)
  --draft               Allow draft release (default: only stable release are considered)
  -t TIMEOUT, --timeout TIMEOUT
                        Specify timeout for HTTP requests (default: 20)
usage: check_forgejo_runner_upgrade [-h] [-d] [-p PATH] [-U URL] [--pre-release] [--draft] [-t TIMEOUT]

Icinga/Nagios plugin to check Forgejo runner instance upgrade status.

options:
  -h, --help            show this help message and exit
  -d, --debug
  -p PATH, --path PATH  Forgejo runner bin path
  -U URL, --url URL     Forgejo runner releases URL
  --pre-release         Allow pre-release (default: only stable release are considered)
  --draft               Allow draft release (default: only stable release are considered)
  -t TIMEOUT, --timeout TIMEOUT
                        Specify timeout for HTTP requests (default: 20)

Copyright (c) 2023 Benjamin Renard brenard@zionetrix.net

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.