Mk_apt and latest idea from Ubuntu

Hi,

the latest marketing idea from the Ubuntu team is to announce their pro support in the output of apt:

<<<apt:sep(0):cached(1664105717,86400)>>>
Receive additional future security updates with Ubuntu Pro.
Learn more about Ubuntu Pro at https://ubuntu.com/pro

Isn’t it nice to know that futurue security updates for Ubuntu 20.04 are only available through a “Pro” subscription?
The funniest part? The URL https://ubuntu.com/pro throws a 404 HTTP error.

Unfortunately this makes the mk_apt agent plugin and its associated check plugin stop working as this output is not expected.

Maybe there could be a more robust parse function be implemented that is able to ignore everything except for the expected information, @LaMi?

5 Likes

To remove the marketing output comment out everything in the files /etc/apt/apt.conf.d/20apt-esm-hook.conf and /etc/apt/sources.list.d/ubuntu-esm-apps.list.

The package ubuntu-advantage-tools is a direct dependency for the packages update-manager-core and ubuntu-minimal and cannot be removed without these packages also being removed.

3 Likes

Thanks for the information about this issue. Very annoying!
We will have a look in the next sprint and hopefully can make our code more resilient to Ubuntu advertisements :slight_smile:

7 Likes

For some reason some of my systems have /etc/apt/sources.list.d/ubuntu-esm-apps.list and others don’t, either way I didn’t need to touch this one.

As for /etc/apt/apt.conf.d/20apt-esm-hook.conf, I renamed it instead to e.g. 20apt-esm-hook.disabled, which also solves the marketing message issue.

1 Like

I see this solution only as a temporary solve until a/the mk_apt can successfully filter this out.

Commenting apt conf and/or sources is from my point of view - as it is not under the control of CMK itself dangerous and can have unwanted side-effects on the monitored system.
Plus maybe in future updates this will be re-enabled, so the solution should be done in the plugin itself, not on the monitored system.

  • Glowsome
1 Like

I encountered the same issue, but found a different solution.
Since this headline is not really well picked for google searches, I only found this thread after creating a forum account and navigating to the right topic.

Anyways, here is what I did to solve it, and it seems to work so far and also dont feels that “risky” in terms of going too deep into the core system.

Just to let you know. We are working on ignoring this automatically. I’m trying that this makes it into the next patch release. No promises though.

3 Likes

The fix is included in the patch release from today. Please give it a go.

4 Likes

Great, thank you!
For those who wonder, you don’t even need to update the agent or the mk_apt binary on the clients, there are only minor changes:

12c12
< CMK_VERSION="2.1.0p14"
---
> CMK_VERSION="2.0.0p1"
31,32c31,33
< check_apt_update() {
<     if [ "$DO_UPDATE" = yes ]; then
---
>
> function check_apt_update {
>     if [ "$DO_UPDATE" = yes ] ; then
38c39
<         apt-get update -qq 2>/dev/null
---
>         apt-get update -qq 2> /dev/null
43c44,45
< if type apt-get >/dev/null; then
---
>
> if type apt-get > /dev/null ; then
51a54
>

The change to ignore the advertisement lines was only be done inside the check file.
On agent and plugin side nothing was changed.

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.