Monday, May 2, 2011

What a Macro Looks Like

I've been meaning to write this blog post for a very long time. I know I haven't updated in a while, there were some things outside of RCOS that happened, and as a result I was forced to move a date for a Cisco Certification exam up about nine days. So I needed to put everything else aside to study for this newly pushed up exam, which I am also pleased to report that I passed.

So I am still hard at work on the Internetwork Management Program. Recently, I have been working toward adding features to macro commonly used connections. What this will look like, is basically the program will create a file to store user entered data in the form of "deviceId address:port". These files will be stored with some unique tagging in the working directory of the project (or perhaps some other user specified location). Upon program start, it will identify these files to be displayed in the File menu, by name or some other convention.

The data in the file is then sucked into a hash (key, value mapping) in the form of deviceId => address (with an optional port number tagged on to the address. The colon in the original file is parsed out with some cool regular expression action). The deviceId is a human-defined name which is displayed in the tab. Then, it runs the same connect script to generate tabs and connect to devices.

Depending on your version of Perl, you may see an error like 'useless use of array element in void context' when running the r38 of the program. This is in a function which currently has no way to be executed from the program, and thus can safely be ignored. When this function actually gets integrated into the program the warning will be fixed.

Friday, April 15, 2011

Long Time, No Update!

It's been a while since I've had time to write in the blog. I spent the past 10 days studying intensely for my Cisco Certified Network Associate-Security exam. Normally, I would not spend such a large amount of time preparing, however, these exams from Cisco cost $250 each time to take, so it is not something to be undertaken lightly. I am pleased to write, however, that I took the exam this past Wednesday and passed with a perfect score of 1000/1000!! I look forward to having my life back, including more time to work on INMP.

So here's what's in the works. I gave my second presentation to RCOS on last Friday. The presentation went well, I had a lot to talk about and ran a little short on time, and thus was not able to demonstrate all the features I wanted. Still, I feel the talk went well and I am really pleased with how the project is turning out so far.

In my last update, I wrote about a way I had thought to improve the save functionality. Right now, the function writes each line of the running-configuration to a file one line at a time, looking for an 'interface' line to add the 'no shutdown' command after. Perl's operations on text file are very fast, so this is not a limiting factor, especially for the small-scale networks built in RPI's network classes. I thought I could gain some speed by writing the entire running-configuration to a file and then adding the 'no shutdown' line afterward. It turns out, this is actually somewhat complicated to do, so I am going to push this goal aside for now, as I don't want to be spinning my wheels trying to accomplish one small task.

After my presentation on Friday, I received an awesome suggestion from fellow RCOS member Joe Dougherty. It boils down to, what if the tabs for each connection knew what device they were connected too, and a timed-out connection could be restarted merely striking a single key? I have started to include functionality so that the tabs keep track of what device they are connected too, again however, as awesome as this idea is, I don't want to let it distract me from my primary goal in the remaining part of the semester, which is adding macros for commonly used devices so as to make the software more useful outside of RPI. I am going to work on both of these goals concurrently, and in a best-case scenario, have them both done for the end of the semester.

Friday, April 1, 2011

Fix last week's bug

Unfortunately, I am a bit behind this week. However, with some help from fellow RCOS member Joe Dougherty, I have fixed the 'no shut' bug I wrote about last week. Using his idea, I also have some thoughts about how I can re-write that function of the program to hopefully provide an overall boost in speed.

Hopefully will get back on track this weekend/next week and have more substantial stuff to write about.

Friday, March 25, 2011

Oh, no, another bug!!

More on that later. I like chronological blog entries.

First off, fellow RCOS member Tim Horton was kind enough to point out some errors in the licensing for INMP, and was kind enough to point me in the right direction of fixing them. The code is now properly licensed under GPLv2. Thanks, Tim!

Secondly, fellow RCOS member David Doria was kind enough to point out some problems in documentation of software. I updated the documentation for newest version of the software and also wrote a small Perl script which tests the user's machine to ensure it is properly set up to run INMP. The script detects missing modules and explains how to install them, then instructs how to start the software. Thanks for pointing out this documentation issue, David!

David's e-mail about this really got me thinking. I really want to package the software into a .deb/.rpm package to make installation simple. I'd also like some type of automated installation for any missing Perl modules on the user's system. Since I've never done anything like this before, this week was a lot of research as opposed to code development.

However, the bug in the title must now take the priority. There is a pretty big problem with the functions to propagate 'no shut' command to the proper interfaces. In hindsight, I should have realized this would happen when I wrote the original script for that, and am a bit embarrassed to admit I am only discovering it now. Nevertheless, I have a few ideas about how to fix it, and will likely post another entry in the next few days detailing my success or lack thereof.

That's it for now.

Friday, March 11, 2011

Live Testing!

So I am happy to report that the software survived it's first 'real-world' test, as I used it for my classwork on Thursday. I also thought of some more features to add to aid in it's use, particularly I will look at the ability to dismiss a specific tab to reduce clutter in labs which don't need all 11 devices. Also will make the tabs expand to fill the entire width of the client, because right now they are only 2-4 characters long, and when switching across multiple devices quickly this becomes a problem.

In other news, I would like to thank Tim Horton, both for the youtube upload of last week presentation which may found here and for helping me with some licensing issues in the code.

Sunday, March 6, 2011

"I need 15 more minutes." "What? You've had 11 hours and you need 15 more minutes?"

That was the scene at about 6:45 this morning, when everyone was getting ready to show off their work at Hackathon. I needed 15 more minutes to fix a bug I was working on.

So yes, I survived the 12 hour Hackathon event!! The updates to the repository are here. The work from Hackathon starts at r24 and continues all the way to r31!!! I committed often during the event so I would have a log of all the stuff I did to write about it here. So here's how it went, in order:

1) I started small to get my mood set. Deleted some old code that was no longer necessary, and added title bars to all the windows that say something meaningful.

2) Added scrollbars to the telnet windows. You can now scroll up and down to the history command I/O. Not sure how deep it goes, but it's pretty deep.

3) Added what I call the semi-dynamic sizing feature. Tk widgets don't always take kindly to being resized, such as when a user hits the maximized button. The best I can do is allow for user to input desired height and width, in characters, of the telnet windows when creating them.

4) Added a function to disconnect from devices. Because the save and restore scripts contain automated code to connect, do their thing, and disconnect, there can not be any active connections to the devices during that time.

5) Key bindings! I talked about this to the RCOS last Friday. Anytime now there is an 'OK' dialog box, you don't need to physically click the button. (You still can, though!!) Hitting the 'Enter' key on your keyboard accomplishes the same task.

6) Save the best for last. This feature is the breakthrough that sets INMP apart from any other software out there. Without a doubt, the most annoying thing about working with Cisco routers, especially here at RPI, is that router interfaces are shutdown by default. Especially here in the lab, after erasing a previous configuration and loading in your own, you need to physically type 'no shut' at each interface. Well, not any more. When saving configurations through the INMP, it automatically inserts a 'no shut' command into the saved file exactly where it's supposed to be. I.e, only to the interfaces that actually need to have 'no shut' issued to them.

So the software is now at the point where I do not have a problem telling people 'Go download this software and check it out.' I know between Friday and today, a couple people have expressed interest in using it. I will be doing full live testing of it this week in my laboratory work on Tuesday and Thursday, and I hope other Linux users in the Networking classes do so as well.

So overall, I would say the Hackathon was a huge success. Nice too to see that there was a very strong RCOS presence. I know I certainly made tremendous progress and hope the other students did as well. The host, Mike, hinted there may be another one before the end of the semester, I hope it becomes a reality.

Saturday, March 5, 2011

Fix Bugs, Get to Top of Observatory.

But seriously. The two bugs I blogged about on Thursday are mostly fixed. The issue with the same telnet session eating up multiple tabs is completely fixed, and the the program also now exits correctly when choosing File->Exit from the menu, but still doesn't when clicking the x-button.

Look for more detailed blog update after Hackathon tonight.