Thank you for the advices, I am new to the area of programming so maybe I did not explain my problem. When I am executing my code it prints on the terminal:

Problem with session get request: The OBJECT IDENTIFIER value "ARRAY(0 +x942c50)" is expected in dotted decimal notation.

While I was trying to debug my code, I put a print Dumper(\$session); so I could actually see in further analysis what is happenning. When I did that I saw on the terminal:

$VAR1 = \bless( { '_translate' => 0, '_security' => bless( { '_error' => undef, '_community' => 'public', '_version' => 0 }, 'Net::SNMP::Security::Comm +unity' ), '_transport_argv' => [ '-retries', '2', '-hostname', '127.0.0.1', '-port', '161', '-maxmsgsize', '1472', '-domain', 'udp/ipv4', '-timeout', '3' ], '_pdu' => undef, '_callback' => undef, '_nonblocking' => 0, '_version' => 0, '_transport' => bless( { '_dest_name' => '� +', '_max_msg_size' => 1472, '_sock_name' => '', '_timeout' => 3, '_error' => undef, '_sock_hostname' => '', '_dest_hostname' => '127.0 +.0.1', '_socket' => bless( \*Symb +ol::GEN0, 'IO::Socket' ), '_retries' => 2 }, 'Net::SNMP::Transport::IP +v4::UDP' ), '_error' => undef, '_context_engine_id' => undef, '_context_name' => undef, '_delay' => 0, '_discovery_queue' => [], '_hostname' => '127.0.0.1' }, 'Net::SNMP' );

At this point I saw the funny characters. Based on experimentation I found the error. I did not know include the request:

push (@request, ($sysDescr,$sysUpTime)); $output = $session->get_request( -varbindlist => [\@request] , );

When I removed the "\" it works just fine. I can not exaclty understand the error or the reason but based on what I have read is the reference on the hash.

Based on the documentation from CPAN

"This list is passed to the method as an array reference using the -varbindlist argument."

But I can not completely understand why if I remove the "\" it works.

Thanks in advance for your time,advices and assistance to my query


In reply to Re^2: SNMP get request error by thanos1983
in thread ERROR: The OBJECT IDENTIFIER value "ARRAY(0x1b80628)" is expected in dotted decimal notation. by thanos1983

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.