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 = "linuxfabrik"
permissions = [ "objects/query/service" ]
}
Data Collection:
- Fetches and parses the RSS or Atom feed from the configured URL using the built-in
feedparserlibrary - By default, selects the newest feed item published today or older. Use
--latestto always pick the newest item, even if its timestamp is in the future - HTML 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_feed |
| Check Interval Recommendation | Every hour |
| Can be called without parameters | Yes |
| Runs on | Cross-platform |
| Compiled for Windows | No (runs with Python interpreter) |
| 3rd Party Python modules | beautifulsoup4 with Python module lxml |
| Uses State File | $TEMP/linuxfabrik-monitoring-plugins-feed.db |
Help¶
usage: feed [-h] [-V] [--always-ok] [--icinga-callback]
[--icinga-password ICINGA_PASSWORD]
[--icinga-service-name ICINGA_SERVICE_NAME]
[--icinga-url ICINGA_URL] [--icinga-username ICINGA_USERNAME]
[--insecure] [--latest] [--no-proxy] [--no-summary]
[--proxy PROXY] [--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). With the callback
enabled, the alert is automatically cleared once the service running this
check is acknowledged on the monitoring server. 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-callback Ask the monitoring server whether the service running
this check is acknowledged. Where it is, what this run
reports is remembered as already handled, so it no
longer raises an alert on the following runs. Requires
`--icinga-url`, `--icinga-username`, `--icinga-
password` and `--icinga-service-name`.
--icinga-password ICINGA_PASSWORD
Monitoring server API password.
--icinga-service-name ICINGA_SERVICE_NAME
Unique name of the service running this check, as the
monitoring server knows it. Take it from the `__name`
service attribute. Example: `monitoring-server!my-
service-name`.
--icinga-url ICINGA_URL
Monitoring server API URL. Example:
`https://monitoring.example.com:5665`.
--icinga-username ICINGA_USERNAME
Monitoring server API username.
--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, not even one the environment
names. Overrides `--proxy`.
--no-summary Suppress the feed item summary in the output.
--proxy PROXY Proxy to reach the target through. The scheme defaults
to `http` when omitted. Overrides the proxy the
environment names (`http_proxy`, `https_proxy`,
`all_proxy`) together with the exceptions it lists in
`no_proxy`, and is itself overridden by `--no-proxy`.
Without either parameter the environment applies.
Credentials belong into the environment variable
rather than here, because a command-line argument is
visible to every user on the host. Example:
`--proxy=http://proxy.example.com:3128`.
--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
Documentation:
https://linuxfabrik.github.io/monitoring-plugins/check-plugins/feed/
Usage Examples¶
./feed
./feed --url=https://github.com/Linuxfabrik/monitoring-plugins/releases.atom --warning=1440
./feed --icinga-url=https://icinga-host:5665 --icinga-callback --icinga-username=linuxfabrik-check-api-user --icinga-password=linuxfabrik --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):
- Feed: https://www.heise.de/security/rss/alert-news-atom.xml
- Run every hour, during office hours only (8 to 18 o'clock, Mo to Fr)
- Warn for 4 hours (240 minutes)
- Usage:
./feed
Icinga 2 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 --warning=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.