check_woodpecker_upgrade/README.md

56 lines
2.6 KiB
Markdown
Raw Permalink Normal View History

2024-01-22 01:18:50 +01:00
# Monitoring plugin to check Woodpecker CI instance upgrade status
This Icinga/Nagios check plugin permit to check Woodpecker CI instance upgrade status by comparing the local woodpecker-server binary version against the latest stable release.
2024-02-01 11:15:12 +01:00
This script could also be used to easily upgrade your installation. It could automatically:
- Download latest release asset matching to your already installed woodpecker packages
- Install corresponding packages
- Restart corresponding active woodpecker services (agent & server). Note: systemd services name must match the woodpecker package name.
2024-01-22 01:18:50 +01:00
## Installation
```
apt install git python3-requests
git clone https://gitea.zionetrix.net/bn8/check_woodpecker_upgrade.git /usr/local/src/check_woodpecker_upgrade
mkdir -p /usr/local/lib/nagios/plugins
ln -s /usr/local/src/check_woodpecker_upgrade/check_woodpecker_upgrade /usr/local/lib/nagios/plugins/
2024-01-22 01:56:58 +01:00
echo "command[check_woodpecker_upgrade]=/usr/local/lib/nagios/plugins/check_woodpecker_upgrade" > /etc/nagios/nrpe.d/woodpecker.cfg
2024-01-22 01:18:50 +01:00
service nagios-nrpe-server reload
```
## Usage
```
2024-02-01 11:15:12 +01:00
usage: check_woodpecker_upgrade [-h] [-d] [-v] [-p PATH] [-U URL] [--pre-release]
[--draft] [-t TIMEOUT] [-u] [-f] [--arch ARCH]
2024-01-22 01:18:50 +01:00
options:
-h, --help show this help message and exit
-d, --debug
2024-02-01 11:15:12 +01:00
-v, --verbose
2024-01-22 01:18:50 +01:00
-p PATH, --path PATH Woodpecker CI bin path
-U URL, --url URL Woodpecker CI releases URL
2024-02-01 11:15:12 +01:00
--pre-release Allow pre-release (default: only stable release are
considered)
--draft Allow draft release (default: only stable release are
considered)
2024-01-22 01:18:50 +01:00
-t TIMEOUT, --timeout TIMEOUT
Specify timeout for HTTP requests (default: 20)
2024-02-01 11:15:12 +01:00
-u, --upgrade Upgrade Woodpecker CI
-f, --force Force upgrade Woodpecker CI
--arch ARCH System dpkg architecture (default: auto-detect)
2024-01-22 01:18:50 +01:00
```
## Copyright
Copyright (c) 2024 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.