ATT SMS Gateways, consistent source short code

At work we get nagios pages via SMS using the @txt.att.net email-SMS gateway. Everyone who receives these pages also happens to have an Iphone. Our setup was fairly annoying because every txt message had a unique sender, so in the event you that you receive a ton of alerts its really hard to clean up afterwards.

Found the solution here. Use @mobile.mycingular.com.

Posted in /dev/random | Leave a comment

Maven tweaks continued…

In a previous post I mentioned using the settings.xml file to force maven to use a local repository. In my case this is Jfrog’s Artifactory.

This was accomplished using the “mirror” element in the settings.xml file (example). While most of our artifacts are downloaded from the “central” repository. Some of them have dependencies that are not part of “central”. This resulted in the build reaching out to other 3rd party sites to download artifacts. This is undesirable for us because we want to have control over all artifacts, and in addition this can also slow down the build or even break it when those sites go down. Which is how we discovered it in the first place.

I banged around on google for a while looking for mailing list posts or examples to force mirroring of all repos to no avail. So on my lunch break today I decided to stop by the book store and pick up the Oreilly Maven Book. A couple of minutes poking around and I found an example that setup a mirror using a wildcard.

Posted in /geek, /sysadmin, /unix, /work | Tagged , , , , , , , , , | Leave a comment

READYNAS NV+ Kernel Out of memory

Decided recently to pick up a Readynas NV+ to supplement our file storage at the office. I have the Readynas Duo at home and have been quite happy with it. It is a linux based NAS appliance and after installing a few add-ons you can have a remote root shell and apt packages to install things like munin and NRPE which happen to be what I use for monitoring.

As with most NAS appliances it supports SMB, AFP and FTP. It also can run an rsync daemon. Or with shell access you can setup cron jobs, run rsync from the shell just like a normal linux box. Other features which I don’t use include support for Apple’s Time Machine, Squeezebox, a web based bittorrent client and a handful of other stuff.

After I set the device up I figured I would burn it in for a couple of days to make sure everything was happy. I had upgraded the RAM from the default 256mb to 1 gig because I had read some benchmarking reports that indicated a noticeable increase in I/O performance. Much to my surprise with little or no activity for a day or two I got message from Nagios that it could not talk to the NRPE instance on the device. It was still responding to pings but all services on the device were horked. I rebooted it and checked the logs to find a bunch of “kernel: out of memory” messages indicating that both RAM and swap were entirely consumed and the kernel was attempting to kill off processes in an attempt to recover:

nas1corp kernel: Out of memory: Killed process 7823 (cron).
nas1corp kernel: Out of memory: Killed process 7824 (sh).
nas1corp kernel: Out of memory: Killed process 7840 (sh).

This seemed to be obviously a memory leak, however after some quick searching and ad-hoc research I found no obvious answers and decided to shelve it for a while.

Today I finally came across this thread where at least a few other people had the same problem. The person reporting the problem was also running the munin client on his Readynas as well.

So it appeared to be a kernel memory leak that in this case was triggered by bash which is used in a bunch of the munin plugins. I just upgraded to the firmware release posted on the mentioned thread and have noticed a huge difference already. I think its great that netgear finally fixed this problem. I also think its great that openness of their product allowed customers to troubleshoot it for them, however I was not all that impressed that it took them almost a year to get the issue resolved.

Posted in /sysadmin, /unix, /work | Tagged , , , , , , | Leave a comment

TemPageR 3E environment monitor

Recently ran into some heat issues in a mini computer room that has a window in direct line of the sun and problematic HVAC. Picked up a network enabled environment monitor so I could have some data to show when trying to get the issues resolved. Originally I was thinking about getting the Websensor EM01B that has been featured on the nagios website for ages and ages. I also investigate getting an APC unit that could plug directly into our UPS. I ended up settling on the AVTECH TemPageR 3E mostly because of price. It was cheaper than most of the options and it came with an external temp probe in addition to the integrated probe.

All in all I am happy with it. I wrote some quick and dirty nagios and munin plugins that monitor the unit via SNMP. The web interface renders data using JSON, so it would be possible to write some plugins that used that as well, but I ran the JSON through a validator after having the ruby json libs blow up, and its not 100% valid so I stuck with SNMP.

I had to contact support and so far the support has been really good. I was noticing that my graphs had gaps in them. I started doing some debugging and found that sometimes SNMP queries of the external temp probe return nothing. I contacted support and they suggested that I check to make sure that the wiring for the external probe does not run near any HVAC gear or other sources of electrical interference. After some rewiring I have managed to escape most of the interference and reduced the amount times SNMP queries for the external probe fail.

munin graph

Here is the shell script munin plugin. I doubt it complies 100 percent with their plugin requirements. Use at your own risk:

#!/bin/bash
GRAPH_TITLE="TITLE"
GRAPH_VLABEL="Degrees Fahrenheit"
S1_LABEL="Integrated Sensor"
S2_LABEL="External Sensor"
COMMUNITY="snmp_com_here"
HOST="1.1.1.1"
SNMPWALK="/usr/bin/snmpwalk"

#provide autoconf to munin
if [ "${1}" == "config" ];then
        echo graph_title ${GRAPH_TITLE}
        echo graph_vlabel ${GRAPH_VLABEL}
        echo sensor1.label ${S1_LABEL}
        echo sensor2.label ${S2_LABEL}
else

        #Get the values via SNMP. They are reported with out the decimal place so we do an ugly sed one liner to clean it up

        VALUE=$(${SNMPWALK} -v1 -c ${COMMUNITY} ${HOST} enterprises.20916.1.7.1.1.1.2.0 | awk '{print $4}'  | sed 's/..$/.&/;t;s/^.$/.0&/')
        echo sensor1.value ${VALUE}

        VALUE=$(${SNMPWALK} -v1 -c ${COMMUNITY} ${HOST} enterprises.20916.1.7.1.2.1.2.0 | awk '{print $4}'  | sed 's/..$/.&/;t;s/^.$/.0&/')
        echo sensor2.value ${VALUE}

fi

Here is the nagios plugin, same disclaimer:

#!/bin/bash
COMMUNITY="snmp_com_here"
HOST="1.1.1.1"
SNMPWALK="/usr/bin/snmpwalk"
WARNING=90
CRITICAL=95

        #Get the values via SNMP. They are reported with out the decimal place so we do an ugly sed one liner to clean it up

        VALUE1=$(${SNMPWALK} -v1 -c ${COMMUNITY} ${HOST} enterprises.20916.1.7.1.1.1.2.0 | awk '{print $4}'  | sed 's/..$/.&/;t;s/^.$/.0&/')

        VALUE2=$(${SNMPWALK} -v1 -c ${COMMUNITY} ${HOST} enterprises.20916.1.7.1.2.1.2.0 | awk '{print $4}'  | sed 's/..$/.&/;t;s/^.$/.0&/')

if [ ${VALUE1} \< ${WARNING} ] && [ ${VALUE2} \< ${WARNING} ];then
        echo "TEMP OK: "${VALUE1} ${VALUE2}
        exit 0

elif [ ${VALUE1} \> ${WARNING} ] || [ ${VALUE2} \> ${WARNING} ]; then

        if [ ${VALUE1} \> ${CRITICAL} ] || [ ${VALUE2} \> ${CRITICAL} ];then
                echo "TEMP CRITICAL: "${VALUE1} ${VALUE2}
                exit 2
        else
                echo "TEMP WARNING: "${VALUE1} ${VALUE2}
                exit 1
        fi

else
        echo "UKNOWN"
        exit 3
fi
Posted in /StupidShellTricks, /geek, /sysadmin, /unix, /work | Leave a comment

Overriding the default maven repository

If you are using maven for builds or dependency management you will notice that by default maven always attempts to pull dependencies from the public maven repository (repo1).

After reading documentation and examples I thought you could easily override this by specifying a local repository in your respective project object model file (pom.xml). Example.

Not the case in my experience. Every attempt to specify a local repository always resulted in the official maven repo being checked first. If the dependency was not available in the public repo it would then check the local repo.

After some reading I found the useful maven command “help:effective-pom” which does what it says. It takes all the information being inherited from other poms and spits out the xml for what is your effective pom.xml file when maven is run. The maven repo is included in maven’s “super pom” which is inherited by all poms. No matter what I tried the repository entry from the super pom is always first in line before all over repos.

The only way I could override this was to use the“mirror” element in the settings.xml file which can reside in either /etc/maven2/ for system wide settings or ~/.m2/ for user settings. This is not ideal for us because we want everyone who checks out this maven project to automatically use our local repo without having to touch config files on their machine. For the linux machines its not a big deal because we can control this file with puppet but its a slight pain for everything else.

Posted in /geek, /sysadmin, /unix, /work | Tagged , , , , | 1 Comment

This RRD was created on other architecture

I use Munin for some graphing of system and application stats. Like most graphing open source projects its based on the widely used RRDTool.

I recently was moving my munin instance from a xen instance on 64bit Ubuntu install, to a bare metal 32bit install. Moving munin consists of the moving the munin.conf file and moving the /var/lib/munin directory. After moving it I noticed graphs weren’t updating as expected and came across this is the munin-update.log:

This RRD was created on other architecture

Not surprising that RRD files are platform specific. Came across this blog post that has a couple of shell scripts to handle this. Since the blog post is in German I will summarize what they do:

1. dump.sh:

This does a find in your /var/lib/munin directory looking for all “.rrd” files. It takes each file and uses the rrdtool “dump” option to dump the information into a corresponding xml file.

2. restore.sh

This takes the xml data and creates a new rrd file from the xml file. Before creating the new rrd file from the xml file it copies the original rrd file to backup file with an extension of “.bak”.

When I did this I copied the munin directory to a 64bit host to run dump.sh since the rrd files were originally created on 64bit host. I then copied the directory back over to the 32bit machine to run the restore.

You can find the scripts on Frank Helmschrott’s blog posting. I will include a slightly modified version here:

dump.sh:

#!/bin/bash
MUNIN_DIR="/var/lib/munin"

for f in `find ${MUNIN_DIR} -name '*.rrd' -print` ;

do
f_xml=`dirname ${f}`/`basename ${f} .rrd`.xml
rrdtool dump "$f" > "${f_xml}"
chown root:0 "${f_xml}"
done

restore.sh:

#!/bin/bash
MUNIN_DIR="/home/kenc/munin"

for f in `find ${MUNIN_DIR} -name '*.xml' -print` ;
do
f_rrd=`dirname ${f}`/`basename ${f} .xml`.rrd
mv -f "${f_rrd}" "${f_rrd}.bak"
chown root:0 "${f_rrd}.bak"
rrdtool restore "$f" "${f_rrd}"
chown munin:munin "${f_rrd}"
done
Posted in /geek, /sysadmin, /unix, /work | Tagged | 2 Comments

Evolution MAPI Plugin on Ubuntu 9.04

Recently upgraded my laptop to the pre release Ubuntu 9.04 ( jaunty jackalope). One of the things I have been looking forward to is the Evolution MAPI plugin that is a result of work done by the Openchange project to implement MAPI stacks on both the client and server side. Evolution has been able to use Outlook Web Access for some time now as a back end, however this breaks when you are using Exchange 2007. So the MAPI plugin is currently the only hope for anyone who wants full email/calendar/GAL access in a open source mail client.

In Jaunty the evolution-mapi package is now available. After installing it a MAPI exchange account type is available. I attempted to setup my account numerous times providing my AD login, domain, password, exchange server fqdn etc… If I provided proper credentials it would seg fault, if I provide improper creds it would just error. It’s already logged as a bug. However if put in the IP address of the exchange server instead of the FQDN everything appears to work. A few people have reported this.

As of now I am able to read my exchange email in Evolution, I have yet to get GAL, Calendar or sending working. But eh progress is good.

Posted in /dev/random, /geek | Tagged | 14 Comments

Uptime

Or lack there of. Blog is back online.

Posted in /dev/random | Leave a comment

Climbing in Nepal

A friend of mine is climbing some previously unclimbed peaks in Nepal.

He has a blog describing their adventure, but the sickest part IMO is this video.

Posted in /dev/random, /friends | Tagged , , , , | 1 Comment

“Do what you love”

*note: the shortcut to the end of this post is to read the essay “How to do what you love” by Paul Graham.

Well almost a year to the date since my last post. I figure I should probably get at least one post on the record for 2008 and if I stay motivated maybe a few more.

Over the past 4 months I have been focusing a lot more on investing. As a result of that I have been reading about well known investors their strategies, successes, and failures. I have found Warren Buffett in particular to be extremely interesting. Buffett in general keeps things simple, he looks for good values with proven earning ability, sticks to stuff that he understands and avoids high risk situations. In this interview with Charlie Rose he quips that he

“is lucky to get paid for doing something he would… pay to do”

.

Over the weekend I spent some time musing about the whole “Do what you love” dilemma. I feel quite fortunate that I discovered a love for technology at a young age and grew up in a time where this combined with some ambition has proven to be a pretty good hand to play. I can’t really imagine how I would be making a living and most importantly if I would be nearly as happy had I been dealt a different hand.
The more I thought about it, the more I wondered “do I really love what I do”? I have never really hated any particular workplace, some I found more satisfaction in, some I like the co-workers better than others. Even when I was worked on a commercial fishing boat in Alaska doing hard labor 16 hours or more a day I was overall pretty content with my decision at that time.

But the point that stuck in mind is that I don’t wake up whistling dixie so excited to jump on the horse and think “I love what I am doing, I never want to do anything else”. At this point I found myself in what is probably not the typical “do what you love” dilemma that most people face. It seems like people have a tendency to try and figure out if they should do what they need to do to survive or if they should say “screw it” and “do what they love”. Take for example a musician or artist who may be working some soul sucking job instead of chasing their life’s passion. In my case I was trying to determine if I love what I do, or if I just feel that way because I haven’t done enough of what I hate. Or maybe there is something that I would *really* love to do, but having never felt that feeling I am assuming because I like what I do that I am doing what I love.

I should probably conclude with some self realization but I have yet to come to any conclusions about my current path :p However I did find some joy in reading an essay by Paul Graham titled How to do what you love.

Posted in /Life, /dev/random, /me, /potpourri | Tagged , , , , , | 2 Comments