PDA

View Full Version : StarMAN (Firmware Manager)


ninedd
09-15-2008, 01:44 AM
What is StarMAN? Why is StarMAN? What does it do? Where can I get it?

http://www.9DollarDomains.com/sos/StarMAN.zip

+==============================+
| STARMAN BACKGROUND & THEORY: |
+==============================+

How does StarMAN work? How does it do what it does? Basically, this utility will ping each IP address in a Class C block (that is, in a /24) and keep track of which IP's answered back as being alive. It will then query each of those IP's via SNMP to try to figure out what version of firmware and what type of hardware each CPE/AP has on it. In previous verson, the pinging of a whole /24 was a time consuming process, but I've re-written the routines to be multi-threaded as of version 0.9 and later. In my testing, it can ping a /24 in about 10 seconds or so.

I currently have it scan each IP via SNMP live on every run. I could have it save that information in a database, BUT many WIPS's use Dynamic DHCP IP's, so the firmware versions attached to each IP Address may change. If SNMP is turned on for every CPE, then it doesn't take long to query them all. Besides, that way we can be more confident that the firmware & hardware versions reported are current and accurate - especially for those WISP's doing Dynamic DHCP's to their customer's CPE's.

I should mention that I've looked for better ways to do it, but other methods seem to have other problems. For example, I can query the Access Point via SNMP and ask it to tell me the IP addresses of currently connected CPE's, however, it seems to show the last IP thought that connection, so while 80% of the time that's correct, the list also sometimes contains the customer's router's IP, or the IP of some server they're uploading to, or whatever. Querying the Access Point is faster, but since it occasionally has incorrect IP addresses included in the list, it has it's own complications. Therefore, I've gone back to the 'brute force' method of just simply pinging each IP and seeing which are alive and which are not. Now that it's multi-threaded, it's actually pretty quick to ping the whole /24 anyway.

Also, I should mention that if you don't have SNMP running on CPE's right now, then you can use this program to help you out. Without SNMP running on a CPE, StarMAN won't be able to query the firmware version on the CPE, and it'll take an extra couple seconds per CPE for it to timeout. Once the list is displayed (with 'NO SNMP' displayed) you can simply Double-Click on a CPE to launch Putty, and in the menu's, go to SYSTEM -> SERVICES -> SNMP AGENT to start SNMP so that it's currently running, and also check if off so that it will start automaticaly, and then then do a 'FILE -> SAVE' to make sure SNMP starts whenever the CPE reboots.

My original goal was just to write a VERY simply a tool to poll each CPE in a Subnet, and to simply list what Firmware was on each CPE. Prior to that, we found that when we were upgrading firmwares on the CPE's, we'd have to have a pen & paper to keep track of which upgrades we had completed and which ones we hadn't - and if we got inturrupted by a phone call or something while doing all the upgrades, then it was easy to get mixed up. Even when we thought we'd done it all correctly, we'd still occasionally have a CPE that was not in the association list that day (maybe the customer had powered it off?), or one that had failed, or one that was simply missed - and some CPE's would be sitting around with older versions on it.

There are also some really good professional tools available, but as good as they are, we generally found that after we believed that we had properly done all the upgrades, we would basically go back through all the CPE's with Putty one more time after we were finished, just to double-check every one of them - which was time consuming. So, I set out to write a simple utility that would read and spit out a report listing all the firware versions, to help us quickly double check and keep track of the network, and StarMAN was born. :)

Once I got that working, I figured it wouldn't be too horibly much work to extend it to launch Putty in order to log into the CPE's. Since StarMAN knows the IP Addresses of each CPE in it's list, I thought it'd be convenient to have Putty just a double-click away. So, StarMan was extended with that capability. Just double-left click on a CPE and you'll be right into Putty. Cool!

And then of course, the gears start chunking along. What else could I add? Wouldn't it be nice if was extended to upload firmware to those CPE's as well? Well, right-click on a CPE and it'll launch the firmware upload routine. It'll upload (and 'apply' that firmware) to the CPE. Of course, BE VERY CAREFUL when doing that. I've got checking in place to help ensure that it'll only upload matching firmwares, but ya never know, so be very careful!

I've also tried to write it and test it with more CPE's than a single page can hold, but most of our AP's only have 20 or 30 CPE's Maximum on them. However, if you have more than a page's worth of CPEs in a subnet, then it 'should' properly break it into muliple pages, with PageUp and PageDown moving between the pages.

What about the future... well, I'll probably not do too much more to it. It's pretty functional as is, plus there are other tools available that may be better suited for many people. If you want other features, it doesn't hurt to ask, and I can see what I can do. :)

=================================================

DISCLAIMER: Even before the Quickstart however, THE DISCLAIMER! This program was written for our own use and it works for us. HOWEVER, use it AT YOUR OWN RISK! It may wreak havoc and rain destruction down on your network, your CPE's may be damaged, or you may be driven into Pon'far for all I know. THERE IS NO WARRANTY, Zero, Zilch, Nada.

QUICKSTART: There isn't a lot of fancy installation needed. The StarMan.exe program is basically a self contained windows executable. It can be run from the Command prompt, or it can be run from Windows and it'll open it's own window.

PREREQUISITES: StarMAN also needs to have Putty.exe and StarUtil.exe available. Simplest is just to copy them into the same directory as StarMAN is located, or to have them in your PATH. Also, StarUtil should be the latest version (1.16 as of this writing). Obviously, the SNMP service needs to be running on any CPEs as well.

The most important prerequisite on your computer is Net-SNMP. It has to be installed, or StarMAN can't work. If you don't already have Net-SNMP installed, you can get it at SourceForge. I downloaded the Windows binaries from here. -> http://sourceforge.net/project/showfiles.php?group_id=12694

FIRMWARE UPLOADS: In order to be able to upload new firmware, the .pkg files need to be in the right location for StarMAN to find. There needs to be a 'firmware' folder in the path under where StarMAN is. You can place a number of firmware .pkg files in that directory so that StarMAN can find them and use them in the firmware upload routines. Also, these .pkg files should have their original Valemount filenames (and not be renamed or shortened) in order for StarMAN to be able to use them properly.

STARMAN.INI: There is a starman.ini file which currently contains only two lines - the first line contains your SNMP community name (for example: public) and second line is the password (for example: 1234) that you want putty to use when logging into a CPE. There is nothing fancy, and no encryption on the .ini file, so your community and password will be just plain text, at least for this version.

So, as a minimum, you'll want to have...

Install_Directory
|-StarMan.exe
|-StarMan.ini
|-Putty.exe
|-StarUtil.exe
|----firmware
| |-.pkg files

That may have all sounded more complicated than it really is. :) Simply install Net-SNMP, have Putty.exe and StarUtil.exe in the same directory as StarMAN.exe, edit the StarMan.ini file, and make sure that the firmware directory contains some .pkg files. And, that should be that!

tog
09-15-2008, 08:35 AM
Very nice, thanks for releasing this.

Stratolinks
09-15-2008, 03:04 PM
This is looking like a very useful utility, but I do have a question regarding your description of what goes in the starman.ini file.
STARMAN.INI: There is a starman.ini file which currently contains only two lines - the first line contains your SNMP community name (for example: public) and second line is the password (for example: 1234) that you want putty to use when logging into a CPE. There is nothing fancy, and no encryption on the .ini file, so your community and password will be just plain text, at least for this version.
Does this mean that EVERY CPE has to have the same password and SNMP community name? No two of our CPE has the same password since out database generates unique passwords for every client. We do use the same cummunity name for SNMP however. If this is the case, you might consider some other sort of options for passwords, lookup from a tab delimited test file referenced by IP address or something like that.

These are just thoughts as I look at the information posted here. I have not downloaded it yet since I am not using a Windows machine at home, although I do keep one at the shop.

ninedd
09-15-2008, 05:12 PM
This is looking like a very useful utilityThanx.
Does this mean that EVERY CPE has to have the same password and SNMP community name?Yes, in our setup, we use the same community and password for all our AP's and CPE's (but of course don't use default/1234). Initially, I had 'public' hard coded in the software, and it would simply ask for the password. I frankly LOVE it when putty loads all the way with just a double-click (no typing in of passwords), so I put it in an ini file at the request of Keith (knolan). However, I could probably update it to learn Passwords in a database of IP's.

The thing is, I also wanted to keep it useful for those WISP's with Dynamic IP's if possible, so I'll have to give this some thought and see what can be accomodated. As long as the SNMP community stays the same across your network, then I can probably figure something out.

DrLove73
09-15-2008, 06:20 PM
Just use a switch in ini file to select SNMP password mode and simultaneously offer both approaches. You even might try default pass if one designated for that IP does not work.

ninedd
09-15-2008, 11:06 PM
That would be the plan.