Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Cisco SNMP CDP Poll

by dkessinger (Initiate)
on Jan 01, 2012 at 15:58 UTC ( [id://945796]=note: print w/replies, xml ) Need Help??


in reply to Cisco SNMP CDP Poll

Running in Window XP Mode
C:\Documents and Settings\XPMUser\My Documents\script>perl -v

This is perl 5, version 12, subversion 4 (v5.12.4) built for MSWin32-x86-multi-thread

C:\Documents and Settings\XPMUser\My Documents\script>perl cdpsnmp.txt xxx.xxx.xxx.xxx
community: !!!!!!!


CDP Neighbor Details for xxx.xxx.xxx.xxx
--------------------------------------------------------------------------------------------
Neighbor IP Name Interface Type |
--------------------------------------------------------------------------------------------
oid_context_match() is obsolete, use oid_base_match() instead at cdpsnmp.txt line 61

line 61 = while(Net::SNMP::oid_context_match($starting_oid,$new_oid)){

Help with this error please. I am a newbi to perl. I finally got it to run and it fails :(
any help would be appreciated
Daniel

Replies are listed 'Best First'.
Re^2: Cisco SNMP CDP Poll
by igoryonya (Pilgrim) on Apr 18, 2019 at 21:43 UTC
    I just did this:
    sub get_oids{ my($starting_oid , $new_oid , $unique_oid , $result , $crap); my($ip , $name , $port , $type); $starting_oid = $_[0]; $new_oid = $starting_oid ; # while(Net::SNMP::oid_context_match($starting_oid,$new_oid)){ while(Net::SNMP::oid_base_match($starting_oid,$new_oid)){ $result = $session->get_next_request(($new_oid)); return unless (defined $result); ($new_oid , $crap) = %$result; # if (Net::SNMP::oid_context_match($starting_oid,$new_oid)) +{ if (Net::SNMP::oid_base_match($starting_oid,$new_oid)){ $unique_oid = $new_oid; $unique_oid =~ s/$starting_oid//g; $ip = (Convert_IP(Get_SNMP_Info("$oid_root".".4"."$unique_ +oid"))); $name = (Get_SNMP_Info("$oid_root".".6"."$unique_oid")); $port = (Get_SNMP_Info("$oid_root".".7"."$unique_oid")); $type = (Get_SNMP_Info("$oid_root".".8"."$unique_oid")); @todo=(@todo,$ip); write; get_oids($new_oid); } } #Format the report format STDOUT = @<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<< +<<<<<< @<<<<<<<<<<<<<<<<<<<<< $ip,$name,$port,$type . }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://945796]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-16 17:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found