Archive for category Technology

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?

No Comments

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.

, , , , , ,

No Comments

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.

, , ,

No Comments

Another Year, Another Migration

If you’ve read my blog before, you know that last December I performed the tedious task of moving my website from GoDaddy to Bluehost. Well this year, I’m doing it again.

I haven’t had any issues with Bluehost. In fact having unlimited bandwidth and space for around the same cost as my GoDaddy account and not having to wait 15+ minutes for a settings change was great. But now, I decided that I wanted to do more. I wanted to be able to have full control of a virtual machine that I could do more than just web hosting. A system where I could run test scripts, host dns, host email, and do anything else that I can think of. The best part, it is actually cheaper than than shared hosting through BlueHost.

I had tried another VPS (Virtual Private Server) host in the past, but suffered terrible lag and the worst customer support I had ever encountered. An example of that can be seen here.

I was lucky enough to find a new company out of Chicago that is serving awesome VPS’s at affordable prices. At $4.95/month I am getting 512MB of RAM, 50GB of storage, and 2TB of Dedicated Bandwidth per month. These VPSs all currently run linux, and I have Debian 6 on mine. So what is this company you ask? Binary Computer Solutions. If you are interested in getting a VPSs, help me out and order via this link. https://customer.binarycpu.com/?affid=8.

Ok, so what do you have running on your VPS so far?

  • Apache2 Web Server
  • BIND9 DNS Server
  • Postfix Smtp

My server is acting as the nameserver for Rychannel.com and a couple other sites that I host. It was quite interesting to figure out how to set BIND’s Primary Zones. My Postfix setup acts as a forwarder to another email account not hosted on the server. My Apache2 setup is currently hosting websites for 3 different domains.

Any questions or comments? Leave them in the comment section and I will be sure to respond.

1 Comment

Make Vim more Python friendly…

Here are a few lines for the vimrc file that will make vim a little more Python friendly by providing autoindent.

syntax on
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4

Update: After settings these, I found that copying text in to vim turned out to be a nightmare. So here is how you get around that.
Type:
:set paste
before pasting, and then type
:set nopaste
when you’re done to restore the vimrc settings.

No Comments