Machine readable list of exchange packages

Hi!

I’m in the process of going through all our installed MKPs and finding them on the exchange to see if there is a new version. If there is a newer version on the exchange, I’d then copy the download link and paste them into this command:

read -p "enter mkp link: " URL; wget $URL; nv=$(mkp add $(basename $URL)) && mkp enable $nv

This combines downloading, adding and enabling of an MKP. While doing this, I thought:
Wouldn’t it be great if I could write a script that could periodically compare the version numbers of our installed MKPs with the versions that are on the exchange?

You probably already have some mechanism that triggers email notifications when a package is updated. Could you add generating a JSON file to that, which would list available plugins and their versions and download links? Or does something like this already exist?

You’re already doing this for Checkmk itself (stable_downloads.json, used by this check).

It would then be trivial to write a local check that could output something like “Warning: 5 of 17 installed MKPs have updates available” and a list of download links in the details.

I know subscribing to updates is a thing, but… you know, I like to monitor things :wink:

4 Likes

@baris.leenders I’m guessing if anyone has infos on this, it might be you :slight_smile:

1 Like

We currently do not have such an endpoint in place. However, this should not be too much work to implement. And if it adds value for you then I don’t see an issue with implementing it. I think we should have some time in the next few weeks to add the endpoint. Once it is there I will let you know in this thread.

1 Like

Before we start implementing. Does the following structure work for you?

{
    "date":"2025-10-14T11:08:16.536321Z",
    "data":[
        {
            "name":"ADSL Line",
            "package_name":"adsl_line",
            "url":"https:\/\/exchange.checkmk.com\/p\/adsl-line",
            "versions":[
                {"version":"1.4.0","updated_at":"2023-04-12T06:15:09.000000Z","link":"https:\/\/exchange.checkmk.com\/packages\/adsl-line\/1029\/adsl_line-1.4.0.mkp"},
                {"version":"1.3.1","updated_at":"2023-01-11T11:48:59.000000Z","link":"https:\/\/exchange.checkmk.com\/packages\/adsl-line\/991\/adsl_line-1.3.1.mkp"},
                {"version":"1.3.0","updated_at":"2023-01-11T11:48:56.000000Z","link":"https:\/\/exchange.checkmk.com\/packages\/adsl-line\/990\/adsl_line-1.3.0.mkp"},
                {"version":"0.7","updated_at":"2022-12-16T14:36:26.000000Z","link":"https:\/\/exchange.checkmk.com\/packages\/adsl-line\/3\/adsl_line-0.7.mkp"}
            ]
        },
        {
            "name":"APC Status via apcaccess",
            "package_name":"apcaccess",
            "url":"https:\/\/exchange.checkmk.com\/p\/apcaccess",
            "versions":[
                {"version":"5.3.1","updated_at":"2024-08-06T07:50:25.000000Z","link":"https:\/\/exchange.checkmk.com\/packages\/apcaccess\/1503\/apcaccess-5.3.1.mkp"},
                {"version":"5.3.0","updated_at":"2024-06-10T13:34:19.000000Z","link":"https:\/\/exchange.checkmk.com\/packages\/apcaccess\/1449\/apcaccess-5.3.0.mkp"},
                {"version":"5.2.2","updated_at":"2023-08-21T12:26:41.000000Z","link":"https:\/\/exchange.checkmk.com\/packages\/apcaccess\/1206\/apcaccess-5.2.2.mkp"},
                {"version":"5.2.1","updated_at":"2023-06-12T13:03:47.000000Z","link":"https:\/\/exchange.checkmk.com\/packages\/apcaccess\/1105\/apcaccess-5.2.1.mkp"},
                {"version":"5.2.0","updated_at":"2023-04-24T09:03:01.000000Z","link":"https:\/\/exchange.checkmk.com\/packages\/apcaccess\/1037\/apcaccess-5.2.0.mkp"},
                {"version":"5.0","updated_at":"2022-12-16T14:36:33.000000Z","link":"https:\/\/exchange.checkmk.com\/packages\/apcaccess\/914\/apcaccess-5.0.mkp"},
                {"version":"4.5","updated_at":"2022-12-16T14:36:32.000000Z","link":"https:\/\/exchange.checkmk.com\/packages\/apcaccess\/850\/apcaccess-4.5.mkp"},
                {"version":"4.3","updated_at":"2022-12-16T14:36:31.000000Z","link":"https:\/\/exchange.checkmk.com\/packages\/apcaccess\/574\/apcaccess-4.3.mkp"},
                {"version":"3.1","updated_at":"2022-12-16T14:36:30.000000Z","link":"https:\/\/exchange.checkmk.com\/packages\/apcaccess\/338\/apcaccess-3.1.mkp"},
                {"version":"2.4","updated_at":"2022-12-16T14:36:26.000000Z","link":"https:\/\/exchange.checkmk.com\/packages\/apcaccess\/12\/apcaccess-2.4.mkp"}
            ]
        }
        ...
    ]
}

I would say min + max version should be included, so the script has a chance not to download/update if an mkp requires a newer checkmk version?

1 Like

Makes sense. Before we push it to production (some time in the next week) I will post the final version of the structure.

4 Likes

This looks good, yes. mkp list gives the package_name and a version string, which I can compare to the most recent version of the matching package_name from the JSON.

I also agree with Gerd that it would be a nice bonus if the check could determine whether or not an update is usable by including the min/max version information, if that is something you have available as metadata.

The exchange currently only shows the minimum version, but upgrading to 2.4 showed that many MKPs used by me also had a maximum of 2.4.0b1 set, so this field would be a nice addition to the exchange website as well.

Thanks a lot for taking care of this Baris! Much appreciated.

I would love to have this Exchange Endpoint too. Having over 70 MKPs there, it’s currently a Pain to check if all of them are Up-to-Date with the ones in our repo.

Important for me would be that I can filter by Account/ Author to get all of my MKPs at one.

1 Like