Custom Weather Notifications with Growl

Last night I download Prowl on my iPhone and setup my growl to work with it. It’s very cool stuff together, i’ve been using growl forever.

Anyway tonight I was reading in this thread in the prowl forum where one poster is using growl notifications for weather. Not just any weather but really local weather. Now if you live in or around a big town, most weather apps are pretty accurate for you area. But when you live out in the sticks like I do, they are only close most of the time.

Anyway tonight I set up this excellent pair of perl scripts as outlined here from IBM: Develop your own weahter maps and alerts. Which is a very cool script that will allow you pinpoint your location. I used Photoshop to create the base map from the layers. Once followed all the instructions, some things are not exactly clear at first, but if your familiar with perl reading the code sorts it all out. I setup the notify scripts to send the messages to growl via the growlnotify command.

Now once that was all setup I created a simply bash script that would delete the old Radar overlay, pull the current Radar overlay needed and run the perl weather scripts. I then stuck that script in my crontab. So if I’m at my computer I get notified and if i’m away from my computer i get a push notification to my phone. Very cool stuff. Of course I could just look outside to see if it is raining 🙂

Getting working under osx

I often work and tweak things to get them going on OSX (not server) and then forget how I did it. Then I’ll end up wiping the machine and have to everything over and spending a ton of time on it. I should have documented getting nagios going properly and ndoutils and nagvis, but i didn’t.

But here is what I did to get the plugin working on OSX. At least part of it any way I crashed and lost some of the notes. check_ndo does exactly what its it checks to make sure that ndoutils is writing to the mysql database as expected and if not alerts you.

One weird thing that it took me lots of poking around with was why the plugin wouldn’t work from the command line. The first problem was that it was using the default perl install and not the perl install from Macports. Also it was looking in the default for linux location for the file not the default for OSX nagios via macports.

Here is how I did it.
First edit the file. $sudo vi /opt/local/libexec/nagios/
change the use lib line to:
use lib “/opt/local/libexec/nagios”;

Next to make things easier i create a command in the commands.cfg
$sudo vi /opt/local/etc/nagios/objects/commands.cfg
I add the following:
# check_ndo
define command{
command_name check_ndo
command_line /opt/local/bin/perl /opt/local/libexec/nagios/ -H $HOSTNAME$ -P 3306 -d $ARG1$ -u $ARG2$ -p $ARG3$ -i $ARG4$ -t 300

Next I added it to my localhost config, but it can be added anywhere:
$sudo vi /opt/local/etc/nagios/objects/localhost.cfg
# Service to check that ndoutils is working
define service{
use generic-service
host_name localhost
service_description NDOUTILS
check_command check_ndo!dbname!dbuser!dbpassword!default!300

Hopefully this will help me remember this in the future and anyone else who tries it.

Nagvis on OSX

I recently replaced the hard drive in my G5 Mac (PPC) and reinstalled the latest version of OSX. Which didn’t solve my problems, but thats a differnt topic.

Anyway I was running Nagios to monitor my home network. I do this for 2 reasons. 1 is that its just a lot of fun and 2 is that I use Nagios at work and like to play around with things at home at night before possibly putting it in production.

I recently decided that I wanted to give NagVis a try. First up was installing Nagios. The last time I did this was from source, but this time I decided to try from MacPorts, since I think it would be much faster. If I remember correctly it took lots of tweaking to get it going on OSX. The MacPorts install went perfectly. Next up was getting NDOutils loaded. This had to be done from source and after a bit of tweaking I got it working great with Nagios. NDOutils is one of the things that need to be in place before Nagvis. Next up were several modules that were needed that are not compiled into the default PHP version that is on OSX. After several hours I got all those compiled and installed. Finally was getting Nagvis going.

Well it works, sorta. The interface does come up and i can do the demo maps, but can’t create my own maps. I get odd errors and they may say something one time and something different the next time. And the apache log files may show different errors as well. No amount of searching and tweaking has gotten it working. I estimate that all together I’ve spent about 10 hours over several nights with no good results. If you have this working on OSX (not server) I would love to know how you did it.

On a side note, while searching for answers online, I actually found that Bing was more helpful than google on a lot of things I was looking for. I know, it doesn’t feel right typing that…

I finally got it all working. Took a lot more tweaking but finally its done.

Local Lifestream with GCalDaemon

I’ve been dreaming of lifestreaming for years. I’ve written various programs in perl and php and who know what else with and without database several times over. I really should have done something cool with it way back before it started popping up all over the place, but I didn’t. Anyway lately I’ve tried out several of the services out there, it seems like a new one every day or so. But what I’ve really wanted was a way to bring it all to my desk top, stored on my desktop for me to have forever I can guarantee that any particular service will be there for ever. So I’ve been looking for a solution and pulling out some old coding ideas. Then today it hit me, where I really want this data is in my calendar program, currently iCal. Then I can always flip back through the years or do a search. Then if any particular service that I use ever goes away, I still have my data.

Today I found the GCALDaemon Project. You can have it convert RSS to iCal format and subscribe to it. I set it up on my mac, super easy and started subscribing to my feeds from various services, I works like a champ. Super easy way to get your lifestream on your local box.

jEdit Tip – Abbreviated Plugin List?

After adding a few more plugins to jEdit, the plugin menu changed from the full list when clicking plugins to an abbreviated list cut into 2 parts. This slowed me down, but I never thought much about it. On the jEdit mailing list somebody posted how to change it:

Globals Options / jEdit / Appearance / Number of Items before menus
spill over..

Very nice, back to normal.