Bugzilla – Bug 1216148
server:monitoring/monitoring-plugins: check_load is broken ("Error opening")
Last modified: 2023-11-16 15:35:03 UTC
Created attachment 870104 [details] Packages updated on 2023-10-11 Until the updated that got applied on openSUSE MicroOS last night, `/usr/lib/nagios/plugins/check_load -r -w 15,10,05 -c 30,25,20` worked fine. But since that update: microos:/var/log/zypp # /usr/lib/nagios/plugins/check_load -r -w 15,10,05 -c 30,25,20 CRITICAL - You need more args!!! Error opening I am not sure where the problem is, I see `monitoring-plugins-load` got updated, but the last changelog entry is from 2022, so I'd assume this was the result of some kind of mass rebuild (as the update as big, see the attached log with all the packages that got installed/updated). Last change on the package happened 1 year ago, according to https://build.opensuse.org/package/show/openSUSE:Factory/monitoring-plugins Seems Fedora had a bug that caused the same output years ago: https://bugzilla.redhat.com/show_bug.cgi?id=1470823, but it seems it got fixed by bumping their package to a 2018 commit based on 2.2.1 (https://src.fedoraproject.org/rpms/nagios-plugins/c/97402353898e984baebc50ad4d3f0c304a266e4d?branch=main), so I'd say this is maybe not related. I reviewed apparmor changelogs, but could not see anything relevant either. Checking check_load's code, I'd say this is the line causing this: https://github.com/nagios-plugins/nagios-plugins/blob/master/plugins/check_load.c#L132 But the fact that CRITICAL error about args is showing confuses me. Checking https://github.com/nagios-plugins/nagios-plugins/blob/bade01b453b012af8c712034b8917c8c242b74cd/configure.ac#L1452, I see `PATH_TO_UPTIME` is... well, basically seems to be the path to the `uptime` binary, that I can find and it works: microos:/var/log/zypp # which uptime /usr/bin/uptime microos:/var/log/zypp # uptime 17:31:47 up 13:01, 2 users, load average: 0.04, 0.01, 0.00 And given I am executing check_load as root and uptime has rights 755... I don't think this is a problem with the permissions. Can't see anything on any logs. I am out of ideas, so happy to debug a bit more if someone can provide a hint :-)
Affects Tumbleweed as well.
(In reply to Julio González Gil from comment #0) > Checking > https://github.com/nagios-plugins/nagios-plugins/blob/ > bade01b453b012af8c712034b8917c8c242b74cd/configure.ac#L1452, I see > `PATH_TO_UPTIME` is... well, basically seems to be the path to the `uptime` > binary, that I can find and it works: You are testing on a running system, not in a build environment. Since the spec file has no build requires for uptime, uptime can be in the build environment by accident, but must not. Add a BuildRequires for uptime to the spec file and the problem should be fixed.
(In reply to Thorsten Kukuk from comment #2) > (In reply to Julio González Gil from comment #0) > > Checking > > https://github.com/nagios-plugins/nagios-plugins/blob/ > > bade01b453b012af8c712034b8917c8c242b74cd/configure.ac#L1452, I see > > `PATH_TO_UPTIME` is... well, basically seems to be the path to the `uptime` > > binary, that I can find and it works: > > You are testing on a running system, not in a build environment. > Since the spec file has no build requires for uptime, uptime can be in the > build environment by accident, but must not. > Add a BuildRequires for uptime to the spec file and the problem should be > fixed. Seems you are right, I see the fix already done at https://build.opensuse.org/package/rdiff/server:monitoring/monitoring-plugins?linkrev=base&rev=109 But I don't see a request at https://build.opensuse.org/project/requests/openSUSE:Factory. Is the submission to Factory pending... or am I looking at the wrong place for the queue?
the request was declined a few times, after some cleanup the current rq id is 1121260
S(In reply to Ruediger Oertel from comment #4) > the request was declined a few times, after some cleanup the current rq id > is 1121260 Seems https://build.opensuse.org/request/show/1121260 is declined as well, unfortunately. Seems because of a couple of patches being added to the package but not to the changelog (according to the bot)
well, I never did all those changes but am still trying to fix the changelog entries ... another try with rq 1121479
This is an autogenerated message for OBS integration: This bug (1216148) was mentioned in https://build.opensuse.org/request/show/1121479 Factory / monitoring-plugins
Thanks a lot of the last submission. The problem is now fixed... but after this update it seems "check_user" is broken (https://bugzilla.opensuse.org/show_bug.cgi?id=1216878). Could be just a coincidence, of course. In any case this bug can be closed as solved FMPOV (please reopen if you disagree)
actually ... I think this just breaks in different ways now it breaks as monitoring-plugins-load does not require "uptime" and then fails at runtime as it is not installed (and nothing else seems to requires coreutils-systemd). even more surprising is that it uses uptime at all, there is really nice code in the sources that uses /proc/loadavg if this is defined: ./plugins/check_load.c:# ifdef HAVE_PROC_LOADAVG ./plugins/check_load.c:# ifdef HAVE_PROC_LOADAVG ./plugins/check_load.c: fp = fopen (PROC_LOADAVG, "r"); ./plugins/check_load.c: printf (_("Error opening %s\n"), PROC_LOADAVG); ./plugins/check_load.c:# ifdef HAVE_PROC_LOADAVG ./plugins/check_load.c: printf (_("Error processing %s\n"), PROC_LOADAVG); but there seems no place in configure setting that.
(In reply to Ruediger Oertel from comment #9) > actually ... I think this just breaks in different ways > > now it breaks as monitoring-plugins-load does not require "uptime" and then > fails at runtime as it is not installed (and nothing else seems to requires > coreutils-systemd). > > even more surprising is that it uses uptime at all, there is really nice code > in the sources that uses /proc/loadavg if this is defined: > > ./plugins/check_load.c:# ifdef HAVE_PROC_LOADAVG > ./plugins/check_load.c:# ifdef HAVE_PROC_LOADAVG > ./plugins/check_load.c: fp = fopen (PROC_LOADAVG, "r"); > ./plugins/check_load.c: printf (_("Error opening %s\n"), > PROC_LOADAVG); > ./plugins/check_load.c:# ifdef HAVE_PROC_LOADAVG > ./plugins/check_load.c: printf (_("Error processing %s\n"), > PROC_LOADAVG); > > but there seems no place in configure setting that. So basically the fix works for me because `coreutils-systemd` is installed by default, right? > microos:~ # rpm -q --whatrequires coreutils-systemd > patterns-base-base-20200505-45.1.x86_64 > patterns-microos-base-5.0-81.1.x86_64 The fact that /proc/loadavg is not being used could be related to how configure is detecting it. Maybe it uses uptime by default if it exists, or maybe it doesn't detect /proc/loadavg in the build environment. But in any case, I guess that for now we should have an explicit `Requires: coreutils-systemd`?
This is an autogenerated message for OBS integration: This bug (1216148) was mentioned in https://build.opensuse.org/request/show/1126870 Factory / monitoring-plugins