Automating your NMS build using Python and Restful APIs Part 2 – Adding Devices though Auto-Discovery

This is the second in a series of posts where I’ll be using a RESTful API to automate a bunch of the initial deployment functions within my NMS. There are a bunch of reasons to do this that are right for the business. Being able to push information gathering onto the customer, being able to use lower-skilled ( and hence lower paid!) resources to do higher level tasks. Being able to be more efficient in your delivery, undercut the competitors on price and over deliver on quality. It’s a really good project to sink my teeth and use some of my growing coding skills to make a difference to the business. 

Other posts in this series

Automating your NMS build using Python and Restful APIs Part 1 – Creating Operators

 

Adding Devices

A Network Management System without devices is a sad, sad thing. It’s just a lonely piece of code with no purpose in life. Empty graphs and arm notifications with nothing to notify. Today we’re going to look at adding devices through launching a basic network range auto discovery. In a follow up post, I’ll be adding device through a CSV import which is my preferred method. 

One thing which I will not be covering in this post to save some time and space is how to authenticate to the NMS system which is covered here

Launching an Autodiscovery

One of the worst things about installing an NMS in a customers environment is the inevitable scope creep that happens. The major reason that this happens is that most customers looking for an NMS are doing so because they really don’t have a clue what’s in their network, and potentially not even how they are configured. They know it’s kinda working most of the time, but not much more than that.

Typically, you have a statement of work to discover N number of devices. The customer says  “I don’t know all the IP addresses, why don’t you just discover this range of IP addresses. So you launch a discovery from your tool and suddenly, you’ve got 2*N devices in your database!  And because they are in your database, you’re now responsible for getting them up and running. Even though your contract is for only N devices, you don’t want to disappoint your customer right? 

There other things that can easily go wrong in an auto discovery as well like

  • Mis-matched SNMP strings: You have the SNMP read, but not the write strings.

This can cause some unpredictable results that are SOOO fun to troubleshoot.  

  • Missing CLI credentials: You have SNMP strings, but not the CLI strings.

There are some things that are only accessible through CLI. It’s great that we’re moving into an era where decent programatic APIs are available devices, but for the mass majority of your infrastructure, there’s a ton of functions which are only available through the good old command line interface.  If you don’t have the right credentials, you’re going to have problems. In my experience, unless they have a centralized authentication system in place, like Cisco ACS, FreeRADIUS or other; you’re probably going to have to troubleshoot half of the device credentials. 

Let’s look at the code. 

First I’ll show the entire function complete, and then we’ll break down the sections individually.  Again, I’ll be skipping the imc_creds() function as it’s covered in the earlier post. 

 import requests, json, sys, time, subprocess, csv, os, ipaddress 

 def plat_auto_discover():

    if auth == None or url == None: # checks to see if the imc credentials are already available
    imc_creds()
    auto_discover_url = '/imcrs/plat/res/autodiscover/start'
    f_url = url + auto_discover_url
    network_address = input(
    '''What is the the network address of the range you wish to discover?\nPlease input the address in the format "192.168.0.0/24": ''')
    # end_address = input('''What is the last address of the network range you wish to discover?\nIPv4 Address: ''')
    try:
        network_address = ipaddress.ip_network(network_address)
    except ValueError:
        print("You have entered an invalid network address. Please try again.")
        time.sleep(2)
        print ('\n'*80)
        plat_auto_discover()
    payload = ''' {
    "mode": "0",
    "ipSection": {
        "begin": "''' + str(network_address[1]) + '''",
        "end": "''' + str(network_address[-2]) + '''"
        },
    "discoverNonSnmpDevice": "true",
    "pingAll": "true"
    }
    '''
    r = requests.post(f_url, data=payload, auth=auth, headers=headers) #creates the URL using the payload variable as the contents
    if r.status_code == 200:
        print ("Auto-Discovery Successfully Started")
    else:
        print ("An Error has occured")

 Gathering the network range

So the first task here is gathering the actual network range that we want to run the auto discover over. For this example, we’ll keep this very basic and use a simple 192.168.0.0/24 network. This is going to cause the system to scan the entire 254 hosts of the subnet.  One of the other things to keep in mind here is that I’m going to use the default system templates for SNMP and Telnet which is why I’m not gathering them here. This isn’t magic, right?

So I’m using the input function to gather the IP address network range that I want to discover. I’m also using the python ipaddress standard library to caste the user input as a network_address to ensure that it’s a valid input to the final function. 

network_address = input(
    ”’What is the the network address of the range you wish to discover?\nPlease input the address in the format “192.168.0.0/24″: ”’)
    # end_address = input(”’What is the last address of the network range you wish to discover?\nIPv4 Address: ”’)
    try:
        network_address = ipaddress.ip_network(network_address)
    except ValueError:
        print(“You have entered an invalid network address. Please try again.”)
        time.sleep(2)
        print (‘\n’*80)
        plat_auto_discover()

So essentially, this code performs three steps

  1. Gathers the desired network address discovery range in the 192.168.0.0/24 format
  2. Attempts to use the ipaddress.ip_network method from the python ipaddress library to test if the user input was valid, and stores it in the  variable network_address
  3. If the ipaddress.ip_network method fails, this will raise an error and re-run the function to gather input in the right format.

The other nice thing about storing the user input as a ipaddress.ip_network object means that we can easily gather the start and end of this subnet based on the subnet math that’s included in the library. I’d always prefer  to have someone/something else do the binary math. 🙂

Creating the JSON Array

This particular API uses a JSON array in the HTTP message body to gather all of the information used to launch the auto-discovery.

payload = ”’

{
    “mode”: “0”,
    “ipSection”: {
        “begin”: “”’ + str(network_address[1]) + ”'”,
        “end”: “”’ + str(network_address[-2]) + ”'”
        },
    “discoverNonSnmpDevice”: “true”,
    “pingAll”: “true”
}
”’

I’m assuming you’re somewhat comfortable with working with strings in python here. The only thing that’s a little funny is the two str(network_address[1]) and str(network_address[-2]) lines.  This is the magic part of the ipaddress library that I mentioned above. These two lines of code do all the binary math for you. For those who aren’t used to subnet math, the first address in any IP network range is actually the network address, so we don’t want the 1, not 0, will be the first valid IP address in the range.  The last address in the range is actually the broadcast address, which is why we use -1 and not -2.  Pretty obvious when you think about it, right?

The network_address object is actually of the ‘ipaddress.IPv4Network’ class, so I’m using the str method to ensure that it’s a valid string when I’m adding joining it to the other text to create the payload. 

You can see from the following print statement that the first and last address in the range are exactly what we expect them to be. 

>>> print (json.dumps(json.loads(payload),indent=4))
{
"pingAll": "true",
"mode": "0",
"discoverNonSnmpDevice": "true",
"ipSection": {
"begin": "192.168.0.1",
"end": "192.168.0.254"
}
}

 

Sending the Request

So the last part of this code is just sending the actual request to the web server and seeing what happens.

 

r = requests.post(f_url, data=payload, auth=auth, headers=headers) #creates the URL using the payload variable as the contents 
    if r.status_code == 200:
        print ("Auto-Discovery Successfully Started")
    else:
        print ("An Error has occured")

 
Using the requests library POST method, we create the HTTP call and include the PAYLOAD that we created above as the data for the message body of this request. 
I’m also evaluating the return of the request here. If the HTTP response code is 200 OK, then everything is good. If it’s anything else, then there’s an issue. As with almost any code on the planet, we could probably do a lot more error handling here, but more my purposes, this is more than ok.
 
 
Do you have better ways of doing anything I’ve got here?  Comments are welcome
 
Advertisements

Automating your NMS build using Python and Restful APIs Part 1 – Creating Operators

It’s a funny world we live in.  Unless you’re hiding under a rock, there’s been a substantial push in the industry over the last few years to move away from the CLI.  As someone right in the middle of this swirling vortex of inefficiency, I’d like to suggest that it’s not so much the CLI that’s the problem, but the fact that each box is handled on an individual basis and that human beings access the API through a keyboard. Not exactly next-generation technology.

 

I’ve been spending lot of time learning python and trying to apply it to my daily tasks. I started looking at the HP IMC Network Management station a few months ago. Mainly as a way to start learning about how I can use python to access RESTFul APIs as well as gain some hands on working with JSON and XML. As an observation, it’s interesting to be that I’m using a CLI ( python ) to configure an NMS ( IMC) that I’m using to avoid using the CLI. ( network devices ).   

I’ve got a project I’m working on to try and automate a bunch of the initial deployment functions within my NMS. There are a bunch of reasons to do this that are right for the business. Being able to push information gathering onto the customer, being able to use lower-skilled ( and hence lower paid!) resources to do higher level tasks. Being able to be more efficient in your delivery, undercut the competitors on price and over deliver on quality. It’s a really good project to sink my teeth and use some of my growing coding skills to make a difference to the business. 

This is the first post in which I’ll discuss and document some of the simple functions I’m developing. I make no claims to be a programmer, or even a coder. But I’m hoping someone can find something here usefull, and possibly get inspired to start sharing whatever small project you’re working on as well. 

 

Without further ado, let’s jump in and look at some code. 

What’s an Operator

Not familiar with HP IMC?  You should be! It’s chock full of goodness and you can get a 60 day free trial here.   In IMC an Operator is someone who has the right to log into the system and perform tasks in the NMS itself.  The reason they use the word operator vs. user is that there’s a full integrated BYOD solution available as an add-on module which treats a user as resource, which of course is not the same thing as an administrator on the system. 

IMC’s got a full RBAC system as well which allows you to assign different privilege levels to your operators, from view only to root-equiv access, as well as splitting up what devices you can perform actions on, as well as segmenting what actions you’re allowed to perform. Pretty powerful stuff once you understand how the pieces go together. 

Adding an Operator in the GUI

 This is a screen capture of the dialog used to add an operator into IMC.  It’s intuitive. You put the username in the username box, you put the password in the password box. Pretty easy right?

If you know what you’re doing and you’re a reasonably good typist, you can add probably add an operator in a minute or less.  

Screen Shot 2015 04 16 at 12 19 17 PM

Where do Operators come from?

Don’t worry. This isn’t a birds and bees conversation.  One of the biggest mistakes that I see when people start into any network management system project, whether that’s Solarwinds, Cisco Prime, What’s up Gold, HP NNMi, or HP IMC, is that they don’t stop to think about what they want/need to do before they start the project.  They typically sit down, start an auto-discovery and then start cleaning up afterwards.  Not exactly the best way to ensure success in your project is it?

When I get involved in a deployment project, I try to make sure I do as much of the information gathering up front. This means I have a bunch of excel spreadsheets that I ask them to fill in before I even arrive onsite. This ensures two things:

  1. I can deliver on what the customer actually wants
  2.  I know when I’m done the project and get to walk away and submit the invoice. 

 

I won’t make any judgement call on which one of those is more important. 

 

 

My Operator Template

My operator template looks like this

NewImage

The values map to the screen shot above exactly as you would expect them to. 

Full name is the full name. Name is the login name, password is the password etc…  

The authType is a little less intuitive, although it is documented in the API docs. The authType maps to the authentication type above which allows you to choose how this specific operator is going to authenticate, through local auth, LDAP, or RADIUS. 

The operator group, which is “1” in my example, maps to the admin operator group which means that I have root-level access on the NMS and can do anything I want. Which is, of course, how it should be, right?

 

The Problem

So I’ve got a CSV file and I know it takes about one minute to create an operator because I can type and I know the system. Why am I automating this? Well, there are a couple of reasons for that.

  • Because I can and I want to gain more python experience
  • Because if I have to add ten operators, this just became ten minutes.
  • Because I already have the CSV file from the customer. Why would I type all this stuff again?
  • Because I can reuse this same format at every customer project I get involved in. 
  • Because I can blame any typos on the customer

Given time, I could add to this list, but let’s just get to the code. 

The Code

Authenticating to the Restful API

Although the auth examples in the eAPI documentation use the standard URLIB HTTP library, I’ve found that the requests library is MUCH more user friendly and easier to work with.

So I first create a couple of global variables called URL and AUTH that I will use to store the credentials.  

 

#url header to preprend on all IMC eAPI calls
url = None

#auth handler for eAPI calls
auth = None 

Now we get to the meat. I think this is pretty obvious, but this function gathers the username and password used to access the eAPI and then tests it out to make sure it’s valid. Once it’s verified as working ( The 200 OK check ). The credentials are then stored in the URL and AUTH global variables for use later on. I’m sure someone could argue that I shouldn’t be using global variables here, but it works for me. :) 
 
def imc_creds():
    ''' This function prompts user for IMC server information and credentuials and stores
    values in url and auth global variables'''
    global url, auth, r
    imc_protocol = input("What protocol would you like to use to connect to the IMC server: \n Press 1 for HTTP: \n Press 2 for HTTPS:")
    if imc_protocol == "1":
        h_url = 'http://'
    else:
        h_url = 'https://'
    imc_server = input("What is the ip address of the IMC server?")
    imc_port = input("What is the port number of the IMC server?")
    imc_user = input("What is the username of the IMC eAPI user?")
    imc_pw = input('''What is the password of the IMC eAPI user?''')
    url = h_url+imc_server+":"+imc_port
    auth = requests.auth.HTTPDigestAuth(imc_user,imc_pw)
    test_url = '/imcrs'
    f_url = url+test_url
    try:
        r = requests.get(f_url, auth=auth, headers=headers)
    except requests.exceptions.RequestException as e: #checks for reqeusts exceptions
        print ("Error:\n"+str(e))
        print ("\n\nThe IMC server address is invalid. Please try again\n\n")
        imc_creds()
    if r.status_code != 200: #checks for valid IMC credentials
        print ("Error: \n You're credentials are invalid. Please try again\n\n")
        imc_creds()
    else:
        print ("You've successfully access the IMC eAPI")
 
 
I”m using this function to gather the credentials of the operator accessing the API. By default when you first install HP IMC, these are admin/admin.    You could ask: Why don’t you just hardcode those into the script? Why bother with writing a function for this? 
Answer: Because I want to reuse this as much as possible and there are lots of things that you can do with the eAPI that you would NOT want just anyone doing. Plus, hardcoding the username and password of the NSM system that controls your entire network is just a bad idea in my books. 
 

Creating the Operators

I used the HP IMC eAPI /plat/operator POST call to as the basis for this call. 

Screen Shot 2015 04 16 at 1 06 21 PM

 

After doing a bit of testing, I arrived at a JSON array which would allow me to create an operator using the “Try it now” button in the API docs.  ( http://IMC_SERVER:PORTNUMBER/imcrs to access the online docs BTW ).

    {
"password": "access4chris",
"fullName": "Christopher Young",
"defaultAcl": "0",
"operatorGroupId": "1",
"name": "cyoung",
"authType": "0",
"sessionTimeout": "10",
"desc": "admin account"
}

Using the Try it now button, you can also see the exact URL that is used to call this API. 

The 201 response below means that it was successfully executed. ( you might want to read up on HTTP codes as it’s not quite THAT simple, but for our purposes, it will work ).

Screen Shot 2015 04 16 at 1 10 46 PM

Now that I’ve got a working JSON array and the URL I need, I’ve got all the pieces I need to put this small function together. 

You can see the first thing I do is check to see if the auth and url variables are still set to None. If they are still None I use the IMC_CREDS function from above to gather them and store them. 

 

I create another variables called headers which stores the headers for the HTTP call. By default, the HP IMC eAPI will respond with XML. After working with XML for a few months, I decided that I prefer JSON. It just seems easier for me to work with.

This piece of code takes the CSV file that we created above and decodes the CSV file into a python dictionary using the column headers as the key and any additional rows as the values. This is really cool in that I can have ten rows, 50 rows, or 100 rows and it doesn’t matter. This script will handle any reasonable number you throw at it. ( I’ve tested up to 20 ).

 

#headers forcing IMC to respond with JSON content. XML content return is the default

headers = {‘Accept’: ‘application/json’, ‘Content-Type’: ‘application/json’,’Accept-encoding’: ‘application/json’}

def create_operator():
    if auth == None or url == None: #checks to see if the imc credentials are already available
        imc_creds()
    create_operator_url = ‘/imcrs/plat/operator’
    f_url = url+create_operator_url
    with open (‘imc_operator_list.csv’) as csvfile: #opens imc_operator_list.csv file
        reader = csv.DictReader(csvfile) #decodes file as csv as a python dictionary
        for operator in reader:
            payload = json.dumps(operator, indent=4) #loads each row of the CSV as a JSON string
            r = requests.post(f_url, data=payload, auth=auth, headers=headers) #creates the URL using the payload variable as the contents
            if r.status_code == 409:
                print (“Operator Already Exists”)
            elif r.status_code == 201:
                print (“Operator Successfully Created”)

 Now you run this code and you’ve suddenly got all the operators in the CSV file imported into your system. 

Doing some non-scientific testing, meaning I counted in Mississippi’s, it took me about 3 seconds to create 10 operators using this method.  

Time isn’t Money

Contrary to the old saying, time isn’t actually money. We can always get more money. There’s lots of ways to do that. Time on the other hand can never be regained. It’s a finite resource and I’d like to spend as much of it as I can on things that I enjoy.  Creating Operators in an NMS doesn’t qualify.

Now, I hand off a CSV file to the customer, make them fill out all the usernames and passwords and then just run the script. they have all the responsibility for the content and all I have to do is a visual on the CSV file to make sure that they didn’t screw anything up.

 

Questions or comments or better ways to do this?  Feel free to post below. I’m always looking to learn.

 

@netmanchris 

 

AirPlay and a Rowing Machine

Like so many other people in the IT field, it’s not the easiest things for me to find time during the day for all the things I want to do.  Life gets busy and priorities happen. As a single father with three kids, this means that it’s tough to find time to get to the gym.

As everyone’s aware, we’re also going through an intense period of change in the networking world where network engineers need ( in my opinion ) to start broadening their skills sets to include coding, DevOps tools, etc.. There are a LOT of resources out there, many of which are available in video format. 

Whether that’s things like the great all-access pass video library from INE, the video content from Coursera classes, or just Youtube, there is a huge amount of content available to us. 

I’ve got two goals major life goals this year; get back in shape, and gain NetOps skills. Makes sense to combine the two. 🙂  

My Problem

One of the biggest problems that I have is that a lot of this material is BORING. It’s dry. There’s not a LOT of content out there yet that directly applies the skills I want to learn to networking. So I end up having to learn how to use python to convert between Celsius and Fahrenheit. (How’s that going to help me in my career? )

It’s tough to stay awake through a lot of this content. Some presenters make the material better than others, but i often find my mind wandering after the first 5 minutes. If I’m not focused, I’m not learning. If I’m not learning, I need to watch the same boring video until I get what I need from it. 

Sounds a bit torturous, doesn’t it? 

My Solution

When I was studying for my CCIE, I actually had the same problem. Cisco Docs are not exactly the most riveting prose the english language has produced, but I had to learn the material. My solution was to combine physical activity with the study process. Hard to fall asleep when you’re working out, right?

I ended up buying a treadmill for my apartment. Looking back, I can’t even begin to imagine the amount of miles that I walked that year. I can also tell you that I was probably in some of the best shape of my life. I would walk and read as long as I could. Then I would stop, do some other physical activity pushups, sit-ups, whatever..  and then go back at it again. For months on end, that’s what I did every night. ( Single with no kids in those days ). 

Interestingly enough, what I found is that I was able to retain more information when I was studying while working out then when I was just hitting the books at the table. I’m sure there’s lots of studies about how the increased blood flow to the brain during physical activity makes learning more effective, but I will leave that to as an exercise in google-fu for the reader to find them. 

Fast forward 10 years, and I don’t have to flip pages anymore. The video revolution means that I can hit at least two of the learning paths, visual and auditory, as well as get a work out in at the same time. Efficient, and productive. 

My solution is built around Apple products, but feel free to substitute in what ever technology gets you to the final goal.  

In a nutshell, the setup looks like this

  • Flat screen TV
  • Apple TV connected to TV
  • Rowing Machine in Front of TV

So basically, I airplay the video content from whatever device I have handy, jump on the rowing machines, and I stay awake through some REALLY boring material while burning some calories.

Other Tricks

For those interested, here are some other tools that make this flow a bit more smoothly

Screenflow  – This application allows me to capture video content with the system audio. Great stuff for making sure you have content offline. 

iFlicks2  – This application allows me to edit the metadata on the videos I create with Screenflow. Most of the time, I end up taking an entire play list worth of content, organizing it as a TV Season and then add the episode numbers to the videos so that they play in order. Very slick and means I don’t have to manually intervene when watching a play list. Not to mention, I can also then sync the material to my devices and review the content when I’m trapped in a plane with no wi-fi. 

 

And You?

Have any productivity/study/health tips that you want to share? Feel free to post in the comments below.

 

@netmanchris

Network Developer: A network engineers Journey into Python

Like most other people in the networking industry, I’ve been struggling with answering the question as to whether or not Network Engineers need to become programmers. It’s not an easy question to answer and after a few years down this SDN journey, I’m still no closer to figuring out whether or not network engineers need to fall into one of the following categories

Become Full-Time Software Developers

DaveTucker

For those of you who don’t know @dave_tucker, he was a talented networking engineer who choose to make the jump to becoming a full time programmer. Working on creating consumption libraries using python for the HP VAN SDN Controller, contributing to the OpenDayLight controller, and now joined up with @networkstatic, another great example. and @MadhuVenugopal   to form SocketPlane focused on the networking stack in Docker. 

Gain some level of proficiency in a modern programming language

One of the people that i think has started to lead in this category is @jedelman8. Jason is a CCIE who glimpsed what the future may hold for some in our profession and has done a great job sharing what he’s been learning on his journey on his blog at http://www.jedelman.com/.  Definitely check it out if you haven’t already. 

This is also where I’ve chosen to be for now. The more I code, I think it’s possible that I could go full programmer, but I also love networking too much. I guess the future will tell with that one. 

For this category, this will mean putting in extra time on nights and weekends to focus on learning the craft.  As someone once told me, it takes about 10 years to become a really good network engineer, no one can be expected to become a good programmer in a year, especially not with a full time day-job. 

On the bright side there are a lot of resources out there like

Coursera.org – Just search for the keyword “python” and there are several good courses that can help you gain the basics of this language.

CodeAcademy.com – CodeAcademy has a focused python track that will allow you to get some guided hands on labs as long as you have an internet connection.

 pynet.twb-tech.com – @kirkbyers has put together an email led python course specifically for network engineers over at   He’s also got some great blogs  that discuss how to use python for different functions that are specifically related to network engineers day-to-day jobs. Having something relevant always helps to make you’re live easier. 

Gain the ability to think programmatically and articulate this in terms software developers understand

I don’t have any really good examples of this particular category.  For some reason, that has so far eluded me, there just isn’t many network engineers in this category. If you know of any great examples, please comment below and I’ll be happy to update the post!

This is where I was a coupe of years ago. I knew logic. I could follow simplistic code if it was already written, and I could do a good enough job communicating to my programming friends enough to ensure that the bottle of tequila I was bribing them with would most likely result in something like what I had in my head. 

 

Stay right where they are today. 

The star fish is one of the few creatures in the history of evolution that went “ Hmmm. I think I’m good! “   This isn’t a judgement, but you need to decide where you want to be and if Star Fish is it… you might find your future career prospects limited. 

starfish

 

 

Journey Ahead

 

As I get back into actually posting, I’m planning on sharing some of the simplistic code that I’ve been able to cobble together. I make no claims as to how good this code is, but I hope that it will inspire some one else reading this to take some classes, find a project, and then write and share some small script or program that makes their life just a little bit easier. Guys like Jason have done this for me. I recently hit a place where I finally have enough skills to be able to accomplish some of the the goals I had in mind. My code is crap, but it’s so simplistic that it’s easy to understand exactly what I’m doing.  And that’s where I think the value comes from sharing right now.

 

Comments or thoughts? Please feel free to comment below!

 

 

ADHD – Tools that keep me sane

So month ago, I wrote this first piece on ADHD and got an amazing amount of feedback. I also promised that I would put together a list of the tools that I use to help work with my predispositions rather than against them. ( I refuse to use the word handicap ).

So I started writing this piece, and then I got distracted. ( No surprises here, right? )

UPDATE: By Request, Here’s a quick video that goes through the actual workflow of how I use these three tools together.

An introduction to OPML

So the real unifier for everything I do is a little technology called OPML.   When you break it down, t’s just a specific kind of XML, which at the end of the day makes it plain text with some headers.

The Flow

As anyone who’s blessed with ADHD can tell you, it’s all about the flow. Not to get to philosophical, but for me, the biggest part of taking advantage of my ADHD is really about learning how to massage and direct the distractions into productivity. There’s no point in trying to stop water when it’s flowing down hill, but you can nudge it, direct it, and get it to go where you want by working with it. OPML allows me to do that.

In my previous role as a pre-sales engineer, and now as a technical marketing engineer, I have to do a LOT of presentations. Sometimes I’m presenting my own content. Sometimes I’m presenting others content. And now, I’m creating content for others to present. In the new role, I also find myself having to create a lot of documents. For me, the process is all about putting together the framework for the piece of content that I’m working on.  Once I’ve got that down, it’s actually pretty easy to just fill out the sections as you’ll see below.

My workflow

There are a lot of APPs that allow the import and export of OPML. The ones below are just the ones that I’ve really attached myself to. They might not be perfect for everyone, but they do work for me. If there’s interest in this ( comment below please! ) I can expand more on any of these tools. To be honest, I probably scratch the surface of the functionality in each of them. But I think that’s actually what I like the most about this combination.

They are easy to use.

The tools help me get my ideas out.

They don’t get in the way of it. 

My work flow basically falls into the following

  • Capture the idea
  • Create the structure
  • Finish the content

I purposely didn’t order these as a numbered list because sometimes it just doesn’t work out as a linear process. On some projects, I’m handed someone else’s content and I end up having to edit or rebuild it. The beauty about the process for me is that I can jump in the water anywhere I want and still end up where I want to be.

Capture the ideas

MindNode

MindNode is a mind-mapping software. For a long time, I heard about mind-mapping, but I really didn’t see how, or why I could use it.  It always felt to me like there wasn’t really a point in just putting things on  (digital) paper. I’m in networking, so I have a VERY vidid imaginary world in my head. And if it’s clear in my head. Why put it on paper right?

So why the mind-map?

Because it gets all the ideas and sections out and let’s you start manipulating them. Turning them this way and that, and replacing them wherever it makes sense.

This chaos is actually how my brain processes normally. (I know – It’s kind of a scary place, right?)  What I’ve found is that by simply putting all the information together on one place, I get to start using my visual processing skills and I start to use the ADHD superhuman ability to make intuitive jumps and I start to understand the relationships between all the items on the page.

And often, they are not what I would have thought when I had the picture in my mind. This is the coolest part. It’s funny how much you can see that you didn’t see when you use your mind’s eye.

The other thing that’ super cool about MindNode for me is that it’s available both for iOS and OSX – Complete with iCloud sync’ing capabilities. This means that I can work where I want, with whatever device I happen to have in front of me.

If I could ask for one more thing ( and I did ask the developer for this! ) it would be for the iOS version to have the ability to create hyperlinks on the nodes. This is invaluable for me on the OSX version as I can link out to other pieces of content that I want to use as reference or source material for whatever it is that I’m working on.

Oh well. Life can’t be perfect, right?

Once I’ve got everything in MindNode and all the chaos is on paper, it’s time to start pulling some structure out of the void.  So at this point, I export from MindNode into OPML format and I’m good to move to the next step.

Screen Shot 2013 06 01 at 4 53 35 PM

Create the structure

Outliner

Outliner is, as the name suggests, an outlining software. As opposed to MindNode which is sometimes just random semi-connected thoughts splattered on a page, Outliner forces me to work in a linear format. But not completely linear. 🙂

What I love about Outliner is it allows me to take entire sections, or nodes and their sub-nodes, and allows me to drag and drop it wherever I feel it belongs in the outline. I found this software about 3 years ago and I can tell you that my presentations instantly became better. By breaking out of powerpoint and just looking at the raw outline, I was able to see that there was often breaks in the flow of the presentation that were negatively affecting the audience’s ability to consume the message I was there to give.

A story is a series of connected events, but if you tell it in the wrong order, it doesn’t make sense as the audience doesn’t have the right background information to understand where you are in timeline. A presentation is the same way.

I can’t tell you the number of times that I grabbed a presentation that someone else created and then used outliner to make it flow in a much more logical sense.

So taking the OPML version of the mind map I created in MindNode above, I can now import it directly into Outliner and start to drag and drop the nodes around until the logical flow makes sense in terms of the content I’m creating.  You can also add notes, not to mention hyperlinks, etc.. in here which is a nice touch.

Screen Shot 2013 06 01 at 5 42 59 PM

Outliner is available only as an iOS application. But they have also provided a web app to be able to access your projects from a “real” computer.   I have to admit, it would be nice to have a “full” OSX application for the downtime when I’m on a plane, but to be honest, the iPad version is really nice and been able to use the touch interface to drag and drop the nodes on the outline around is actually a big deal for me.

Having ADHD means that anything that lets me keep moving is a good thing.  I can’t tell you the number of passengers who sat beside me that were very glad my fingers were flying around my iPad rather than my foot tapping the entire flight. They should all really be sending CarbonFin a donation I think.

Once I’ve got the the outline to the point where I’m happy with it, I export back into OPML again and then… on to the next step. The actual document creation.

Finish the content

Powerpoint

Honestly at this point, I just start building based on the outline. There is a way to export the outline into word somehow, but I’ve never found it difficult enough to worry about it. If I had to reverse engineer the outline. I usually put the slide number in the node header and then just drag and drop whole sections around. Perhaps a little manual, but it works for me.

Scrivener

Scrivener is something I discovered just a few weeks ago and, although I’m still learning the in’s and out’s of the tool, it’s really amazing so far. It’s got SOOOO many possibilities for me that it’s now fully integrated into my workflow. Again, OPML is the key that makes this all work together.

Scrivener is really intended to be for writing long form documents, and it seems that it’s probably more aimed at writing novels and such. But I find it great for writing technical documentation. Most technical documents are split into sections anyways.  If you are working on a documenting a solution, the ability to split everything into individual sections is invaluable.

Imagine writing a document on a user access control solution?  You have at least the following sections

  • Windows Active Directory Integration
  • RADIUS Configuration
  • Policy Configuration
  • Device Configuration ( and each device type could have it’s own specific configuration)
  • dot1x supplicant configuration
Instead of writing a single monolithic tome, why not write small manageable chunks. Or document-lets as I’ve taken to calling them.

Screen Shot 2013 06 02 at 10 01 01 PM

Scrivener: The Pros

There’s a few features that I really like about scrivener

  • Drag and drop sections – scrivener allows you to treat a document more like a file system. You can put sections of the document in a folder. You can split the section into mini pieces which can be completed one by one. You can also move the sections, or individual pieces around if you decide that they don’t belong in the order you want them to anymore.
  • Research Section – At the bottom of every scrivener project, there’s a reference section. This is a place where you can import all sorts of things. Like PDFs, other documents, etc.. I also find this a very useful place to keep pieces of text that I’m going to reuse over a longer period of time.  The nice thing is any document can be converted into a scrivener template, along with all the reference material. So if you find yourself, like me, having to reuse pieces of material repeatedly, this is a really nice touch.
  • Import – Scrivener allows you to import from a lot of different sources. OPML (obviously!), but also word, pdf, etc.  If it’s OPML, then the folders and document-lets are automatically created for you. If it’s word, you can just click on a place in the document and then split the document where your cursor lies. This makes it very easy to grab an existing document and quickly reverse engineer the outline. Then I can export into OPML and move back to step 2 to see if the outline even makes sense. If it doesn’t, I can drag and drop the document-lets around into what makes more sense for me.
  • Export – Scrivener allows you to export into a TON of different formats. From classics like Microsoft Word or RTF, to MultiMarkdown, or even directly to ePUB or kindle. The ability to export to all these different formats is going to be really really useful in my current role. I can’t tell you how easy it was to create a ePUB version of the document I was working on and see it minutes later on my iPad. Very cool.
  • Export – The export is so powerful it requires two mentions. Remember the different folders and individual mini pieces I mentioned above? During the export, there are a TON of options, many of which I haven’t begin to explore yet. But one of the great ones is the ability to select only the folder or mini document-lets that I want and export only those.  This is really cool in that it let’s me produce three or four different pieces of material out of the same base-content. No crazy editing, cutting and pasting around between different Microsoft word documents for me anymore. And the fact that I can export the same way into MultiMarkdown means that I can then apply the style anyway I want.

Scrivener: The Cons

Now scrivener isn’t perfect. Here’s the short list of the issues that I have with it so far. Obviously, there’s nothing here that breaks it for me, but it is some things that you are going to have to deal with if you join me on this path.

  • Table of Contents: The application needs a TON of work on the table of contents functionality. It might be there somewhere, but it’s no intuitive. I also searched the forums, which are very well monitored by experts BTW, and it also seemed to be a point of contention for others.
  • Export: The export is awesome. But the one thing which it doesn’t do is export the style. I’m not talking about the fonts and the colours. That’s all great. I’m talking about the document metadata that classifies different text as a Title, heading 1, heading 2, heading 3, body, etc.  You know, the stuff that word uses to make the auto table of contents?  The nice thing is that there’s a fairly easy way to deal with this as long as you keep your formatting consistent throughout your work.

Final thoughts

There’s a lot of people in the world who are struggling to fight their ADHD. Like many people out there, I struggled for years before I was diagnosed. My report cards read like a page out of a Psychiatric Diagnostics book. Can’t sit still. Easily Distracted. Distracts others. Lack of Focus. Talks to much. Constant outburst in class. I had a lot of anger and I definitely had adrenaline addiction issues. Then I was faced with a diagnosis of ADHD and I made a decision to learn as much as I could about the condition. It’s not a disease. It’s not a issue, or problem. It’s just a different way of being.

Like almost everything in life, there’s a good side and a bad side. In my reading, I found a lot of examples of people who not only got by, but excelled BECAUSE of their ADHD, it was just a matter of finding the right perspective, and then creating a framework that allows us to mitigate our weaknesses, and that applies force multipliers to our strengths.  The work flow that I’ve put into place does just that for me.

I tried for years to get organized like everyone else. It didn’t work. Now, I use what works for me. I found a process that works with my flow, and not against it. And that’s a good thing.

@netmanchris

Functioning with ADHD in an IT world

So I’ve got a reputation of been a productive guy. I’ve heard through the grape vine that some of the people in my company think I don’t sleep. I work constantly. I have no life. It’s funny the things that are said out there.

So in an effort to dispel the myths, and to possibly inspire others, I’m going to dish out some of my secrets.

 I’m ADHD.

I suspect that a lot of IT Professionals can relate to a lot of the ADHD traits. In fact, I think that our industry attracts a lot of AD/H/D’res because of this industries requirement for a fractured attention span and the ability to shift focus on the fly.  I’m sure we can all relate to the ” I’m in the middle of working on this OSPF problem and I’ve got the solution right now, just let me write this down… where is that pen… hmm… what was I saying again… … Squirrel!”

MP900426639

One of the common misconceptions about ADD is that people with it are unable to concentrate. The truth is, that the pendulum swings both ways. We can be hyper or hypo attentive. In plain english, we are either unable to focus at all, or unable to shift focus.  In our industry, the ability to sustain high focus for long periods of time can be a blessing when trying to troubleshoot a difficult problem. As well, the ability to shift focus on a dime and concentrate for short bursts on a new problem is also extremely useful when you are in a firefight and things are coming at you from all sides.

It’s sad to me how our school systems and parents today treat ADD as a disease that needs to be “treated” with medication. Especially when this is the very “disability” that I attribute a large part of my success to.

How do I use ADHD to my advantage?

Living with ADHD does require putting some tools, habits, and processes in place so that you don’t fall into the traps.  Like so many things in life, I think that most important part is just accepting it for what it is.  I don’t fight how I am, I flow with it.

Don’t fight the days when I can’t concentrate.

Please don’t tell my boss this, but there are some days that I’m sure I don’t get anything done at all. These are the days when I just can’t focus on anything no matter what I do. They happen. So what do I do? I water my social networks and I catch up on podcasts.

What do I mean by this? I pick up the phone and I call people I haven’t talked to in awhile. I tweet. I blog. I log into linked in and see if there are any suggestions for contacts who are not in my network. I call people I talk to all the time and argue over frame types, whether or not programatic nms’s qualify as SDN, whether or not VxLAN are complimentary or in competition. Whether or not network professionals will have a place in the world in 5 years. We argue about anything and everything. I ask about their families.

You get the picture. Basically. I pick up the phone and reach out and touch the people who have helped me grow professionally, intellectually, and emotionally over the years.

This might seem like I’m wasting time, but I promise you that when I have a problem that’s outside of my areas of expertise. I know who’s working in what areas, who’s got what special skills and who I can leverage for help.  I know who I can call just to bounce a crazy idea of off, and most importantly, I get into an environment where I’m supposed to shift from one subject to another which helps me feel sane on a day when I just can’t stay focused.

On these days, I’ve been known to go to the gym. Go for walks and catch up on industry news and technical content. Whether this is the packet pushers podcasts, something from iTunes U, the audio tracks from the http://www.INE.com CCIE written videos that I ripped. ( Yes… I paid for them! ), or sometimes even just pulling up the Khan Academy app and learning how to calculate net present value. Anything is up for grabs and I just go with what I’m inspired with on that particular day. Sometimes, I just unplug from tech and  listen to an audiobook ( currently game of thrones A storm of swords ) and let something that’s been causing me trouble muddle around in my head.  You would be surprised how often I come up with a solution by the time I get back from my walk.

I’ve found that on these kinds of days, I am usually the most creative. Ironically, these are also the days when I am totally unable to act on that creativity.

So I write things down. I used to use post-its, but I have recently switched to mostly electronic formats. I would love to say I’ve settled on one tool, but to be honest, I use apples notes app ( nice that I can synch these to outlook, to my Mac, or to my iPad/iPhone combo. ). I use Evernote, and occasionally, I still use post its.

admission of guilt: I would love to say it’s because I’m getting more ecologicaly aware, but to be honest, it’s because I kept losing the post its. 

Make Hay while the Sunshines

When I have one of those days that I am hyper focused. I work. hard. non-stop. through lunch. I produce documentation. I lab up problems that I’m having issues with, and I keep at it until I get it done. Sometimes my wife has to come into my office at 6:00pm to let me know that I missed dinner because I’m so focused.

On these kinds I open up my notes, I pick whatever is the most pressing, or often just what I feel like doing that day, and I do it. Until it’s done. no matter how late.

The other thing I do is to look at my upcoming project work and see if there’s anything I can prepare in advance. Many people with ADHD are habitual procrastinators. One of the best things I’ve had to learn how to do is to become aware of my ADHD mood and to tackle things which are not due for a couple of weeks far in advance.

This is tough. It’s really tough. But I’ve found that when I’m hyper-focused, all I have to do is to jump in and after 5 minutes or so, I don’t have worry about it anymore. My ADHD takes over and I get the task finished.

Finding your Balance

ADHD is just a different way of thinking. It’s funny to me that people have focused so much on suppressing the symptoms when they should be focused more on simply ridding the waves.  To be honest, I usually go through waves where I will be either hyper-focused, or hypo-focused for about a week at a time. So it actually works out pretty well.

Sometimes, I end up with a project deadline when I’m in a hypo-focused cycle and I’ll admit, it’s tough. But life is tough and I don’t believe in using the “I’m sorry I have a disability” is an excuse for not getting your job done. The trick is just pushing through, planning ahead and finding ways to use your ADHD to your advantage.

Tools

I think I’ll save the tools subject for a future post. There are quite a few things I’ve put in place as far as software utilities, processes, etc.. to try and work with my ADHD instead of against it. Hopefully, sharing some of my coping mechanisms might help to inspire someone else.

Final Thoughts

To me, ADHD is like so many other things in life. It is a blessing or a curse. Which one it is to you depends completely on how you perceive it and how you react to it.