Hola, hice los siguientes cambios en el script, probando en RH 4EL:<br><br>#!/usr/bin/perl<br>use SNMP::Util;<br>use strict;<br>use warnings;<br># Variables<br>$PORT="162";<br>$HOST1="<a href="http://172.19.4.50">
172.19.4.50</a>";<br>$HOST2="<a href="http://192.168.228.10">192.168.228.10</a>";<br>$COM_NAME="netadmro";<br>$E_OID=".1.3.6.1.4.1.4227";<br>$OID=".1.3.6.1.4.1.4227";<br>$GEN_TRAP_NUMBER="6";
<br>$SPEC_TRAP_NUMBER="200";<br>$TYPE="string";<br>$VALUE="hello";<br><br>printf ("Hello World from Perl xD\n");<br><br>snmptrap("$COM_NAME\@$HOST1:$PORT",$E_OID,$HOST2,$GEN_TRAP_NUMBER,$SPEC_TRAP_NUMBER,$OID,$TYPE,$VALUE);
<br><br>Y la salida del comando es la siguiente:<br><br><br>[testing@cc]$ perl <a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> <br>Global symbol "$PORT" requires explicit package name at <a href="http://trap.0.1.remote.pl">
trap.0.1.remote.pl</a> line 6.<br>Global symbol "$HOST1" requires explicit package name at <a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 7.<br>Global symbol "$HOST2" requires explicit package name at
<a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 8.<br>Global symbol "$COM_NAME" requires explicit package name at <a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 9.<br>Global symbol "$E_OID" requires explicit package name at
<a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 10.<br>Global symbol "$OID" requires explicit package name at <a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 11.<br>Global symbol "$GEN_TRAP_NUMBER" requires explicit package name at
<a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 12.<br>Global symbol "$SPEC_TRAP_NUMBER" requires explicit package name at <a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 13.<br>Global symbol "$TYPE" requires explicit package name at
<a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 14.<br>Global symbol "$VALUE" requires explicit package name at <a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 15.<br>Global symbol "$COM_NAME" requires explicit package name at
<a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 19.<br>Global symbol "$HOST1" requires explicit package name at <a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 19.<br>Global symbol "$PORT" requires explicit package name at
<a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 19.<br>Global symbol "$E_OID" requires explicit package name at <a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 19.<br>Global symbol "$HOST2" requires explicit package name at
<a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 19.<br>Global symbol "$GEN_TRAP_NUMBER" requires explicit package name at <a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 19.<br>Global symbol "$SPEC_TRAP_NUMBER" requires explicit package name at
<a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 19.<br>Global symbol "$OID" requires explicit package name at <a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 19.<br>Global symbol "$TYPE" requires explicit package name at
<a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 19.<br>Global symbol "$VALUE" requires explicit package name at <a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> line 19.<br>Execution of
<a href="http://trap.0.1.remote.pl">trap.0.1.remote.pl</a> aborted due to compilation errors.<br><br>Si le saco los warnings y el strict, da lo siguiente:<br><br>Undefined subroutine &main::snmptrap called at <a href="http://trap.0.1.remote.pl">
trap.0.1.remote.pl</a> line 19.<br><br>Me da la impresion que esta pescando otro modulo, o no esta asociando bien el codigo al modulo deseado, y por eso alega (el codigo esta probado en debian).<br><br>Saludos.<br><br><br>
Luis Eduardo Vivero Peņa.<br>