check_dnf_automatic
An Icinga plugin for monitoring the number of pending dnf-automatic security updates to be installed. Compatibility with Nagios has not been tested.
Requirements
- bash
- dnf-automatic
- tail
- sed
Quick Start
-
Install requirements.
-
Copy
script/check_dnf_automaticto your Icinga plugin directory. Make sure it has executable flag set. -
Add a new CheckCommand object to Icinga.
object CheckCommand "dnf_automatic" { command = [ PluginContribDir + "/check_dnf_automatic" ] arguments = { "--only-security" = { set_if = "$dnf_automatic_only_security$" } } } -
Define a new Icinga Service to use this CheckCommand.
Options
-
Do not issue a warning for non-security related updates. You must set
upgrade_type = securityin/etc/dnf/automatic.conffor dnf-automatic to check security updates separately.check_dnf_automatic --only-security -
Print help.
check_dnf_automatic --help
Performance Data
- available_updates: Number of pending updates
- security_updates: Number of pending security updates
Building RPM
Development version
Extract the package version from git. Set version in the spec file and the script. Create the source archive and build the RPM package.
_git_desc=$(git describe) && _version=${_git_desc//-/.} && echo "$_version"
sed -i 's/^Version:.*/Version:'" ${_version}"'/g' check_dnf_automatic.spec
sed -i 's/^_version=.*/_version='"${_version}"'/g' script/check_dnf_automatic
git archive --format=tar.gz -o "$(pwd)/check_dnf_automatic-${_version}.tar.gz" --prefix="check_dnf_automatic-${_version}/" HEAD
rpmbuild -bb check_dnf_automatic.spec --define "_topdir $(pwd)/rpmbuild" --define "_sourcedir $(pwd)"
Latest release
Fetch the latest release and build the RPM package.
spectool --get-files check_dnf_automatic.spec
rpmbuild -bb check_dnf_automatic.spec --define "_topdir $(pwd)/rpmbuild" --define "_sourcedir $(pwd)"
Releasing a new version
Releases are automatically created in CI from Git tags in the "major.minor" version format, such as 1.2 or 12.345. You must avoid using patch versions for tags (and releases), as they are reserved for versioning development builds. The tag must be signed and be verifiable with git verify-tag command in CI. You can create signed tags with git tag -s -m "1.2" 1.2.
- Update version and changelog in
check_dnf_automatic.spec. - Update version in
script/check_dnf_automatic. - Commit the changes.
- Tag new commit.
License and Attribution
Copyright 2024-2025 M. Farzalipour Tabriz, Max Planck Institute for Physics (MPP)
All rights reserved.
This software may be modified and distributed under the terms of the GNU General Public v3 License. See the LICENSE file for details.