【问题标题】:How do I install Net::Arping on CentOS 5?如何在 CentOS 5 上安装 Net::Arping?
【发布时间】:2011-10-23 11:03:03
【问题描述】:

我曾尝试使用 cpan 安装 Net::Arping 包,但由于错误无法安装...

CPAN.pm: Going to build R/RI/RIIKI/Net-Arping-0.02.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for Net::Arping
cp Arping.pm blib/lib/Net/Arping.pm
/usr/bin/perl /usr/lib/perl5/5.8.8/ExtUtils/xsubpp  -typemap             /usr/lib/perl5/5.8.8/ExtUtils/typemap  Arping.xs > Arping.xsc && mv Arping.xsc Arping.c
Please specify prototyping behavior for Arping.xs (see perlxs manual)
gcc -c   -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-    statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -    I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-    protector --param=ssp-buffer-size=4 -m64 -mtune=generic   -DVERSION=\"0.02\" -    DXS_VERSION=\"0.02\" -fPIC "-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE"  -    D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H Arping.c
Arping.xs: In function ‘XS_Net__Arping_send_arp’:
Arping.xs:116: warning: implicit declaration of function ‘libnet_name_resolve’
Arping.xs:124: warning: passing argument 1 of ‘libnet_select_device’ from incompatible     pointer type
Arping.xs:124: error: too many arguments to function ‘libnet_select_device’
Arping.xs:130: warning: implicit declaration of function ‘libnet_open_link_interface’
Arping.xs:130: warning: assignment makes pointer from integer without a cast
Arping.xs:135: warning: implicit declaration of function ‘libnet_get_ipaddr’
Arping.xs:140: error: ‘LIBNET_IP_H’ undeclared (first use in this function)
Arping.xs:140: error: (Each undeclared identifier is reported only once
Arping.xs:140: error: for each function it appears in.)
Arping.xs:143: warning: implicit declaration of function ‘libnet_init_packet’
Arping.xs:148: warning: passing argument 1 of ‘libnet_get_hwaddr’ from incompatible pointer type
Arping.xs:148: error: too many arguments to function ‘libnet_get_hwaddr’
Arping.xs:148: warning: assignment from incompatible pointer type
Arping.xs:156: warning: passing argument 6 of ‘libnet_build_ethernet’ from incompatible pointer type
Arping.xs:156: error: too few arguments to function ‘libnet_build_ethernet’
Arping.xs:161: warning: passing argument 12 of ‘libnet_build_arp’ from incompatible pointer type
Arping.xs:161: error: too few arguments to function ‘libnet_build_arp’
Arping.xs:166: warning: pointer targets in passing argument 1 of ‘pcap_open_live’ differ in signedness
Arping.xs:185: warning: implicit declaration of function ‘libnet_write_link_layer’
Arping.xs:196: warning: implicit declaration of function ‘libnet_close_link_interface’
Arping.xs:197: warning: implicit declaration of function ‘libnet_destroy_packet’
make: *** [Arping.o] Error 1
  /usr/bin/make  -- NOT OK
Running make test
  Can't test without successful make
Running make install
  make had returned bad status, install seems impossible

我需要这个 perl 模块用于 Nagios 的 check_arping 脚本。

一些附加信息:

[root@atlantis build]# uname -a
Linux atlantis 2.6.18-238.9.1.el5xen #1 SMP Tue Apr 12 18:53:56 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
[root@atlantis build]# rpm -qa | grep libnet
libnet-1.1.2.1-2.rf
[root@atlantis build]# rpm -qa | grep libpcap
libpcap-devel-0.9.4-15.el5
libpcap-0.9.4-15.el5
libpcap-0.9.4-15.el5
libpcap-devel-0.9.4-15.el5
[root@atlantis build]#

如您所见,我已经安装了 libnet、libpcap,但仍然存在问题......有人知道如何解决这个问题吗?

【问题讨论】:

    标签: linux perl centos nagios


    【解决方案1】:

    您已安装 libpcap-devel,但未安装 libnet-devel。 RPM 的 *-devel 版本包含构建基于 XS 的模块时经常需要的 C 头文件。

    在尝试再次构建模块之前尝试sudo yum install libnet-devel

    更新:上面的建议是正确的,但还不够。我刚刚在安装 Centos 5.6 时对此进行了测试,但失败并出现完全相同的错误。

    查看CPAN testers results,很明显Net::Arping 0.02 版已经很长时间没有为任何人成功构建了。此发行版于 2002 年上传到 CPAN,它的 XS 代码似乎与现代版本的 libnet 不兼容。

    但是,在 CPAN 上有一个 version 0.03 of Net::Arping。这在我的 Centos 5.6 上成功构建。我建议你改用它。我还没有弄清楚为什么cpan 不能识别 0.03 版。我看到它是由不同的作者撰写的,因此可能是权限问题。您应该考虑将此问题报告给 modules@cpan.org。

    【讨论】:

    • No package libnet-devel available. 我正在寻找它,但我没有...它不在 CentOS 5 的 RPMFORGE 中
    • 它在 EPEL 存储库中。与 libnet 在同一个地方,所以看起来你已经配置了那个 repo。你有/etc/yum.repos.d/epel.repo 的文件吗?
    • 我已经检查了 EPEL 存储库,我已经安装了 libnet 和 libnet-devel 以及 libnet10 和 libnet10-devel 但仍然 cpan/manuall 编译不起作用。
    • 在你更新后我已经手动检查了它:cpan> install R/RA/RADEK/Net-Arping-0.03.tar.gz 并且它开始正常工作。谢谢很多达沃格
    猜你喜欢
    • 2016-05-03
    • 2011-10-26
    • 2014-04-12
    • 1970-01-01
    • 1970-01-01
    • 2017-03-26
    • 2015-10-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多