[Nagiosplug-help] compile error on linux 2.4 kernel

Nigel Prentice nigelpr at paradise.net.nz
Mon Nov 24 10:11:27 CET 2008


Hi,
I also encountered this problem on an older server at my work - RedHat 7.1 (this OS was RIP circa 2002).
It can be circumvented by commenting out the "argv=np_extra_opts(...)" line. This function allows the inclusion of additional command line options from an external config file. But we will have to live without it.
I can't find the root of the problem, but it seems to involve the included kernel headers. I have studied the cpp pre-processor output but can't see the fault :-(  I'm just not experienced enough.

[nigelp at zulu-wks4 plugins]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-81)

[nigelp at zulu-wks4 plugins]$ fgrep np_extra_opts check_ide_smart.c
        /* argv=np_extra_opts(&argc, argv, progname); */

[nigelp at zulu-wks4 plugins]$ make
if gcc -DLOCALEDIR=\"/usr/local/nagios/share/locale\" -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../lib -I../gl -I../intl -I/usr/include/ldap  -I/usr/include  -I/usr/kerberos/include  -g -O2 -MT check_ide_smart.o -MD -MP -MF ".deps/check_ide_smart.Tpo" -c -o check_ide_smart.o check_ide_smart.c; \
then mv -f ".deps/check_ide_smart.Tpo" ".deps/check_ide_smart.Po"; else rm -f ".deps/check_ide_smart.Tpo"; exit 1; fi
/bin/sh ../libtool --tag=CC --mode=link gcc  -g -O2  -L. -o check_ide_smart  check_ide_smart.o utils.o ../lib/libnagiosplug.a ../gl/libgnu.a -ldl
gcc -g -O2 -o check_ide_smart check_ide_smart.o utils.o  -L/home/nigelp/nagios-plugins-1.4.13/plugins ../lib/libnagiosplug.a ../gl/libgnu.a -ldl

[nigelp at zulu-wks4 plugins]$ ./check_ide_smart -d /dev/hda
CRITICAL - Couldn't open device /dev/hda: Permission denied

[nigelp at zulu-wks4 plugins]$ su
Password:
[root at zulu-wks4 plugins]# ./check_ide_smart -d /dev/hda
Id=  1, Status=15 {PreFailure , OnLine }, Value=118, Threshold=  6, Passed
Id=  3, Status= 3 {PreFailure , OnLine }, Value= 98, Threshold=  0, Passed
Id=  4, Status=50 {Advisory    , OnLine }, Value=100, Threshold= 20, Passed
Id=  5, Status=51 {PreFailure , OnLine }, Value=100, Threshold= 36, Passed
Id=  7, Status=15 {PreFailure , OnLine }, Value=100, Threshold= 30, Passed
Id=  9, Status=50 {Advisory    , OnLine }, Value=100, Threshold=  0, Passed
Id= 10, Status=19 {PreFailure , OnLine }, Value=100, Threshold= 97, Passed
Id= 12, Status=50 {Advisory    , OnLine }, Value=100, Threshold= 20, Passed
Id=187, Status=50 {Advisory    , OnLine }, Value=100, Threshold=  0, Passed
Id=189, Status=58 {Advisory    , OnLine }, Value=100, Threshold=  0, Passed
Id=190, Status=34 {Advisory    , OnLine }, Value= 65, Threshold= 45, Passed
Id=194, Status=34 {Advisory    , OnLine }, Value= 35, Threshold=  0, Passed
Id=195, Status=26 {Advisory    , OnLine }, Value= 80, Threshold=  0, Passed
Id=197, Status=18 {Advisory    , OnLine }, Value=100, Threshold=  0, Passed
Id=198, Status=16 {Advisory    , OffLine}, Value=100, Threshold=  0, Passed
Id=199, Status=62 {Advisory    , OnLine }, Value=200, Threshold=  0, Passed
Id=200, Status= 0 {Advisory    , OffLine}, Value=100, Threshold=  0, Passed
Id=202, Status=50 {Advisory    , OnLine }, Value=100, Threshold=  0, Passed
OffLineStatus=130 {Completed}, AutoOffLine=Yes, OffLineTimeout=7 minutes
OffLineCapability=91 {Immediate Auto SuspendOnCmd}
SmartRevision=10, CheckSum=171, SmartCapability=3 {SaveOnStandBy AutoSave}

[root at zulu-wks4 plugins]# ./check_ide_smart -d /dev/hda -n
OK - Operational (18/18 tests passed)
[root at zulu-wks4 plugins]#
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20081124/76a0150e/attachment.html>


More information about the Help mailing list