bashclub / checkmk-opnsense-agent

65 stars 14 forks source link

Major upgrades are not reported (e.g. from 23.7 to 24.1) #46

Open mapietru opened 4 months ago

mapietru commented 4 months ago

I had in mind that a major version change was not reported last time. This time (23.7 to 24.1) I did a compare of "/tmp/pkg_upgrade.json" from an opnsense still having 23.7 and a second one already upgraded, but having updates pending.

1 currently running 24.1.1 (fyi, I have shorten upgrade_packages)

{ "api_version":"2", "connection":"ok", "downgrade_packages":[], "download_size":"92MiB", "last_check":"Wed Feb 21 08:50:43 CET 2024", "needs_reboot":"1", "new_packages":[{"name":"suricata","repository":"OPNsense","version":"7.0.3"}], "os_version":"FreeBSD 13.2-RELEASE-p9", "product_id":"opnsense", "product_target":"opnsense", "product_version":"24.1.1", "product_abi":"24.1", "reinstall_packages":[], "remove_packages":[], "repository":"ok", "upgrade_major_message":"", "upgrade_major_version":"", "upgrade_needs_reboot":"0", "upgrade_packages":[{"name":"vnstat","repository":"OPNsense","current_version":"2.11_1","new_version":"2.12"},{"name":"base","size":"116651300","repository":"OPNsense","current_version":"24.1","new_version":"24.1.2"},{"name":"kernel","size":"32843704","repository":"OPNsense","current_version":"24.1","new_version":"24.1.2"}], "upgrade_sets":[] }

2 currently running 23.7.12

{ "api_version":"2", "connection":"ok", "downgrade_packages":[], "download_size":"", "last_check":"Wed Feb 21 08:53:24 CET 2024", "needs_reboot":"0", "new_packages":[], "os_version":"FreeBSD 13.2-RELEASE-p7", "product_id":"opnsense", "product_target":"opnsense", "product_version":"23.7.12_5", "product_abi":"23.7", "reinstall_packages":[], "remove_packages":[], "repository":"ok", "upgrade_major_message":"

OPNsense 23.7 \"Restless Roadrunner\" has reached its end of life. As such it will not receive any more updates, but the upgrade to the new 24.1 series is seamless and can be performed right here from the web GUI.

Another method is to import and reinstall using a new installation image, which will retain your settings using \"Import Configuration\", then reformat the disk and apply a clean system using either \"Install (UFS)\" or \"Install (ZFS)\".

You can also upgrade via console / SSH by using option 12 from the menu by typing \"24.1\" when prompted.

Make sure to read the migration notes and account for possible breaking changes.

Please backup your configuration, preview the new version via live image or in a virtual machine. Create snapshots. If all else fails, report back <a href=\"https://forum.opnsense.org/\" target=\"_blank\">in the forums for assistance.

", "upgrade_major_version":"24.1", "upgrade_needs_reboot":"1", "upgrade_packages":[], "upgrade_sets":[{"name":"packages","size":"737773056","current_version":"23.7","new_version":"24.1","repository":"OPNsense"},{"name":"kernel","size":"32845676","current_version":"23.7.10","new_version":"24.1","repository":"OPNsense"},{"name":"base","size":"116669220","current_version":"23.7.10","new_version":"24.1","repository":"OPNsense"}] }

The identifier "upgrade_major_version" is reporting the next major version. Is it possible to parse this information with the deamon?

As of now with v1.0.7 there is no information about an existing update if the next major version is already in place:

image

Br, Markus