Check EOL date with endoflife.date api

Script: check_eol_date_api

check_eol_date_api is a plugin for Icinga/ Nagios. It detects the end of life of an OS or a product.

Description of return values:

  • With found eol date:

    • “ok”, “warning” or “critical” based on the limits.
  • If no eol date was set

    • “ok” if your version is maintained
  • other cases:

    • “critical” if your version or product is not supported anymore (isEol for your version is true or discontinued is true)
    • “unknown” if given product key was not found in the api or a product was found but is not installed locally.

This check uses the script ./eol_check.sh that handles logic and requests endoflife.date api.

The limit check with warning and critical will be applied …

  • on “End of Security date”
  • if it does not exist - on “End of life date”
  • if it does not exist too - then the range check is skipped. It returns “OK” as long “isMaintained” is true - otherwise “critical”

Links:

Reqirements

  • curl
  • jq

Standalone installation

From this repository you need next to this script:

  • inc_pluginfunctions shared function for all IML checks written in bash
  • ./eol_check.sh check script

Syntax

./check_eol_date_api -h
______________________________________________________________________

CHECK_EOL_DATE_API
v0.3

(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3

https://os-docs.iml.unibe.ch/icinga-checks/Checks/check_eol_date_api.html
______________________________________________________________________

Check and of support of an OS or a product.
Eol data are fetched by endoflife.date api using shell script
https://git-repo.iml.unibe.ch/iml-open-source/eol-check


USAGE
  $ check_eol_date_api [-c CRITICAL] [-w WARNING] PRODUCT [VERSION]

PARAMETERS
  PRODUCT     set a product; known product keys can be listed with --list
  VERSION     optional: set a product version to check. Default: installed
              version will be detected

OPTIONS
  -h, --help  Show help
  -l, --list  List known product keys

  -c          set critical limit; default 90
  -w          set warning limit; default 365

EXAMPLES
  check_eol_date_api php
  check_eol_date_api -w 100 -c 30 php
  check_eol_date_api os

  With additional version number the version detection will be skiped.
  check_eol_date_api php 8.1.1

Parameters

  • PRODUCT - set a product
    • Known product keys can be listed with --list.
    • A special product is "os" that will detect your current linux distribution.
  • VERSION - optional: set a product version to check. Default: installed version will be detected. You can use it to test the behaviour with manually given versions. Or: if version detection fails write a wrapper that detects the version and call check_eol_date_api from it.

List known products

Use --list or -lto get a list of known products. For your version checks use the keyword in the 1st column.

./check_eol_date_api -l
akeneo-pim                            Akeneo PIM
alibaba-ack                           Alibaba ACK
alibaba-dragonwell                    Alibaba Dragonwell
almalinux                             AlmaLinux OS
alpine-linux                          Alpine Linux
...
yocto                                 Yocto Project
zabbix                                Zabbix
zentyal                               Zentyal
zerto                                 Zerto
zookeeper                             Apache ZooKeeper

With grepyou can search for one or multiple search terms

./check_eol_date_api -l | grep -Ei "(php|java|ruby|nodejs|python)"
cakephp                               CakePHP
grumphp                               GrumPHP
nodejs                                Node.js
php                                   PHP
phpbb                                 phpBB
phpmyadmin                            phpMyAdmin
python                                Python
rails                                 Ruby on Rails
ruby                                  Ruby

Options

-c set critical limit; default 90 -w set warning limit; default 365

Examples

Check an installed product

check_eol_date_api php Shows end of life for your php version

OK: PHP v8.4.11 ... 1230 days left
PHP v8.4.11: You are up to date.
   OK, your version is maintained.
   End of life date: 2028-12-31 (1230 days left)

----------------------------------------------------------------------

  PHP

Latest major            8.4
Latest version          8.4.11
Category                lang
Discontinued?           (not set)

Links                   https://endoflife.date/php
                        https://www.php.net/supported-versions.php

----------------------------------------------------------------------
Your version            8.4.11
is Maintained           true

End of life             2028-12-31
End of ext. security    (not set)

Limit Info: warn below 365 days; critical below 90 days
 |php=1230;365;90

Example: unknown product

check_eol_date_api tomcat as an example that is known but not installed on the machine.

UNKNOWN: Processing poduct 'tomcat' failed.
ERROR: Apache Tomcat is not installed. The command './bin/version.sh' failed. Try '--newest' or '--show' to show raw data without checking a local version.

Check current operating system

You can check current operating system with parameter "os".

./check_eol_date_api os

WARNING: Debian v12 ... 1046 days left
Debian v12: Update with new major version is available: '13.0'.
   OK, your version is maintained.
   End of security: 2028-06-30 (1046 days left)

----------------------------------------------------------------------

  Debian

Latest major            13
Latest version          13.0
Category                os
Discontinued?           (not set)

Links                   https://endoflife.date/debian
                        https://wiki.debian.org/DebianReleases

----------------------------------------------------------------------
Your version            12
is Maintained           true

End of life             2026-06-10
End of ext. security    2028-06-30



Limit Info: warn below 365 days; critical below 90 days