mvip has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

Im trying to install the SNMPTT following the tutorial on the SNMPTT page, but when i use the "snmptrapd -On" command i have the following error "Can't open perl script "/usr/share/snmp/snmp_perl_trapd.pl": No such file or directory" is there a way to get this snmp_perl_trapd.pl script ?

Replies are listed 'Best First'.
Re: SNMPTT error
by marto (Cardinal) on Dec 03, 2013 at 15:10 UTC
Re: SNMPTT error
by taint (Chaplain) on Dec 03, 2013 at 14:46 UTC

    Couple of things. Have you had a look to see if the script snmp_perl_trapd.pl exists in /usr/share/snmp/. If it does, does it have the x bit set (is it executable, and by the user, you are on that box?). Otherwise, you might try a which snmp_perl_trapd.pl, or a whereis snmp_perl_trapd.pl. If the x bit is set, and it was installed in any of the paths listed in your ENV. It's location should show up, in either of those searches.

    Best wishes.

    --Chris

    #!/usr/bin/perl -Tw
    use Perl::Always or die;
    my $perl_version = (5.12.5);
    print $perl_version;

      I followed the installation process of SNMPTT The second part as "Embedded handler", before that i installed all the requirements that is needed. And still nothing also here is some of the output of what iv done after the installations.

      [root@mpnagios snmptt_1.4]# snmptrapd -On Can't open perl script "/usr/share/snmp/snmp_perl_trapd.pl": No such f +ile or directory [root@mpnagios snmptt_1.4]# ls /usr/share/snmp/ mibs snmpconf-data [root@mpnagios snmptt_1.4]# locate snmp_perl_trapd.pl [root@mpnagios snmptt_1.4]# find / -name snmp_perl_trapd.pl [root@mpnagios snmptt_1.4]#

        How did you install Net-SNMP? snmp_perl_trapd.pl exists within their source tree should you need it.

      I add the path but still the same message. Is it the fact that the snmp_perl_trapd.pl missing is the key ? because i can't find this file any where in my system. Im using CentOS.

        Ignore the above. If

        ls -al /usr/share/snmp/snmp_perl_trapd.pl

        results in nothing then read what I wrote here, consider back tracking through the installation instructions. If this file does exist ensure it has the correct permissions. If in doubt report back or speak to your system administrator.

        Well. If either the path "/usr/share/snmp/ and, or the file snmp_perl_trapd.pl don't exist. You might take marto's advise, and see if waht your looking for, isn't part of a larger package. Like the one he mentioned. As you indicate you're using a flavor of Linux. Did you attempt to install it through your system's package manager? That route generally takes care of any dependencies automatically. Either way. At this point it appears that you've either chosen something that wasn't intended to be installed singularly, or you didn't choose the best route to get it installed (eg; via your system's package manager).

        Best wishes.

        --Chris

        #!/usr/bin/perl -Tw
        use Perl::Always or die;
        my $perl_version = (5.12.5);
        print $perl_version;

      Iv installed with yum ... "yum install net-snmp" " yum install net-snmp-utils net-snmp-devel"

        You're clicking the wrong "reply" link. Click the one to the right of the post you wish to respond to. Regards this problem I'm not sure what to tell you. Have you configured this properly after installation? See the INSTALL and README files (note some are OS specific). This is not a perl problem.

        Resurrecting dead post to provide the solution in case anyone else made it here:
        yum install net-snmp-perl

      Hi, im having difficulties to find this script. I can't locate and i try the way you say but nothing ....

      [root@mpnagios snmptt_1.4]# which snmp_perl_trapd.pl /usr/bin/which: no snmp_perl_trapd.pl in (/usr/lib64/qt-3.3/bin:/usr/l +ocal/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin) [root@mpnagios snmptt_1.4]# whereis snmp_perl_trapd.pl snmp_perl_trapd: [root@mpnagios snmptt_1.4]#

      Is there a way to download from or installed or something ....

        Well. You pretty much answered your own question;

        /usr/share/snmp/
        isn't in your PATH ENV. So You can either add it. Or you can remove the current copy, and choose
        make install PREFIX=/one/of/the/current/paths/in/your/$PATH
        You might try the first suggestion. After adding /usr/share/snmp/ to your current list of paths. You may need to issue a rehash. To slurp it into your working ENV.

        Best wishes

        --Chris

        #!/usr/bin/perl -Tw
        use Perl::Always or die;
        my $perl_version = (5.12.5);
        print $perl_version;