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.
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)?
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:
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
– 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..