Archive for November, 2009

Fun with graphs

Posted in Uncategorized on November 30th, 2009 by Nick – Be the first to comment

I’ve always been utterly fascinated with graph theory, mostly with its applications to networks. As an added bonus, they can be represented with pretty pictures!

Nucor-Yamato Network

(click on image for full-sized version)

That graph represents the network behind Nucor-Yamato Steel and Nucor Castrip Arkansas, sanitized of sensitive information of course. All of the nodes are Cisco switches, the yellow boxes representing backbone switches (6500 series to be exact). This graph is part of the network information system that I’ve been working on during the majority of my internship at NYS and gets auto-generated every day, along with more centralized graphs on a per-switch basis.

The way the system works is that a periodic Python script goes out to a list of known switches and gathers CDP neighbor information as well as the MAC address tables. Then Nmap scans are ran every 6 hours to scan for hosts, gathering IP addresses, hostnames, and MAC addresses. These MAC addresses are correlated with the MAC tables from the switches to determine which hosts are connected to which ports on what switches. The CDP neighbor information also gives which switches are connected to each other, giving a full scope of how the network’s connected.

The script which generates the graphs grabs all of that information out of the database, uses NetworkX and pydot to create the graph, and then graphviz to render it into a PNG image. The graph is pretty plain, though. The real version shows switch names and IP addresses. Since the time between graph generation is so long, any more useful information that I could throw onto the graph would quickly become outdated. My grand scheme is to make a quickly-updated graph showing live stats like switch load, link load, link types (fiber, twisted pair, wireless), downed switches, etc. That way, I (or the network supervisor, I guess…) could have a big-screen TV displaying the live health of the network.

I’ve been asked what parameters I set to get that graph to look that way. I didn’t set anything special in code, it’s all in the command line:

twopi -q -Ksfdp  -Tpng -Goverlap="prism" -Eoverlap="prism" -Gsplines="true" -Gratio="compress"  -oclean.png clean.dot

Really, I’m just a data visualization nerd looking to get a fix.

Doing it right

Posted in Uncategorized on November 26th, 2009 by Nick – Be the first to comment

Well, I finally bit the bullet and got a Linode account. So far I’m pretty happy with it. I figured that with the costs of power and bandwidth, I was almost spending $20/month to run my old server on my own hardware. Incidentally, the lowest-grade Linode VM costs that much and is enough to suit my needs.

So now that I’ve been setting up a webserver from scratch again, I’m doing it right this time. I’m setting up some monitoring software to notify me when things go down, I’m no longer relying on myself for DNS (no more dynamic IPs!), and I’m also branching out and trying an alternative webserver.

The webserver in question is Cherokee which claims to use less memory and perform better than Apache. It sure does use less memory, but as a down side it doesn’t have a native PHP module, so I’m required to use FastCGI for that purpose. Right now, there’s five php-cgi processes running each using about 25-30 MB. This wouldn’t be a problem except that I’ve only got 360 MB of memory to play with. On the plus side its got a pretty sweet admin interface with wizards to help you set up things like WordPress, Drupal, Ruby on Rails, Django, etc. and you can setup some pretty complex rules for what and how files should be hosted.

On the monitoring side of things, I’m using Munin to monitor the various stats on the server, Piwik for website visit statistics, and I plan on getting Monit going for service monitoring. It’s a bit more important now that I keep and eye on memory and data transfer now that I’m limited on that. Also, if some process goes wild and starts using crazy amounts of CPU power and memory, I’ll be able to catch it.

Unfortunately when you move servers, you have to move everything that was running on them. I’m still in that process, but it’s been going pretty smoothly.

New music, or at least new to me

Posted in Uncategorized on November 23rd, 2009 by Nick – Be the first to comment

I haven’t really been researching new music in quite a while, which is something I miss from being out on co-op and away from my beloved KMNR. I’ve started to turn my laziness around and I’ve found some really awesome stuff which I’d like to share. Keep in mind that I’m probably behind the times a little bit here, but if you haven’t listened to some of this stuff, I HIGHLY recommend it.

Just as a side note: I totally want to make some stepper motors or a tesla coil play Waters of Nazareth by Justice. The song just has that sound to it.