NeDi Community

NeDi Software Specific => Discovery => Topic started by: rozg on June 06, 2013, 04:47:10 PM

Title: Serial Number for Cisco IP Phones 7937 and 8945 not found
Post by: rozg on June 06, 2013, 04:47:10 PM
Hi

I am ruuning the 1.0.8 release of NeDi and found that the following Cisco IP Phones
- Cisco 7937
- Cisco 8945
The serial number is missing, I have the correct phone type and the telephone number but no serial number.

Does anyone have any suggestion on how I can find the problem.

Thanks

Roy
Title: Re: Serial Number for Cisco IP Phones 7937 and 8945 not found
Post by: rickli on June 06, 2013, 05:31:17 PM
Can you post -v output around the phones? And maybe attach an anonymized phone webpage? I'll be looking at getting this info via SOAP from the callmanager...
Title: Re: Serial Number for Cisco IP Phones 7937 and 8945 not found
Post by: rozg on June 20, 2013, 11:46:44 AM
Hi

I hope this is the putput you required.

 PTY :Loaded LWP :Loaded OUI :21798 NIC vendor entries read RDEV:557 devices read from nedi.devices RADDR:3968 MAC, 746 IP and 0 IPv6 addresses read. RLNK:0 links (WHERE linktype = "STAT") read from nedi.links RMON:0 entries (dev) read from nedi.monitoring RMON:0 entries (node) read from nedi.monitoring RUSR:0 entries (groups & 8 AND (phone != "" OR email != "")) read from nedi.users SEED:172.31.116.1 added for discovery MAIN:No threads, set 1st at Thu Jun 20 11:37:12 2013 Manual-Discovery (1.0.8-116) with 1 seed at Thu Jun 20 11:37:12 2013 ------------------------------------------------------------------------------- Device Status Todo/Done-Time =============================================================================== Discover ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Identify 172.31.116.1 ------------------------------------------------------- EVNT:CL=nedn EL=1 TGT=172.31.116.1 MSG=IP 172.31.116.1 belongs to nosnmpdev SEP60735C6334DE, not replacing DISC:ToDo/Done-Time 0/0-0s =============================================================================== Nothing discovered, nothing written... END :Took 0 minutes

Title: Re: Serial Number for Cisco IP Phones 7937 and 8945 not found
Post by: rickli on June 20, 2013, 09:27:33 PM
Good enough ( the actual html code would have been easier :)
The output: "belongs to nosnmpdev SEP60735C6334DE, not replacing" does not appear in your normal discoveries, correct?

Change the regexp on line 54 in inc/libweb.pm to include the new SN: FCH\w+|INM\w+|PUC\w+|000\w+

It's possible that we need to tweak some more on the 7937. Just paste the html code around the serial number in that case...
Title: Re: Serial Number for Cisco IP Phones 7937 and 8945 not found
Post by: rozg on June 24, 2013, 11:41:05 AM
Hi Remo

Did not seem to work with the new RegEx for ther serial number, I updated line 54 as shown below.
if ( $devhtml =~ m/<b>(FCH\w+|INM\w+|PUC\w+|000\w+)<\/b>/i ) {

I have also attached the HTML for each phone.

Many Thanks

Roy
Title: Re: Serial Number for Cisco IP Phones 7937 and 8945 not found
Post by: rickli on June 24, 2013, 05:12:55 PM
Ok, I see. Can you try this?

      if ( $devhtml =~ m/<(b|strong)>(FCH\w+|INM\w+|PUC\w+)<\/(b|strong)>/i ) {      # Find Serial  on Cisco 7920,40,60,11,10,06 8945
         $main::dev{$na}{sn} = $2;
      }elsif( $devhtml =~ m/:    (000\w+)<\/name>/i ){               # Find Serial  on Cisco 7937
         $main::dev{$na}{sn} = $1;
      }elsif( $devhtml =~ m/: ([0-9]{2,8})<\/name>/i ){               # Find Extension on Cisco 7937, tx Kstadler
         $main::dev{$_[0]}{co} = $1;
      }elsif( $devhtml =~ m/<td>(FCH\w+|INM\w+)\W+<tr>/i ){               # Find Serial  on Cisco 7912
         $main::dev{$na}{sn} = $1;
      }
Title: Re: Serial Number for Cisco IP Phones 7937 and 8945 not found
Post by: rozg on June 27, 2013, 09:18:06 AM
Hi

This code now seems to be working OK for the 7937 and 8945.

I am also looking to make some adjustments for the Cisco 6901.

I have attached the HTML Outout.

Roy
Title: Re: Serial Number for Cisco IP Phones 7937 and 8945 not found
Post by: rickli on June 27, 2013, 07:32:25 PM
I've created a little test setup against your html output and it seems to be ok:

n8dev:~#ne -vD
PTY :Loaded
LWP :Loaded
LWP :Contact:275569 SN:FCH16418G92


Is this not correct?
Title: Re: Serial Number for Cisco IP Phones 7937 and 8945 not found
Post by: rozg on June 28, 2013, 08:58:27 AM
Hi

if I try the commad "ne -vD" I get the following output.

readline() on closed filehandle CONF at /var/nedi/nedi.pl line 86.
readline() on closed filehandle CONF at /var/nedi/nedi.pl line 90.

I do get output for the following command.

vu-zrh521:~#ne -v -d -a172.31.66.9     
PTY :Loaded
LWP :Loaded
OUI :21798 NIC vendor entries read
RDEV:695 devices read from nedi.devices
RADDR:5037 MAC, 897 IP and 0 IPv6 addresses read.
RLNK:0 links (WHERE linktype = "STAT") read from nedi.links
RMON:0 entries (dev) read from nedi.monitoring
RMON:0 entries (node) read from nedi.monitoring
RUSR:0 entries (groups & 8 AND (phone != "" OR email != "")) read from nedi.users
SEED:172.31.66.9 added for discovery
SEL :> SELECT value FROM system WHERE name="threads";  yields 1 rows
SEL :> SELECT value FROM system WHERE name="first";  yields 1 rows
MAIN:2 threads, 1st from Fri Jun 28 08:15:01 2013 seems ok adding this one
UPDT:1 ROWS FROM system SET value=value+1 WHERE name="threads"

Manual-Discovery (1.0.8-116) with 1 seed at Fri Jun 28 08:57:03 2013
-------------------------------------------------------------------------------
Device                          Status                          Todo/Done-Time
===============================================================================

Discover     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Identify 172.31.66.9 -------------------------------------------------------
EVNT:CL=nedn EL=1 TGT=172.31.66.9 MSG=IP 172.31.66.9 belongs to nosnmpdev SEP1ce6c7721094, not replacing
INS :1 ROWS INTO events (level,time,source,info,class,device) VALUES ("100","1372402623","172.31.66.9","IP 172.31.66.9 belongs to nosnmpdev SEP1ce6c7721094, not replacing","nedn","")
DISC:ToDo/Done-Time                                                        0/0-0s
===============================================================================
Nothing discovered, nothing written...
UPDT:1 ROWS FROM system SET value=value-1 WHERE name="threads"
END :Took 0 minutes

vu-zrh521:~#

It would appear that nedi does not find anything that need replacing?


Title: Re: Serial Number for Cisco IP Phones 7937 and 8945 not found
Post by: rickli on June 28, 2013, 11:24:32 AM
Ok, guess I need to explain:

-D is for debugging only and executes code after line 84 in nedi.pl. For this test I've simply added:

   require "$p/inc/libweb.pm";
   $main::dev{'test'}{ip} = '10.10.10.161';
   &web::CiscoPhone('test')


Where 10.10.10.161 is the phone IP.

You cannot discover an IP phone directly, because it's in the DB as non-SNMP device, thus the message...