Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check number of available DHCP addresses

Status
Not open for further replies.

Chr0nic

MIS
Jun 14, 2002
13
0
0
US
Does anyone know of a script or other method to query the number of available DHCP addresses on NT4/W2K servers? We have a number of servers at different sites and I want to set up monitors to alert me when a certain trigger level is reached, but I'm not sure how to query the number of addresses. Any help greatly appreciated.

Regards,

Carl
 
I've been using the following in a batch file:

REM-------start-------
@echo off
:getmibcount
dhcpcmd 123.456.789.101 mibcounts >mibcounts.log
dhcpcmd 123.456.789.101 enumclients 123.456.789.0 >789pool.log
dhcpcmd 123.456.789.101 enumclients 123.456.788.0 >788pool.log
dhcpcmd 123.456.789.101 enumclients 123.456.787.0 >787pool.log
doze 300
goto getmibcount
REM-------end----------


123.456.789.101 is my DHCP server
mibcounts gets a summary of the dhcp server with # of addresses free and used and total for all scopes configured.
123.456.789.0, 123.456.788.0, 123.456.787.0 are my scopes which get dumped to the respective log text file. This displays all the clients using addresses.

Schedule this batch file to run using Task Scheduler so it runs in the background on your DHCP server(s). It will loop every 5 minutes (300 seconds).

You'll need to get doze.exe ... I think it's in the NT4 ResKit.
It will dump the results to the logs. Then you can just view those logs whenever you wish to see the status updated every 5 minutes.

I've gone one step further and incorporated those logs into a web page so I can visit that page and at a glance see the usage. Then click on the scopes to see the break down of clients.

HTH
 
Oh forgot your part about setting up trigger alerts. If you have access to some back page processor on a web server, you could have it automatically check the web page like I have created and if the free addresses are at or below a certain number, send you an email or page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top