check_debian_package_update

check_debian_package_update

Monitoring plugin to check Debian package update using source.debian.org API.

This script could be used as Icinga/Nagios check plugin.

Requirements

  • Python (>3.7)
  • requests (python module, python3-requests Debian package)
  • natsort (python module, python3-natsort Debian package)

Installation

apt install git python3-requests python3-natsort
git clone https://gitlab.easter-eggs.com/brenard/check_debian_package_update.git /usr/local/src/check_debian_package_update
mkdir -p /usr/local/lib/nagios/plugins
ln -s /usr/local/src/check_debian_package_update/check_debian_package_update /usr/local/lib/nagios/plugins/

Usage

usage: check_debian_package_update [-h] [-d] [-v] [-w] [-l LOGFILE] [-C]
                                   [-p PACKAGE] [-s SUITE] [-t TIMEOUT]
                                   [-D REF_FILE_DIR_PATH] [-F REF_FILE_NAME_FORMAT]
                                   [-i]

Monitoring plugin to check Debian package update using source.debian.org API.

options:
  -h, --help            show this help message and exit
  -d, --debug           Show debug messages
  -v, --verbose         Show verbose messages
  -w, --warning         Show warning messages
  -l LOGFILE, --logfile LOGFILE
                        Log file path
  -C, --console         Also log on console (even if log file is provided)
  -p PACKAGE, --package PACKAGE
                        Source package name
  -s SUITE, --suite SUITE
                        Debian suite/version (eg: Bookworm)
  -t TIMEOUT, --timeout TIMEOUT
                        API request timeout in seconds (default: 5)
  -D REF_FILE_DIR_PATH, --ref-file-dir-path REF_FILE_DIR_PATH
                        Path of the directory use to store package version
                        reference (default: /var/lib/nagios/)
  -F REF_FILE_NAME_FORMAT, --ref-file-name-format REF_FILE_NAME_FORMAT
                        Format of the name of the file use to store package version
                        reference (default:
                        check_debian_package_update.{package}.{suite}.state)
  -i, --init            Store current version of the package in the reference file

Copyright

Copyright (c) 2020-2024 Easter-eggs

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.