Bug in Nagios Plugins 2.3.X

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

Bug in Nagios Plugins 2.3.X

Postby eponymousalias » Thu May 28, 2020 8:10 pm

The Nagios Plugins 2.3.0 release added this stanza to the configure.ac
file, which is still present at this location in the file in the Nagios
Plugins 2.3.3 release:

Code: Select all
789 dnl jails on FreeBSD:
790 elif ps -axwo 'stat comm vsz rss user uid pid ppid jid args' 2>/dev/null | \
791         egrep -i "^ *STAT +COMMAND +VSZ +RSS +USER +UID +PID +PPID +JID +COMMAND" > /dev/null
792 then
793         ac_cv_ps_varlist="procstat,&procuid,&procpid,&procppid,&procjid,&procvsz,&procrss,&procpcpu,procprog,&pos"
794         ac_cv_ps_command="$PATH_TO_PS -axwo 'stat uid pid ppid jid vsz rss pcpu comm args'"
795         ac_cv_ps_format="%s %d %d %d %d %d %d %f %s %n"
796         ac_cv_ps_cols=10
797         AC_MSG_RESULT([$ac_cv_ps_command])

There are two problems with this.

(1) That stanza is placed within the configure.ac processing earlier than
other sibling tests which ought to be the executed first. That's because,
for instance, some versions of "ps" on Linux will accept a "jid" option,
and that can cause this test to succeed, but they only produce a "-"
value in the "JID" column of the output. That string will fail the %d
conversion that is specified as the format string for &procjid in this
stanza, stopping all scan conversion at that point and creating a very
misleading impression of what the later values are. The net effect is,
this stanza needs to be moved in the configure.ac file to some position
which is later than its present position, to allow other forms of the
ps command to be recognized first.

(2) Even when that stanza is moved, the build will fail if that test
is found to be true. That's because the cmpstringp() routine in the
check_load.c program fails to include a "int procjid = 0;" declaration,
as is present in both of the check_procs.c and check_nagios.c programs.

(I'm not going to report this on github; you can handle that yourself.)
Posts: 15
Joined: Mon Mar 07, 2016 5:38 am

Re: Bug in Nagios Plugins 2.3.X

Postby cdienger » Tue Jun 02, 2020 4:41 pm

As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
Support Tech
Posts: 4395
Joined: Tue Feb 07, 2017 11:26 am

Return to Community Support

Who is online

Users browsing this forum: Google [Bot], is_kim and 16 guests