Loopback Filter with Truman Boyes

Truman Boyes on Data Centers, Routing, Switching, Consulting, and Traveling.

Browsing Posts in code

Today I checked out the latest OpenBSD tree (4.7-current), built the kernel, built userland, and then checked out the latest ports tree, and started compiling up asterisk 1.6. I should also mention that I tried out the screen replacement that is now included with OpenBSD called tmux. It’s basically a replacement for the command ’screen’, which I find myself using on most unix variants when doing multiple jobs or managing multiple sessions. Of course a great benefit to using screen or tmux is that you can disconnect sessions (ssh/telnet/vty) and pick back up later on your running ttys or sessions.

Some dependencies are building now from the ports tree; I find it interesting how many things are building when all I wanted was a copy of asterisk. So far, I have seen python, sqlite, and with Python comes some dependencies on X11 libs and even printer support. Yikes.

Conference calls today to discuss a new booklet/book I am writing for Juniper. More details later.

currently we have a sublet in Murray Hill, otherwise known as Curry Hill for the plethora of Indian restaurants in the area. In this area you have to try “Curry in a Hurry”, which when we lived here (full time) was a decent dive for combination platters of various north indian cuisine that works well when you are, well, in a hurry. I used to live on 27th and 6th ave which made a quick walk to the East side worth it for the cheap and chipper curry meals. Now that we are back for a bit, I am having a great time enjoying NYC, walking around and taking in the summer sights, smells and sounds.

Tonight we met up with Paul and Kathy at City Crab (19th and Park Ave South) and enjoyed a nice prix fixe dinner that ended up nicely with a key lime pie and a Brooklyn Pilsner.  I was impressed with the Nikon D300 that Paul was snapping up pics with. For the longest I have been hemming and hawing about making a SLR purchase, and the time is about right; now the kicker — will it be the Nikon or Canon and then which models are worth it for a hobbyist that will likely snap about 3000 photos a year, likely a significant number of them all while self-learning the style. It’s hard to say at the moment, as I read through reviews here and there.

Back at the pad now, and hacking away at some JUNOScript automation in SLAX which takes some getting used to, but produces some really useful functionality that network engineers and operators will like. One of the coolest features in JUNOS 8.4+ is that you can use the jnxUtilityMIB to set information into your own MIB with arbitrary (but useful) information which you can then retrieve via SNMP on NMS systems. Why would you want this? Well let’s say for example that you have a very basic network management system (think MRTG graphing) that you want to graph a particular object and Juniper has not yet created a MIB to expose this information to your SNMP poller. Well, you simply write some basic XML parsing in SLAX or XSLT and then call a XML-RPC command that populates the MIB with the necessary value. It’s not as hard as it sounds, and there are even some examples in a Whitepaper entitled, Increasing Network Availability with Automated Scripting. Take a google for it, or even try out Cuil (pronounced Cool) — this looks to be a good start for a competition to Google. Even Clusty looks pretty good.

So why would someone want to choose another search engine at this stage in the game? I mean if you think about it, for the last 5+ years there has been very little reason to use something other than Google. I remember switching to Google back when they were google.stanford.edu, this was an interesting time; we had Yahoo, Altavista, and I think webcrawler although that might have been acquired by Yahoo at that time, and then along came this prototype web search engine that was simple, no banner, and it just worked well. Well the web may have become too big for Google and now with the focus that google has taken on it seems to me that they are moving into more things and search (although they still are the best) is starting to become not as good. This is a moving target of course, because the thing they are trying to perfect is always growing at a rate that they can not control. More CPU / algorithms / etc may not be the deciding factor is the success in future search engines, it may be the function and interface that they create. But complex systems and interfaces that may be better in refining results are usually less friendly to the user, and thus they lose in design. Time will tell

I rarely code in PERL these days; but I wanted to aquire some experience with some flash based graphs that read XML, so I figured that I might as well take some standard text and run it through my perl scripts to generate XML which in turn can be fed into these flash graphs. For a simple test, I am taking pflogsumm.pl, running it and saving the output report to a text file and then parsing specific details in the report to feed into my scripts.

Some relevant sections of the code I was working on …

system("/usr/bin/pflogsumm.pl -u 0 --no_reject_detail -d yesterday /var/log/maillog > email_log.out");

open(EMAIL, "email_log.out");
open(TOP, ">top_out");

undef $/;
while () {
while ( /messages(.*?)Per-Hour/sgm ) {
#print "$1\n";
print TOP "$1";
}
}

close(EMAIL);
close(TOP);

$/ ="\n";
open(TOP, "top_out");
while () {
if ($_ =~ m/[0-9]\s+ received/) {$receivedStr= $_; print "$receivedStr";}
if ($_ =~ m/[0-9]\s+ delivered/) {$deliveredStr= $_; print "$deliveredStr"; }
if ($_ =~ m/[0-9]\s+ forwarded/) {$forwardedStr= $_; print "$forwardedStr";}
}

$receivedStr =~ s/[a-z]+//;
$receivedStr =~ s/^\s+//;
$receivedStr =~ s/\s+$//;
$deliveredStr =~ s/[a-z]+//;
$deliveredStr =~ s/^\s+//;
$deliveredStr =~ s/\s+$//;
$forwardedStr =~ s/[a-z]+//;
$forwardedStr =~ s/^\s+//;
$forwardedStr =~ s/\s+$//;
chomp($receivedStr, $deliveredStr, $forwardedStr);