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
feedparserlibraryBy default, selects the newest feed item published today or older. Use
--latestto always pick the newest item, even if its timestamp is in the futureHTML is stripped from the feed message
If
--icinga-callbackis 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 withobjects/query/servicepermissions
Fact Sheet¶
Fact |
Value |
|---|---|
Check Plugin Download |
https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/feed |
Nagios/Icinga Check Name |
|
Check Interval Recommendation |
Every hour |
Can be called without parameters |
Yes |
Runs on |
Cross-platform |
Compiled for Windows |
No |
3rd Party Python modules |
|
Uses State File |
|
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):
Run every hour, during office hours only (8 to 18 o’clock, Mo to Fr)
Warn for 4 hours (240 minutes)
Usage:
./feed
Icinga2 Releases Feed on GitHub:
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-callbackis 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-oksuppresses 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¶
Authors: Linuxfabrik GmbH, Zurich
License: The Unlicense, see LICENSE file.