centos 에 Net::SNMP perl 모듈 설치

주:perl 에서 쓴 nagios 플러그 인 을 사용 할 때 Net::SNMP 라 는 모듈 을 설치 해 야 합 니 다.인터넷 검색 을 통 해 설치 방법 을 찾 았 습 니 다.
perl 로 스 크 립 트 를 작성 할 때 use Net::SNMP 를 사용 할 때 도 있 습 니 다.이 모듈,그럼 centos 환경 에서 이 모듈 을 어떻게 설치 합 니까?
방법 은 두 가지 가 있 는데 다음 과 같다.
1) By CPAN (best)
on command line, as root : 
 
[your_host]# perl -MCPAN -e shell

    cpan shell -- CPAN exploration and modules installation (v1.76)    ReadLine support enabled
cpan> install Net::SNMP

    If it's the first time you run CPAN, it will probably ask you some (simple) questions.
    CPAN will also ask you to satisfy some dependencies (Crypt::DES, Digest::MD5, etc..).
 
2) "By hand"
    Get the folowings modules (tar.gz format) on  www.cpan.org
        - Crypt::DES        - Digest::MD5        - Digest::SHA1        - Digest::HMAC        - Net::SNMP    for each one (you must install Net::SNMP at the end) : 
tar zxf <module>.tar.gz
cd <module>
perl Makefile.pl
make test
make install

     위의 두 가지 방법 으로 볼 때 첫 번 째 방법 은 가장 좋 은 방법 으로 의존 가방 을 자동 으로 설치 하여 편리 하 게 하 는 것 이다.
    또한 cpan 을 사용 할 때 설정 이 필요 합 니 다.보통 돌아 가면 서 해결 합 니 다.
    그러나 일부 특수 한 상황 에 대해 서 는 프 록 시 서버 를 설정 하고 cpan mirror 를 설정 해 야 합 니 다.제 가 사용 하 는 것 은:http://cpan.mirror.vexxhost.com/입 니 다.이렇게 설정 하면 위의 명령 으로 perl 모듈 을 설치 할 수 있 습 니 다.
 
 

좋은 웹페이지 즐겨찾기