All I am looking for someone that can instruct me on how to communicate to Cisco Unified Communications Manager with Perl. The requirement is as follows: I have completed a script that via SNMP polls network switches for connected phones, now , I need to take the phone name "SEP(plus phones MAC" I.E SEPFFFFFFFFFFFF , and talks to CUCM to determine the phones Directory Number(s) programmed on it.

Here is my code thus far. Pardon my horrible variable naming convention, I was trying to create this script in a hurry. I now need some of the output of this script (the SEP Name) and query CUCM for more details about the phone. Help please?

#!/usr/bin/perl #Version 1 2/27/17 use SNMP_util; use NetAddr::IP; #use warnings; ####Variable Dec my $sCdpCacheCapabilities = "1.3.6.1.4.1.9.9.23.1.2.1.1.9"; my $sCommu +nityString = "notReallyGivingUmyCommunityString"; my $counter =0; $cd +pCacheDeviceId = "1.3.6.1.4.1.9.9.23.1.2.1.1.6"; $cdpCachePlatform = +"1.3.6.1.4.1.9.9.23.1.2.1.1.8"; $cdpInterfaceEntry = "1.3.6.1.4.1.9.9 +.23.1.1.1.1.6"; $cdpCacheAddress = "1.3.6.1.4.1.9.9.23.1.2.1.1.4"; ##### End Variable Declaration #####Open File Handle open (FILEREAD, "formerlyBridges2Input.csv"); while ($Host = <FILEREAD>){ chomp ($Host); (@cdpNeighborPackedCapabilities) = &snmpwalk("$sCommunityString\@$Ho +st","$sCdpCacheCapabilities"); foreach $PcdpCap (@cdpNeighborPackedCapabilities){ + #($index, $capHEX) = split( +/:/, $PcdpCap, 2); ($uni, $mee, $capHEX) = split (/[\.,:]/, $PcdpCap); + #($ind, $in2) = split(/./, + $index, 2); ($index) = join ('.' , $uni,$mee); my $sUnpackedCDPcap; map { $sUnpackedCDPcap .= sprintf("%02x",$_) } unpack "CCCCCC", $c +apHEX; if ($sUnpackedCDPcap == "00000490"){ $sIDcomp = "$cdpCacheDeviceId.$index"; $sPlaComp = "$cdpCachePlatform.$index"; $sInEntry = "$cdpInterfaceEntry.$uni"; $sAddComp = "$cdpCacheAddress.$index"; ###print "$sAddComp\n"; ($devName) = &snmpget("$sCommunityString\@$Host","$sIDcomp"); ($sDevPlatform) = &snmpget("$sCommunityString\@$Host","$sPlaComp") +; ($sPortName) = &snmpget("$sCommunityString\@$Host","$sInEntry"); ($ipAdd) = &snmpget("$sCommunityString\@$Host","$sAddComp"); # $Do = join '.', unpack "C*", pack "H*", $ipAdd; my $val4; map {$val4 .= sprintf("%02x",$_)} unpack "C*", $ipAdd; $neighIP = join '.', unpack "C*", pack "H*", $val4; print "$Host,$devName,$sDevPlatform,$sPortName,http://$neighIP/\n" +;} }}

In reply to Getting data from Cisco Call Manager with Perl by adamZ88

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.