I need to learn more C#

Been playing around with it a lot, but come to the conclusion that I need to learn a bit more out of a book, than just using google and Microsoft sites. To be fair not done badly just a few areas I have been working on lately the code is a bit messy and I know there must be a better way to do it. So to help me on my way I have done two things.

Number one. Brought a Kindle, or to be more accurate my wife has got me one, just awaiting its arrival.

Number two. Getting hold of “Headfirst in to C#” and a few other C# books for it.

Hopefully by the end of this week I will have achieved the following in my application.

  1. Added controls to the output form for “Next config” and “Cancel”, Plus a button to copy to clipboard or download to file.
  2. Added the ability to create a single output from multiply lines in the entry form, and ability to chose a single line and out put only that config.
  3. After that I will be adding a header and footer section to the templates, that will all user to enter varibles aht are to be standard to all configs. Things like company information, user name, date, etc.

All simple stuff but just making sure it do it right now so when it comes to updating later it is all nice and clear. All about adding controls at run time at the moment and making sure its done in the most efficient way.

ConfGen update.

Spent quite a bit of time lately with this, the more I get in to C# the more impressed I become, I use to think that C# and .NET where only for people who couldn’t learn C++, but now I see the point. C++ is fun to learn, but it is very involved and I know I would be no where near as far along with this if I had decided to go down that route. OK C# requires the .NET framework to be installed on the client machine, but as for as developing goes it hit a nice sweet-spot, between the simplicity of VB, and the maze of C++. I would definitely suggest any one wanting to develop Window based applications to have a look.

As for ConfGen made a number of changes to the code to add some more functions, but still got lots more to do, see the ConfGen Page above for more details. This really is the middle application in terms of the long term goal. I also want to produce a tool that will build configs from scratch based on users specification, and a final implementation tool to deliver configuration to devices.

Also it looks like soon I should have a bit more time at work so CCNP study will be back in the picture. Thinking maybe to buy a Kindle and get the CCNP Foundation Guide as an Ebook, the hard back is just to heavy to lug around, so having it to hand on the Kindle for any spare time i get would be great.

Anyway back to some more coding now.

DevilWAH

Continuing in to C# and Automation.

So still not had much time to be studying CCNP, but have been getting my hands dirty on C# around the automation of generating configuration for cisco devices.

As mentioned before part of my job is change management which means a lot of repetitive configurations. In the past the tools I have written in VB and Excel have been limited to a single master config, what I decided was needed was a tool that could take a generic config written in notepad or other simple text editor and present the variables to the end user in a friendly form, for them to complete and generate the config.

Confgen

Screen shot of early version of Confgen

This is currently has a simple template loaded for changing the vlan and description of a port and enabling / disabling it. But the application is flexible to be able to take any length or complexly of config you can enter.

There are still lots of things to tidy up,

currently only the first row of variables entered can be parsed in to a complete script, I also want to eventually use a word template to give a professional output for the final script. And have a menu driven system that will look for files in a specified folder at start up and load them ready to be picked by the end user.

However its a start and the core of the application is working. I would say its still very much a Beta version, but am hoping over the coming weeks and months to develop it in to a much more compete tool. A few bugs to resolve and functions to add but I hope it gives people an idea of what i am looking achieveive.

I also have a stage 2 idea to add to this that will make it even mousefulull for new deployments to build up complex configurations, as well as these simple snipits.

If any one wants to try it out the zip file is below, simple extract to a folder and run, file >> open. to open the included example. (you will need .net version 3.5 framwork installed to run it)

Confgen

Please play around and let me know what you think.

Edit: added page to site to keep track of this tool and its development, see above.

DevilWAH

OK back for another shout

Well work still busy, and still struggling to find the time to study for my ROUTE exam. But that does not mean I have been doing nothing.

Work sent me on my ITIL Foundation course last week and please to say I passed, so thats one more string to the bow. I was suprised it was a lot more intresting that I thought, and while it still was in my view ‘common sence’. seeing it all togather with all the termonology, does mean I can now look back on some conversations I have had in the past and make some sence of them. For any one looking to get in to the managed service side of things, or wants a foot in the door for such company, it going to be a good cert to have.

The other thing that has been keeping me away from the CCNP is learning scripting and c#. I have already talked about writing some VB scripts to control Secure CRT. but of course to do this you need CRT installed on the PC in the first place. So taking it one step further I started looking at SecureCRT client pack, this is a instulation, that once installed on a PC, you can then call the functions when programing in any .net language, such as VB.net or C#.net This gives much more control over the application and gives the end user a much cleaner interface to use. However you still need to have the client pack installed and this costs money and the hassle of instulation.

So my next stop was Sharp SSH , this is a free SSH libuary with some simmler funcanality to the SecureCRT function pack (for what I want) and allows eaiser distribution of the final aplication.

So after a few steps, and lots of playing around, I now have the core understanding I need to start creating my vision. So as well as working on my CCNP, looking after my Daugher, and atempting to move house. Not forgetting the extra hours that come from managing at work. I am working on creating an application that will allow you to create a libruay of scripts you wish for CISCO IOS/CATOS devices. Including any pre / post checks you require and how to ack on there out comes, Plus allow you to define any varibles that will change between runs. Then allow you to feed in the varibles at run time (either manualy or via a bulk method), and carry out the work completely automated.

Really this is jsut a project for me to learn some more in depth scripting / programing, but as people who carry out mutiply changes, this can often be a repetive job, so I am hoping once complete I will end up with a tool that is very useful for my current postition.

So if you wondered where I was thats about sums it up. Life is great just very busy, and just waiting to get our house sorted, then I will be setting up a nice quiet area to study and getting stuck right back in to CCNP and getting back in to updating and adding to this blog.

night all

DevilWAH

PS. Oh and Miss Lilith is now walking, from bum shuffling to walking has taken less than 10 days, and not only is she walking but climbing to!! she is very proud to show how she can climb on to the couch, and thinks it is very funny to give Mum and Dad heart attacks by almost falling. But its a great time and wonderful watching her grow. being waved good bye to in the mornings, and greated with a huge smile and laughter when I get home, make life very special at the moment. :)

VB again

Well again its been a while since I posted, and once again I have been sidelined from CISCO studies.

A few weeks back I was asked to audit 1500 ports for a client, so thre was no way I was doing that by hand, I am a manger after all you know ;). But it was a great excuse to great a bit of scripting experience in scripting / programming.

Secure CRT has great scripting support and after a few hours playing around I had a script that can read from an excel spread sheet and carry out a list of checks and record the results.

1500 ports spread over 260 devices = 15 min, compared to the 20hr + I worked out it could have taken by hand including preparing the report.

But this lead me a bit further, what would be nice is a program that you could input any amount of code, where varibles where highlighted like.


conf t
int ***port***
description ***des***
speed ****speed****

along with a spread sheet that contained columns containing the variables, and the program could loop through the rows implementing each line as it goes.

In my job there is the potential of having to implement the same config on multiply devices with different values (ie assign ports to vlans)

So for the last few weeks, VBA, VB script and C# have been taking up my life, its been great fun and while maybe not my CCNP still good skills to have as a network engineer to be able to automate things and increase throughput.

hope to be back soon with more updates…

On and other news…. Lilith was one at the weekend, happy birthday my beautiful little girl, you are and angel and very much loved by me and your mum :) XX

DevilWAH