Mengatasi Error Saat Instalasi Nagios Plugin

Posted in Jaringan, Monday, August 12th, 2013, by Muhammad Fahmi Al Azhar

Berulang kali saya telah berhasil menginstall Nagios tanpa error. Malam ini saya coba menginstallnya kembali karena laptop saya terpaksa install ulang beberapa hari lalu.

Ternyata ketika menginstall plugin Nagios tersebut, saat melakukan perintah sudo make proses tersebut mengalami error.

Mengatasi Error Saat Instalasi Nagios Plugin

Apabila anda menginstall Nagios plugin dari source, kemungkinan anda akan mengalami error seperti yang saya alami.

Berikut ini adalah sekilas error tersebut:

make all-recursive
make[3]: Entering directory `/home/azuharu/nagios-plugins-1.4.16/gl'
make[4]: Entering directory `/home/azuharu/nagios-plugins-1.4.16/gl'
gcc -DHAVE_CONFIG_H -I. -I.. -I../intl -g -O2 -MT base64.o -MD -MP -MF .deps/base64.Tpo -c -o base64.o base64.c
mv -f .deps/base64.Tpo .deps/base64.Po
gcc -DHAVE_CONFIG_H -I. -I.. -I../intl -g -O2 -MT close-hook.o -MD -MP -MF .deps/close-hook.Tpo -c -o close-hook.o close-hook.c
mv -f .deps/close-hook.Tpo .deps/close-hook.Po
gcc -DHAVE_CONFIG_H -I. -I.. -I../intl -g -O2 -MT exitfail.o -MD -MP -MF .deps/exitfail.Tpo -c -o exitfail.o exitfail.c
mv -f .deps/exitfail.Tpo .deps/exitfail.Po
gcc -DHAVE_CONFIG_H -I. -I.. -I../intl -g -O2 -MT full-read.o -MD -MP -MF .deps/full-read.Tpo -c -o full-read.o full-read.c
mv -f .deps/full-read.Tpo .deps/full-read.Po
gcc -DHAVE_CONFIG_H -I. -I.. -I../intl -g -O2 -MT full-write.o -MD -MP -MF .deps/full-write.Tpo -c -o full-write.o full-write.c
mv -f .deps/full-write.Tpo .deps/full-write.Po
gcc -DHAVE_CONFIG_H -I. -I.. -I../intl -g -O2 -MT localcharset.o -MD -MP -MF .deps/localcharset.Tpo -c -o localcharset.o localcharset.c
In file included from localcharset.c:28:0:
./stdio.h:456:1: error: ‘gets’ undeclared here (not in a function)
make[4]: *** [localcharset.o] Error 1
make[4]: Leaving directory `/home/azuharu/nagios-plugins-1.4.16/gl'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/azuharu/nagios-plugins-1.4.16/gl'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/azuharu/nagios-plugins-1.4.16/gl'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/azuharu/nagios-plugins-1.4.16'
make: *** [all] Error 2

Untuk mengatasinya, seperti yang terdapat pada launchpad.net anda harus mengedit file stdio.h (sesuai pada pesan error di atas) yaitu pada line 456. Ubahlah gets menjadi fgets, karena gets telah deprecated.

Silahkan ulangi menconfigure dan mengkompile source nagios-plugin-1.4.16 tersebut. Insya Allah semua lancar!

referensi: https://bugs.launchpad.net/ubuntu/+source/nagios/+bug/117627

Semoga bermanfaat

Leave a Reply

Your email address will not be published. Required fields are marked *