The Problems With Our Weather Alert System

A lot of us can take the loud emergency sirens for granted when they go off to inform us that bad weather is near, but if you live in a small town like my parents you may not have that luxury.  Even in 2012 there are still small towns in the United States that don’t inform their citizens when danger is near.  A lot of these small towns have a siren that can be heard throughout town, but they feel it is better used to inform citizens when it is noon, rather than impending danger.

So what is the solution for these folks?  Well, a weather radio of course! Well, maybe not…  I’ve always been a fan of these little devices that go off whenever there is a watch, warning, or advisory but a lot of folks find them annoying, Especially when they go off at 3 o’clock in the morning to alert them of a Severe Thunderstorm Watch.  In all reality, who is really going to do anything for a tornado or thunderstorm watch.  Personally, I’m going to ignore it. These common annoyances have led some weather radio owners to simply unplug them so that they can get a decent night’s sleep. See the problem?  Although weather radios can be useful in a real emergency, there is a huge probability that they simply desensitize their owners to the point, that they don’t even get plugged in anymore. It would be like working in a building that had the fire alarm going off every 20 minutes.  You might jump up for the first couple alarms, but how many alarms have to go off before you say “screw it” and keep working.

Another issue with the weather radio paradigm is that you must subscribe your radio to a county (or multiple counties).  In places like the state of Iowa, weather warnings are not considered county wide.  They can activated for a portion of a county, however anyone subscribed to that county will receive the alert regardless of where they are located. Once again, causing a surplus of alerts.

So do you see the problems? The first is that there may be no alerting going on and the second is a alarm that is going off so often that folks don’t even want to pay attention anymore.

So what is the solution?  Honestly, I have no idea.

In this day and age, it seems like we should be able to subscribe to alerts for our own cities rather than counties, but it seems it could cause a major technological issue.

A small project that I have been working on, it getting alerts delivered via social media such as twitter and Facebook. I already have a script that runs and pulls data from the Weather Underground API, and then pushes it up to Twitter. The only problem is, I’m not sure that if there is a tornado/thunderstorm warning for a part of my county, if weather underground will post it for all cities within the county.  This would leave us stuck with the over alert issue.

Does anyone else have thoughts on this?

Posted in Personal, Technology | Leave a comment

Member Statements: An Annoyance of Converting to a Different Core Account Processor

A few years ago I was hired at a local credit union right before they were getting ready to convert to a different Core Account Processor.  My primary job at the time was to make sure all of the desktops were up to date so that the new software would work… My role changed a little after the conversion.

Getting the Member Statements from the Old Processor

We probably waited months before we received the statements from the old processor.  The format in which we received them was absolutely grotesque.  There was one file per year.  What I mean is that EVERY member statement for EVERY member for a specific year was in one text file.  These files were about 512 mb which meant that Notepad couldn’t open them, non of our employees could open them. In the beginning I had to install Notepad++ and order more RAM for my computer just so I could retrieve a statement for someone. The old processor had recommended that we pay several hundred dollars for a piece of software that should be able to open these files. That was not going to be an option for us. So it was decided I would use my computer science and python skills to try to parse these statements.

Parsing Those Member Statements

At first glance, using notepad++, these files had nothing that made it obvious when a statement was finished.  Also, important info like member name and account number was not always in the same place on the statement, so capturing that information was incredibly difficult. Since Notepad++ was also chugging trying to open these files, I installed gVim, which is an offshoot of linux’s vim, made for Windows.  gVim was able to see a lot more data in these files and I was able to find something placed in between every statement. At the end of each statement was a hidden escape character. I had something to parse on now!  So I wrote my python script to dump each statement to a file and named it by account number. This process still wasn’t easy. Getting those account numbers was extremely difficult. So I had to write a lot of code to constantly correct for the location of the account number in each statement. I named each statement in the following format, ####MMYYYY.txt where # equals the account number, M = month, and Y = year. Anyways, I was able to get over 1 million statements parsed.

You Have All These Files, Now What?

Once the files were parsed, I tried to make them available to the employees, so I wouldn’t have to constantly take in requests for a statement. So I placed them on our server, which was a big mistake.  Windows had a LOT of troubles trying to display that many files in Explorer.  I tried putting all of the files in folders by year and month, but it didn’t work.  The server would get laggy, people’s desktops would get laggy trying to load all of those files. So my solution?  Build a web app.

The Web Application: Version 1

I felt that IIS and Windows wasn’t going to be a good solution to start this, mainly because getting Windows to do CGI scripts in that past, was kind of a pain. So I found an old desktop and installed Ubuntu Server, Apache2, and Python.  I knew that writing a script to search the file system was going to be incredibly I/O heavy, especially for this desktop machine that was only a P4 and had 1GB of RAM, so I knew MySQL would have to come in to play for this.  So I wrote another Python script to go through all of the statements.  This script recorded each file’s account number, month, year, and file location, then uploaded that information to the database.

So to allow employees access to this information, I wrote a Python CGI script that would allow them to type in a member’s account number and select a year.  Then the script would display all of the available files for that search in a table, with a link to each file.

For security reasons, I setup Apache to authenticate with our Active Directory server, so if someone from outside, somehow managed to connect to our network, they wouldn’t be able to access those files without logging in.

Also, this server WAS NOT accessible from outside the credit union. You SHOULDNT DO THAT UNLESS YOU KNOW WHAT YOURE DOING.

This proved to work fairly well, but I never really liked it, it felt clunky, I didn’t feel it was secure enough, so a year and a half later, I upgraded it.

The Web Application: Version 2

Since the original version of the web application, I had learned more about MySQL and PHP from my computer science classes.  I decided to rewrite the entire application in PHP. This allowed me to add more features to the application, such as the ability for employees to upload more files for members, such as signature cards, etc. Since I already had the database setup, I just had to rewrite the code, to make the application look better, and also switching to PHP caused the application to actually run a lot faster than its Python counterpart.

For authentication, I was able to go away from using Apache’s authentication configuration and wrote the authentication right in the application. The application still authenticates with AD.  Another security feature I was able to add, was logging.  I now keep logs of who accesses what statements, and who fails at logging in (using a wrong password) and who successfully is able to log in. Since I had changed how the application logged in, I had to lock down the directories that stored the statements, so they wouldn’t be accessible from the web.  I had to change how the application provided the statements. The application now would have to read the requested statement and print it to the screen, rather than letting the users’ browser open a text file.

My solution is good for in house, and I would never feel comfortable placing it on the internet.  This is an intranet only solution, and in my opinion, the members statement is completely secure.

If you would like more information, or even my assistance in setting something up like this, feel free to email me at support@rychannel.com.

Posted in Uncategorized | Leave a comment

Enterasys, Python, Graphs, and Nagios?

Probably one of the more difficult things to do when you have an extremely large network, is map out the structure of that network. Especially if you want to monitor the devices on that make up that network.  Why would you need to know the structure of the network if you’re monitoring it? Well, If you’re monitoring 400 switches and 1 of those switches go down, but 125 switches uplinked from that 1 down switch, do you really want 126 notifications that you have down equipment?  I think not.  So what are your options? Well you could just be the ultimate IT Ninja and know exactly how your giant network is setup, you could manually go out and map out what switch uplinks to other switches, or you could turn to a little feature that has been a part of Enterasys’ switches for a long time, but more on that later.

Some Background Stuff About Icinga and Nagios

First of all, Icinga is a fork of the Nagios project. The process of configuring network devices is nearly if not totally identical between the two. In my setup I have each switch configured in its own directory, with its own config file for host, and a file for each service associated with that host. But you can organize the configurations however you would like.

Back to that Enterasys Thing

So, the Enterasys and Old Cabletron equipment have a feature called the Cabletron Discovery Protocol (CDP), not to be confused with the Cisco Discovery Protocol (which may or may not work the same way). Enterasys hasn’t dropped CDP even from their latest K series switches either. I can’t speak too much on how CDP works, so I’m just going to tell you how we’re using it to build our network configuration in Icinga.

Enterasys Netsight Console

From the Netsight Console we are able to load a flexview that displays CDP Neighbor Info.  CDP Neighbor Info, you ask? When you select a set of switches, this flexview will display all of their neighboring switches in a table.  A lot of the Cabletron DP data can be pulled via snmp, but I haven’t had time to write the script to do that just yet. That will be a future project.

Once you have the neighbor switch data you can export the flexview output to a CSV file that will be used by the next phase of this project.

You said something about Python?

Python has been my favorite programming language since I was forced to learn it during my first year of college (Thank You University of Northern Iowa). This first script that I wrote in Python creates a “graph” data structure. If you’re not sure what I’m talking about, click here. The original purpose of this script actually had nothing to do with Icinga, instead it was created to find the farthest end point switches on the network.

Back to the script, The Python Graphs are actually implemented using a Python Dictionary data structure.  Where each switch is its own Key while each key’s value is a python list of the switches neighbors.

For Example,

graph={'a':['b','d','f'],
            'b':['a'],
            'd':['b','a'],
            'f':['a']}

Once the graph is built, a shortest path algorithm is ran on each switch. In our case we find the shortest path from each switch to our core switch. In my opinion, I believe that you should actually find the shortest path to the switch that your icinga/nagios server is connected to, but in our case the icinga vm tends to move between several switches. Anyways, the shortest path algorithm I run, creates a list of lists, where each element in the list is a path. That path is display as a list of switches going to the core. Once that shortest path list is created, I use a nifty feature in Python called Pickle, that lets me dump that data structure to be used by any other scripts.

Quick thing about Pickling

When Pickling a data structure such as a list in Python, Python serializes the data structure and writes it out to a binary file.  This is in NO WAY SECURE.  Anyone who has write access to that file could potentially inject code in to it. However, the nice thing is, when I write another script that needs that same data structure, once I depickle the file, I have instant access to the data structure without having to rebuild the entire list of lists.

Building the Nagios config

This part is pretty straight forward.  Pretty much you write a script that outputs text files of your configuration, but you want your network layout to be part of the configuration.  Icinga & Nagios have a nice little setting that you can set in each device config called parent. That is where you identify who the the switch uplinks to. The best way to figure this out is to loop through that list of shorest paths you created in the previous phase. The important thing to remember is that in each path, there are only 2 switches that are important.  Also, I should mention that the shortest paths that were created have the core switch or whoever you were finding that path to, at the end of each path. Back to the 2 important switches.  The first switch in each path is the switch that you’ll write your configurations for, while the second switch in each path is the parent switch of the first.

So once you have the configurations built, Icinga will know how your network infrastructure is mapped. So if a switch with 20 switches below it go down. Icinga will note in the web interface the 20 other switches are unreachable, but say that the 1 switch went critical and it will only notify you that the one switch went down.

 

If you have any questions or comments, feel free to leave them in the comments below. If you would like to request some code, please email support@rychannel.com.

Posted in Technology | Tagged , , , , , , | Leave a comment

Android vs iOS: A Mini Review Part #1: Using Google Voice

Last Thursday I became eligible to upgrade to a new phone. Since I felt that I had a terrible experience with my Droid X, I decided to go back to iOS, and purchased a 16gb iPhone 4s. Now before we continue, I want you know this isn’t going to be an Android bashing session. I have been finding some things that I am missing from my Android based phone and also been finding things that are handled quite well.  Also, I’ve found a couple things where I thought iOS handled it correctly, but it made an app work not as well.

Hopefully I will be able to frequently add posts regarding the Android vs. iOS battle.  I will note my discoveries, disasters, and whatever I feel like blabbing about.

 

Google Voice

The first app I knew I had to figure out how to get working was Google Voice.  I have a Google Voice number, and a lot of people use that to get a hold of me. Also, I didn’t want to call people using my “real” cell phone number if they have my Voice number.

So in iOS, all operations regarding Google Voice have to be done from within the app. iOS allows push notifications from apps to alert you when something relating to an app occurs. For example, in Google Voice, when you receive a text message or voice mail, the phone will alert you.  But since the app may not actually be running, its state doesn’t get updated with the new message until AFTER you open/reopen it.  Even then, you have to wait a few seconds before the messages will update.  This can be quite annoying if you’re in a text convo with your buddy and you keep leaving the app.

Why iOS is doing this correctly, but its still hinders the app…

A major issue I found in my Droid X was the fact that too many apps would be running in the background, whether I knew they were or not.  In a lot of cases these apps would start ramping up the processor and start consuming my battery’s life at an alarming rate (discharging completely in a couple hours).  While allowing multitasking this way allows info in apps to stay up to date, it means your phone has to constantly process code from them. Ok, so why is iOS doing it right? iOS doesn’t actually keep apps running when you return to the home screen.  It saves the state when you exit so that when you reopen, it “feels” like it stayed open. This keeps the phone from having to worry about running background processes, and you don’t need a third party Task Manager to keep constantly killing processes.

I will admit, with iOS handling “running” apps in this manor, makes Google Voice incredibly annoying to use. But, once the data in the app updates, the app seems to run really well.

Ok, so I have another complaint about the iOS version of Google Voice.  On my android device, I was able to set Google Voice to automatically ask which phone number I want to call from when I used the phone’s built in dialer. So when I would type in the recipients number, or chose a contacts phone number from my address book and hit dial… A popup would appear asking if I wanted to use Google Voice or not. iOS on the other hand doesn’t allow this type of integration. My guess is so Apple doesn’t have to worry about some third party app breaking the dialing process. I’m not sure. So if I want to call anyone with my google voice number, I have to open Google Voice and use it’s dialer… then it will pass the Google Voice exchange number to the iOS dialer.

 

Hopefully you found this somewhat interesting and feel that I am being fair in my assessment. If you have anything that you’d like me to cover, feel free to email me at ryan@rychannel.com or leave a comment below.

Posted in Technology | Tagged , , , | Leave a comment

A Class Not Quite Like Any Other…

Monday was the final time spent in my German II class and my final German course during my college career.  A year ago when I had to sign up for a foreign language course to satisfy the 2 semester requirement at UNI, I was absolutely dreading it.  However, at this point I think it was fate.  I almost didn’t sign up for German. Since I had taken a year of Spanish in High School, I was going to go that route, but online reviews of the professor were less than satisfactory. So I ended up in German I.

This class had been like no other.  We had people from totally different majors with totally different personalities. Most of us spent 5 days a week with each other. The first couple weeks seemed almost dreadful as everyone was learning each other names (in German of course), yet no one could remember my name.  I was feeling isolated from the rest of the class, but that didn’t last long. There was one day when someone started sitting next to me, and I started to feel that I had made a friend. Shortly everyone began coming together. It was almost a strange kind of family and closeness that I had never seen in any other classes. If somebody missed a class, it was most certainly noticed.

In the beginning I think everyone was a little bit shy about speaking out loud as we were fearful that we’d be judged by our peers.  But we realized that we were all in this together and there was no reason to be afraid.

We were very lucky to have the instructors that we did. They new that it was difficult to learn a new language and although they did challenge us, they were easy on us as well.  They cared about whether we understood the material, and made every effort to make sure we understood.

One of the instructors, was a TA from Russia, who taught us twice a week during our practice course.  I still remember the first day he was in front of the class, you could tell he was a little nervous, but he quickly got over it.  Sometimes I feel he learned as much about English as we got to learn about German from him.

When second semester started this fall we had quickly noticed that we had gained a few new classmates while losing a few from the previous semester.  We had even gained a new TA from Georgia (the country, not the state, and no we still had our Russian friend).

At first it seemed almost awkward to have this minor change of classmates and instructors, but they joined our “family” very quickly.

When I woke up Monday morning, I felt a certain sadness. I had been seeing most of these people for 5 days a week for 2 semesters and I wouldn’t be seeing them anymore.

As a final message to my German classmates and instructors: You are a fantastic group of people, and I have felt truly honored to have been able to take this journey with all of you. Although I probably won’t have classes with any of you next semester, I hope to see you all very soon.

Posted in Uncategorized | Leave a comment