Click here to Skip to main content
Click here to Skip to main content
Technical Blog

Lan Sleep/Wake Up Tool

, 10 Jun 2011 MIT
Rate this:
Please Sign up or sign in to vote.
A little GUI tool to manage your Windows boxes, waking them up or putting them to sleep.

I write little tools from time to time that I need to manage my personal lab. Since my machines are in their own powered and air conditioned closet, it isn’t very convenient to get up, open the closet, get slammed by the noise, and turn a machine on. And, I don’t want to leave them on all the time if I’m not using them. I’m no Paul Randal (blog|twitter) but I do use between 4000 and 5000 kilowatt hours a month.

Enter Innovation!

So, since I couldn’t find a simple tool to handle this, I wrote one! LabWakeUp is pretty easy to use.

Don’t blink, you might miss it

It looks for a text file called servers.txt. This file should have one server name per line. The program loops through them and tries to get a MAC address via a system call (a.k.a. P/Invoke) to the Windows dll that handles ARP calls. It then writes these to another text file called serverMACs.txt that has, you guessed it, a server name and a MAC address if one could be found. You can manually put entries in this file if you like. I personally don’t like hunting around for MAC addresses then typing them into anything if I don’t have to. You only need to fill in the Windows user name and password if you want to wake a machine up.

They Are Undocumented Features!

When you start it up, nothing is displayed while it goes through the servers.txt file. Again, lazy strikes, I may fix it later - it is just annoying and not a “bug”. In serverMACs.txt, if a server isn’t found, it may be a bogus MAC address. This is most defiantly a bug and will be addressed. The serverMACs.txt isn’t updated if a new MAC is found. You have to delete the entry and let it rediscover it.

Improvements Are Coming… Eventually!

  • Asynchronous multi-threaded MAC discovery. This will grey out a portion of the tool but will make things more tolerable.
  • Discover MAC on new entries only. So, if there aren’t any new names in servers.txt, we won’t do the MAC lookup.
  • Update MAC entries. Yep, just update the MAC entries that we know about.

Finally…

If you end up using this tool, let me know! I’d like to think that some of the things I build are useful to others too.

License

This article, along with any associated source code and files, is licensed under The MIT License

Share

About the Author

SQLServerIO
Architect eScan Data Systems
United States United States
I’m Wes Brown, currently serving as Sr. Database Administrator for Nextgen Healthcare and as happy as I’ve ever been in my professional career.
Over the past decade or so I’ve been focused on enterprise systems and SQL Server in particular.
 
That isn’t to say that’s all I’ve ever done just the thing that has brought me to this point in my professional career.
 
I’ve also had the privilege to work with some outstanding companies and people along the way including Quest Software (litespeed product manager and SQL Server domain expert) and GoldenGate Software (SQL Server domain expert and professional services) that you may know as a database professional. Other companies like The SCOOTER Store (yes if they prequalify you, and you are turned down by Medicaid they will give you your scooter or power wheelchair) where I got to hone my SQL skills to a fine point.
 
Through all that I’m also active in the SQL Server community mostly on a local level running the Austin, TX PASS chapter CACTUSS http://www.cactuss.org for the last 5 years I think, time has a way of playing tricks on your memory. I also started the San Antonio PASS chapter SALSSA http://www.salssa.com which is now in the capable hands of Jim Steiner.
Follow on   Twitter

Comments and Discussions

 
QuestionNo download link? Pinmembermasterducky12-Oct-13 21:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.1411023.1 | Last Updated 10 Jun 2011
Article Copyright 2011 by SQLServerIO
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid