Check feed

Overview

Monitors an RSS or Atom feed for new entries and alerts when new items appear within a configurable time window (default: 3 days). If Icinga callback is enabled, the alert is automatically cleared once the corresponding service is acknowledged in Icinga. After the time window expires, the alert clears regardless of acknowledgement status.

Important Notes:

  • Set a reasonable check interval. Usually it is a waste of bandwidth to poll feeds more often than once per hour

  • To use the Icinga callback feature, create an Icinga API user:

object ApiUser "linuxfabrik-check-api-user" {
  password = "mysupersecretpassword"
  permissions = [ "objects/query/service" ]
}

Data Collection:

  • Fetches and parses the RSS or Atom feed from the configured URL using the built-in feedparser library

  • By default, selects the newest feed item published today or older. Use --latest to always pick the newest item, even if its timestamp is in the future

  • HTML is stripped from the feed message

  • If --icinga-callback is enabled, the check queries the Icinga API for the service acknowledgement state and auto-clears alerts when the service is acknowledged. This requires an Icinga API user with objects/query/service permissions

Fact Sheet

Fact

Value

Check Plugin Download

https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/feed

Nagios/Icinga Check Name

check_feed

Check Interval Recommendation

Every hour

Can be called without parameters

Yes

Runs on

Cross-platform

Compiled for Windows

No

3rd Party Python modules

BeautifulSoup4 (Version 4) with Python module lxml

Uses State File

$TEMP/linuxfabrik-monitoring-plugins-feed.db

Help

usage: feed [-h] [-V] [--always-ok]
            [--icinga-service-name ICINGA_SERVICE_NAME]
            [--icinga-password ICINGA_PASSWORD] [--icinga-url ICINGA_URL]
            [--icinga-username ICINGA_USERNAME] [--icinga-callback]
            [--insecure] [--latest] [--no-proxy] [--no-summary]
            [--timeout TIMEOUT] [--url FEED_URL] [-w WARN]

Monitors an RSS or Atom feed for new entries and alerts when new items appear
within a configurable time window (default: 3 days). If Icinga callback is
enabled, the alert is automatically cleared once the corresponding service is
acknowledged in Icinga. After the time window expires, the alert clears
regardless of acknowledgement status.

options:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  --always-ok           Always returns OK.
  --icinga-service-name ICINGA_SERVICE_NAME
                        Unique name of the service using this check within
                        Icinga, taken from the `__name` service attribute.
                        Example: `icinga-server!my-service-name`.
  --icinga-password ICINGA_PASSWORD
                        Password for the Icinga API.
  --icinga-url ICINGA_URL
                        Icinga API URL. Example: `https://icinga-server:5665`.
  --icinga-username ICINGA_USERNAME
                        Username for the Icinga API.
  --icinga-callback     Query Icinga for the service acknowledgement state and
                        auto-clear alerts on ack. Default: False
  --insecure            This option explicitly allows insecure SSL
                        connections.
  --latest              Return the newest feed item, even if its timestamp is
                        in the future.
  --no-proxy            Do not use a proxy.
  --no-summary          Suppress the feed item summary in the output. Default:
                        False
  --timeout TIMEOUT     Network timeout in seconds. Default: 5
  --url FEED_URL        RSS or Atom feed URL. Default:
                        https://www.heise.de/security/rss/alert-news-atom.xml
  -w, --warning WARN    Time window in minutes during which new feed entries
                        trigger a warning. Default: 4320

Usage Examples

./feed
./feed --url https://github.com/Linuxfabrik/monitoring-plugins/releases.atom --warn 1440
./feed --icinga-url https://icinga-host:5665 --icinga-callback --icinga-username linuxfabrik-check-api-user --icinga-password mysupersecretpassword --icinga-service-name 'icinga-host!Feed Service Name' --url https://www.heise.de/security/rss/alert-news-atom.xml

Output:

This is an important news item from a RSS feed. (2h 15m ago)

Feed examples:

Heise Security Feed (German):

Icinga2 Releases Feed on GitHub:

  • Feed: https://github.com/Icinga/icinga2/releases.atom

  • Run once or twice a day

  • Warn for 24 hours (1440 minutes)

  • No summary, just the title (the new version string)

  • Usage: ./feed --url https://github.com/Icinga/icinga2/releases.atom --no-summary --warn 1440

States

  • OK if the feed has no entries or the newest entry is older than --warning (default: 4320 minutes / 3 days).

  • OK if --icinga-callback is enabled and the corresponding Icinga service has been acknowledged.

  • WARN if a feed item is newer than --warning (default: 4320 minutes / 3 days) and has not been acknowledged.

  • --always-ok suppresses all alerts and always returns OK.

Perfdata / Metrics

There is no perfdata.

Troubleshooting

Python module "BeautifulSoup4" is not installed.

sudo -u icinga python3 -m pip install --user BeautifulSoup4

Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?

sudo -u icinga python3 -m pip install --user lxml

--icinga-callback requires --icinga-url, --icinga-password, --icinga-username and --icinga-service-name
When using --icinga-callback, all four Icinga connection parameters must be specified.

Credits, License