Checking CUCM DHCP Lease

Posted: February 16, 2009 in CUCM
Tags: ,

How to check DHCP leases status on cisco CCM 6x

Cisco CCM 5/6/7x still have built-in DHCP server.

Cisco call manager : Obviously, this is a big enterprise level IPTELEPHONY product which really “WORKS”. No product is perfect and there is always a room for improvement.

One of the issues I came across was the issue with “How to check” what address is allocated to which IP phone.
It was long due in my TODO list, but I have been flat out recently at work and didn’t have time to do a blog:

Today I just got home and as usual, I  was checking my personal email and found an email message from a guy who came through google and hit my  blog asking for the same thing 🙂
Thanks Leonardo for reminding this.

On Mon, Feb 16, 2009 at 5:11 AM, Leonardo D’Urso <l.durso@gmail.com>wrote:

hi Pushkar

I am an enthusiastic reader of your blog, it’s great. I have worked with Cisco since 2002.
I have a question for you. Have you ever configured a dhcp service directly on ccm 6.x?

Any idea if it is possible to display via CLI the dhcp leases or scope like in the Microsoft dhcp server or
Like on Cisco equipment (for ex. ios: show ip dhcp bindings)?

kind regards
Leonardo

Leonardo D’Urso

After reading above request, I decided to flock through the CCM and cross this off my “to do list”

In the past, so far I have done 12-16 call manages 5/6x installation, but most of the customers were using their dedicated DHCP and a few of them were using Call manager’s built-in DHCP server. Back to CCM 4x days, Cisco used to use Microsoft DHCP server (WIN3k or WIN2k) which was full flag and can tell who have what Address at any given time.

In CCM 5/6/7x there is no easy way to check the DHCP lease(es) allocated to IP phones by the DHCP server.

CCM new boxes are Linux based and the DHCP server implementation is also open source software.

It’s basically open source DHCPD daemon (/etc/dhcpd. conf style) which is good and stable but what a shame, this BIG commercial product and it doesn’t give us a GUI or CLI interface to see what address are leased!
I believe Cisco will give it a go and improve it in the future.

For the time being, here is my workaround to find out the leases (not the easiest method though as I said above).

There is also some other method to know the status of DHCP leases in the Cisco CCM DHCP server

Basic information can be collected via SNMP or SYSLOG server:
– CCM sends DHCP alarm/trap alerts to an SNMP platform (HPopenview, Ciscoworks etc.)
– CCM also sends same alarms/alerts for a preconfigured SYSLOG server.

The above information is very basic and that still doesn’t’ really tell the status of the leases. It’s noticeable and I have observed that the SNMP/SYSLOG alert only triggers  when there is something really wrong with DHCPD. For example DHCP pool gets full or there are no IP addresses to allocate to DHCP clients.

The above methods are useless as nobody will wait when there is really problematic. Everyone wants to see the leases when they want and when they fell. Just think about  stressing alert telling “Hey buddy the DHCP server has no IP address” Sent to you when you were in a night club.

Another way to see the lease alerts could be RTMT tool. But it still doesn’t do the best job. My method 100% shows DHCP leases. It’s a bit hard work but really works.

Here is my method which really works, just need to get the root access to the box. To get access to root shell you have 2 ways:

1. Create a remote account from “disk recovery” menu and ask TAC to provide your password.

2. Risky method: the following steps detail the process on how GRUB is reinstalled on the master boot record:

  • Boot the system from an installation boot medium.
  • Type Linux rescue at the installation boot prompt to enter the rescue environment.
  • Type chroot /mnt/sysimage to mount the root partition.
  • Then create username as u create in regular LINUX. ‘useradd‘ password
  • Edit /etc/passwd file and set created users userID and GUID to 0:0
  • Note: 0:0 is for root
  • After that you can simply ssh it using putty.exe or ssh user@ipaddresofccm

Once you got access to CCM root have a look at this file:

cat /etc/dhcp3/dhcp.conf <———-this is the main DHCPD config file

Here in that file you will not see anything about where the lease file will be pointing to. This is by default pointed to

Now create a file which is visible through the operating system CLI (damn CLI).

Type touch /common/download/dhcpleases. hehe

Now link default dhcpleases. hehe file to dhcpd. lease file which is in /var/lib/dhcp/dhcpd.leases. /var/lib/dhcp/dhcpd.leases is the default file where DHCPD daemon writes all leaes status.

Alternatively, if you are comfortable with Linux you can just simply do this:

Edit the /etc/dhcpd.conf file and just add this line:

lease-file-name “/common/download/dhcpd.leases”

Restart the DHCP daemon by issuing ‘service dhcpd restart or service dhcp3-server restart’

It will write all status of dhcp leases to /common/download/dhcp.leases file.

Now jump to your CCM friendly (hey did I say friendly?) GUI and download the dhcpdlease. hehe file and you can see who have what leases. So that’s all about it.

Those brainless programmers did not think about doing this little job from the Administrator point of view. I know there is a RTMT tool, but it would be nice to see it somewhere on the GUI.

Another tip on DHCP server:
—————————————–

How to make sure that whatever is configured via CCM GUI under DHCP server is 100% correct and working?
Yes, you can confirm this using SQL query command:

STEP#1: Login using ssh to the CCM server

STEP#2:
– To check DHCP servers: issue “run sql select * from dhcpserver

– To check DHCP scopes: issue “run sql select * from dhcpsubnet


Good luck and happy learning…

PS: if you found this article useful, don’t forget to send me a postcard!! hehe..

-Push

Advertisements
Comments
  1. Islam says:

    Dear Sir:

    We have a Cisco UC 520 running in our company where DHCP is configured so that a IP phone receives IP. Now we are developing an application for what we need to know which IP Phone is assigned which IP address. Does it possible to obtain the result? Is there any file on the CallManager that stores such information?

    Please note that we did not build and don’t want to build any external DHCP server.

    Thanks for your kind help.

    • chika Ilogu says:

      since u have a UC 520, it means u are running Callmanager Express and not Callmanager. So on your UC 520 do a “sh ip dhcp binding” this should show u urleases too

  2. selenato says:

    Interesting Read! Very detailed blog.
    Thanks for sharing

  3. Endy says:

    Great post.. thanks for sharing 😀

  4. chris says:

    thanks for this. i had heard this was challenging but wow, what a pain. lesson learned, dont use ccm for DHCP if you want to easily manage DHCP. keep up the good work /cdrew

    • Thanks Chris. It was the first time CUCM came with DHCP.
      I know it should always be IOS DHCP or customer’s existing DHCP!
      Most of the time I see, IOS DHCP server at the site NTU/CPE. That makes a complete Sense.
      Nobody and I said nobody should use CUCM built-in DHCP service. It has not been tested extensively. There are a lot of config erros that I saw in dhcp and the RPM package is quite buggy!

  5. When some one searches for his vital thing,
    so he/she wants to be available that in detail,
    so that thing is maintained over here.

Leave a Reply , I will reply ASAP

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s