=== compile make on centos 8.3 จะเจอ error นี้ครับ เกิดจาก lib ที่ใช้งานใน 2.1.1 เก่าเกินให้ทำการแก้ไขโดย download v.2.3.3 มา compile แทนนะครับ
===wget
http://nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gzmake[3]: Entering directory '/home/golf/nagios_nrpe/nagios-plugins-2.1.1/lib'
gcc -DHAVE_CONFIG_H -I. -I.. -DNP_STATE_DIR_PREFIX=\"/usr/local/nagios/var\" -I. -I../gl -I../intl -I../plugins -g -O2 -MT utils_base.o -MD -MP -MF .deps/utils_base.Tpo -c -o utils_base.o utils_base.c
In file included from ../plugins/common.h:117,
from utils_base.c:27:
../gl/getopt.h:198:8: error: redefinition of 'struct option'
struct option
^~~~~~
In file included from /usr/include/getopt.h:36,
from ../gl/getopt.h:32,
from ../plugins/common.h:117,
from utils_base.c:27:
/usr/include/bits/getopt_ext.h:50:8: note: originally defined here
struct option
^~~~~~
In file included from ../plugins/common.h:117,
from utils_base.c:27:
../gl/getopt.h:247:12: error: conflicting types for 'getopt_long'
extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
^~~~~~~~~~~
In file included from /usr/include/getopt.h:36,
from ../gl/getopt.h:32,
from ../plugins/common.h:117,
from utils_base.c:27:
/usr/include/bits/getopt_ext.h:66:12: note: previous declaration of 'getopt_long' was here
extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
^~~~~~~~~~~
In file included from ../plugins/common.h:117,
from utils_base.c:27:
../gl/getopt.h:251:12: error: conflicting types for 'getopt_long_only'
extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
^~~~~~~~~~~~~~~~
In file included from /usr/include/getopt.h:36,
from ../gl/getopt.h:32,
from ../plugins/common.h:117,
from utils_base.c:27:
/usr/include/bits/getopt_ext.h:70:12: note: previous declaration of 'getopt_long_only' was here
extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
^~~~~~~~~~~~~~~~
make[3]: *** [Makefile:1394: utils_base.o] Error 1
make[3]: Leaving directory '/home/golf/nagios_nrpe/nagios-plugins-2.1.1/lib'
make[2]: *** [Makefile:1427: all-recursive] Error 1
make[2]: Leaving directory '/home/golf/nagios_nrpe/nagios-plugins-2.1.1/lib'
make[1]: *** [Makefile:1418: all-recursive] Error 1
make[1]: Leaving directory '/home/golf/nagios_nrpe/nagios-plugins-2.1.1'
make: *** [Makefile:1341: all] Error 2
=== compile make on centos 8.3 จะเจอ error นี้ครับ เกิดจาก lib ที่ใช้งานใน 2.1.1 เก่าเกินให้ทำการแก้ไขโดย download v.2.3.3 มา compile แทนนะครับ
===wget
http://nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gztar zxf nagios-plugins-2.3.3.tar.gz
cd nagios-plugins-2.3.3
useradd nagios
passwd nagios
export LDFLAGS=-ldl
./configure --with-nagios-user=nagios --with-nagios-group=nagios --enable-redhat-pthread-workaround && make && make install
chown nagios.nagios /usr/local/nagios
chown -R nagios.nagios /usr/local/nagios/libexec/
==> ต้องติดตั้ง compat-openssl10 ด้วยนะครับ
yum install compat-openssl10
ln -s /usr/lib64/libnsl.so.2 /usr/lib64/libnsl.so.1
updatedb
แล้วทำการ restart nrpe ดูอีกรอบนะครับ