Skip to main content

vwatcher

build badge codecov badge Code style: Ruff Python 3.11 Python 3.12 Python 3.13 Python 3.14

This is the modern Python re-implementation of the software version watcher (vwatcher), first implemented in Tcl/Scotty and Perl at Uninett in the 1990s.

Development of vwatcher which is a part of the Zino 2.0 project is fully sponsored by NORDUnet, on behalf of the nordic NRENs.

Table of contents

What is vwatcher?

vwatcher monitors the software versions and restarts of network devices, and reports on them daily and monthly. The daemon polls sysUpTime for each device, when the reported uptime falls meaningfully short of what it should have been given the previous poll, the device is presumed to have restarted. In that case, vwatcher asks it for sysDescr, and on Cisco gear whyReload, and writes what it finds to the event log. A software upgrade is assumed to require a reboot.

The daemon does not decide if a version changed, it only records what it sees. The reports replay the log against the version each device was running at the start of the day and draw relevant conclusions. This means that reports can be replayed over old logs.

vwatcher uses the following directories to store logs:

ver-watch/logs/today/ver-watch.log      today's events
ver-watch/logs/today/descs/<device>     the version as of the start of today
ver-watch/logs/today/uptime/<device>    the last sysUpTime seen
ver-watch/logs/YYYY-MM/DD/              the same three, rotated at the end of day
ver-watch/logs/YYYY-MM/DD/report        that day's report

descs is the baseline the reports diff against. The daemon writes a device's file only when it is missing or empty. When the day is 'rotated', meaning the logs are moved from the 'today' directory to the specific date folder with the day's report, a new baseline can be set.

Differences from the original version

  • The daily and monthly reports list devices in name order, was random in the original.
  • Monthly reports walk a month's days in date order instead of the original readdir-based order.
  • JunOS release types (R, S, F, X) are ordered as strings, the original ordering was broken.
  • Mail settings come from vwatcher.toml, not from ~/.zino-mail.
  • A device's SNMP version comes from snmpversion (default v2c), as in Zino 2. The original derived the version from hcounters, using SNMPv1 unless it was set.
  • vw-month-upgr baselines a month from its first rotated day, the old version needed a 01 directory.
  • vw-daily refuses to rotate into a day that was already rotated into before moving anything. The original would also fail, but only after overwriting that day's log.
  • vw-month-rst tracks new restarts per device. The original could list an old reboot as new if another device, one that reports no restart reason, had restarted earlier that day.
  • uptimes orders devices the same way as cur-vers. The original did it differently for Cisco IOS and JunOS.
  • A device added to polldevs.cf mid-month and upgraded the same day is reported in vw-month-upgr as upgraded from the first version logged for it. The original left the "from" version blank.
  • A device whose polldevs.cf entry changes keeps its uptime history, the original logged it as reloaded again.

Installing vwatcher

$ pip install .

Configuring vwatcher

polldevs.cf is the same file Zino reads, read with Zino's own parser, so one pollfile can serve both. vwatcher's own settings live in vwatcher.toml - see vwatcher.toml.example - and its [polling] and [snmp] sections are the ones from zino.toml. This replaces the legacy ~/.zino-mail and the %TOPDIR%/%CONFDIR% substitutions the Makefile used to perform.

Using vwatcher

Command What it does
vwatcher The daemon. Polls every device in polldevs.cf, re-reading the file when it changes.
vw-daily Rotates today's logs into YYYY-MM/DD, then reports on and mails that day. Run from cron shortly before midnight.
vw-day-report YYYY-MM DD Rebuilds an earlier day's report from its rotated logs: which devices were upgraded, and which restarted or crashed.
vw-month-upgr YYYY-MM Every upgrade of a month, one line per version step.
vw-month-rst YYYY-MM Every restart of a month for which the device reported a reason.
cur-vers The version every device is running now, ordered by version.
uptimes [-u] The same, with uptimes. -u orders by uptime instead.

All of them take --config-file (default vwatcher.toml) and --debug.

Developing vwatcher

Contributions are welcome, at this point especially bug reports (patches welcome), missing documentation, how to's and usage tips!

Linting and formatting

vwatcher uses ruff as its formatter and linter. It comes with the development tools:

$ pip install --group dev

or, you can install it directly with uv:

$ uv install ruff

A pre-commit hook will format new code automatically before committing. To enable this pre-commit hook, run

$ pre-commit install

Running tests

If you have installed tox, the following command will test vwatcher code against several Python versions and automatically compute code coverage.

$ tox

Coverage and test results land in reports/. Refer to the tox.ini file for further options.

Metadata

Release files for vwatcher 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for vwatcher 2.0.0
File Interpreter ABI Platform Actions
vwatcher-2.0.0-py3-none-any.whl Python 3 none any Details for vwatcher-2.0.0-py3-none-any.whl

Release files / vwatcher-2.0.0-py3-none-any.whl

Download URL vwatcher-2.0.0-py3-none-any.whl
Size 31.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10899c06bf4b3dbec360fb5175d2fb3253186b066f325cc989970b0c0e8e789d
BLAKE2b-256 checksum
How to use checksums
26f2e0b37a3bc0c138f45350b60983c94b6a230c531fb14a13a0c6060ffad32a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for vwatcher 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page