Have you ever been having a good weekend, and you come into work Monday and *boom* — there was a power outage over the weekend. Some services on your servers started, others didn’t. Wouldn’t it be nice to be notified that services aren’t working, and even better if they were automatically fixed??

Enter Monit. Their website describes it best:

Monit can start a process if it does not run, restart a process if it does not respond and stop a process if it uses too much resources. You can use monit to monitor files, directories and devices for changes, such as timestamp changes, checksum changes or size changes. You can also monitor remote hosts; monit can ping a remote host and can check TCP/IP port connections and server protocols. Monit is controlled via an easy to use control file based on a free-format, token-oriented syntax. Monit logs to syslog or to its own log file and notifies you about error conditions and recovery status via customizable alert.

LFT is a zippy alternative to tracreoute, the old standby for pinning down latency and dropped connections. But while traceroute takes 20-30 seconds to determine all the hops in a path, LFT does the job in about a second.

Input

ian@home:~$ lft www.thoughtdeposit.net

Output

Tracing ……………T
TTL LFT trace to 63.76.232.167:80/tcp
1 192.168.0.30 20.2ms
2 37.125.55.1 40.3ms
3 12.161.11.1 20.2ms
4 12.119.243.101 20.1ms
5 gbr2-p30.dtrmi.ip.att.net (12.123.208.62) 20.1ms
6 tbr2-cl18.cgcil.ip.att.net (12.122.10.134) 40.2ms
7 ggr1-p3100.chail.ip.att.net (12.123.4.17) 20.2ms
8 p2-2.ir1.chicago2-il.us.xo.net (206.111.2.121) 20.1ms
9 p5-0-0.rar2.chicago-il.us.xo.net (65.106.6.137) 40.2ms
10 p4-0-0.mar2.marylandheights-mo.us.xo.net (65.106.6.162) 40.2ms
11 p15-0.chr1.marylandheights-mo.us.xo.net (207.88.84.78 ) 40.2ms
12 66.236.121.50.ptr.us.xo.net (66.236.121.50) 40.2ms
13 host162.datotel.com (63.97.187.162) 40.2ms
14 [target] 63.76.232.167:80 40.2ms

Source, Debian package, and OSX Installer are all available.

Link

Technorati Tags: , , , , , , ,

If you need to figure out what a unix program does fast, whatis can tell you.

ian@thoughtdeposit.net:~$ whatis rsync
rsync (1) - faster, flexible replacement for rcp

Whatis simply sucks out the program’s man page description field, and barfs it onto the screen.

Technorati Tags: ,

OSX has a command line port scanner. It’s just super sekrit is all. The questionably named stroke command, is part of Network Utility, which is nestled in your Utilities folder. Normally it’s only exposed through Network Utility’s GUI, but there is a way to get at it from your command prompt.

First, create a link to stroke, preferably somewhere in your $PATH.

ian@mymac:~$ ln /Applications/Utilities/Network\ Utility.app/Contents/Resources/stroke stroke

Next make it executable, if it isn’t already.

ian@mymac:~$ chmod uo+x stroke

Now let’s do a port scan. We will scan the localhost, ports 49152 thru 65535.

ian@mymac:~$ ./stroke 127.0.0.1 49152 65535

Can you install nmap, or even nessus instead? Absolutely. But in an, ehrm, pinch — stroke will do nicely.

Technorati Tags: , , , , , ,

You know you have spent too much time in unix when you use a unix command to remind you it’s time to step away from the terminal, and go feed the dog. Leave does just that.

leave +0115

This will remind you an hour and fifteen minutes from now to leave your command prompt. If you stay put, it will keep pestering you until you go nuts.

(Depending on your distro, leave may not be standard. In Debian, apt-get install leave will get it installed for you)

Getting root access in OSX is a task that stumps a lot of new users. Ideally you shouldn’t need root at all, sudo should be enough. But sometimes you just need root. Here’s how to enable the root user in OSX Tiger.

Enable Root1-2
First, open up NetInfo Manager in the Utilities folder.
Enable Root2-1
Next click the lock to authenticate yourself, you will need to have administrative rights.
Enable Root3
Select Enable Root User from the Security drop-down menu. You may be asked to authenticate yourself once more.
Now that you have enabled the root user, you will probably want to change it’s default password. In most cases the root user’s password is either blank, or the first administrative user for this computer’s password.
Enable Root4
Back in the Security drop-down menu, select Change Root Password
Enable Root5
Enter the previous root password once, the new one twice.
You can now become the root user from the command line by typing su and your new root password.

I’m talking in terms of keystrokes, and you don’t know the PID.

pgrep fooapp | xargs kill - 9

That’s twenty-three characters, including whitespace, excluding the process name. What’s quicker?

This tutorial covers the exact same ground as my previous one, creating a RAID1 Array. But this time it’s command line baby. Aside from impressing your friends and family, knowing how to create a RAID array using the DiskPart command line tool is useful because it allows you to script drive and volume manipulation. This can be a lifesaver for sysadmins.

RAID1 with DiskPart Howto Link

We all like Google, and Google Analytics is a cool tool. But, what happens when you want to run the tool yourself? You could take a look at phpMyVisites. The screenshots look impressive, and the demo illustrates impressive features. One thing I have never fully appreciated about Google Analytics is the fact that it uses Flash, which is still a bit of an annoyance for us Linux users.

phpMyVisites could be a viable supplement.

Here’s my first shot at a howto by way of screencast. This tutorial shows you how to add a mirrored drive array in Windows Server 2003 (and XP).

Again, this is my first stab at this, so have some patience on the technology side. What the heck is the best way to thumbnail a 800×600 movie in a blog post column anyway?

RAID1-Howto Link