jacek's blog

OpenBSD Administration Training: Collecting Load Averages with Uptime(1)

uptime(1) is handy to get a quick snapshot of some basic system information and often that’s all you need to decide what to do next, but if you want to get a better view of the load average patterns on your system, you will need to run uptime(1) at regular intervals over a period of a day, or week. Here’s a script that runs uptime(1) at 15-minute intervals for 24 hours. We'll call it uptime-mon.sh.


loopon=1;

loopdelay=900;

loopend=96;

n=0;

while [[ $loopon -eq 1 ]]; do

        if [[ $n -eq $loopend ]]; then

                exit

        fi

        sleep $loopdelay

        uptime

        n=$n+1

done

If you wonder where I got those numbers from, you should know that the ksh(1) sleep command expects that we express the delay in seconds therefore 15 minues translates into 15*60 = 900. And since each hour is made of four 15-minute segments, we have to run uptime(1) 4*24 = 96 times.

Remember that the script shown above will stop as soon as you close the terminal window or log out of the system, so make sure it runs in the background and does not stop after you log out of the system:


$ nohup uptime-mon.sh > 24-hr-uptime &

When you log in the next day, you will be able to monitor the results as the are being written with this command:


$ cat 24-hr-uptime | less

If you have better things to do than babysit uptime(1), you can make your script deliver the results straight to your mailbox when it's done:


$ nohup uptime-mon.sh | mail joe &

The above is a fragment of a longer article to be published next Monday. Subscribe to our Articles list to get the whole thing.

A Great Quote from Winston Churchill

"Success is going from failure to failure without losing enthusiasm."
-- Winston Churchill
(via QuoteDB)

New Article: Who's Doing What?

A refresher on w(1) and who(1). The URL goes out on Monday, Aug 4, 2008. Join the Articles mailing list to get the URL delivered to your mailbox. (The sign-up form is in the column on the left.)

Where devGuide.net's Going

Over the last five years everybody came to associate devGuide.net with OpenBSD, PF, and security. And I want to assure you that we are not going to abandon these subjects.

However, as the time and technology marches forward, I want to explore other forms of teaching and publishing. It's been my long-time dream to use the potential of multimedia. I started experimenting with it back in 1990, when I bought my first Amiga and a primitive video capture interface. I got my first taste of creating animation with Deluxe Paint, 3d graphics with Imagine 3D, and presentations with Scala. I then produced a number of educational titles using HyperCard on a Mac. I had to abandon multimedia production due to my increased interest in UNIX and Open Source, but it's time go back. The test videos I posted to blip.tv should give you an indication as to where I'm going with these experiments.

Does it mean I want to abandon book publishing? No. Books are an excellent knowledge delivery method. They need no batteries or internet connectivity, but as we are increasingly immersed in the internet, it's time to start delivering knowledge straight to your desktop, laptop, PDA, and mobile phone.

I know I'm going to spoil your summer ;-) but the third edition of Building Firewalls with OpenBSD and PF will be much more than a printed book. Same goes for the OpenBSD Gazetteer and our other books.

Vi Tips - 001 PANIC in Ogg/Vorbis (Theora) Format

The Ogg/Vorbis (Theora) version of episode 001 (PANIC) of "vi(1) Tips" is available for purchase for $0.99

vi Tips - 001 PANIC in high quality

As you have no doubt noticed, the quality of our videos on YouTube leaves a lot to be desired. Here's a blip.tv version. Much better, imho.

devGuide.net Training News Mailing List

vi Tips -- 001 PANIC

OpenBSD YouTube Channel Up

We're going to put a lot of our training materials on YouTube and other video sharing sites. This is a test of our OpenBSD YouTube channel.

devGuide.net Training News Mailing List

OpenBSD On-line Training: Evening Classes

There is a lot of interest in OpenBSD on-line training. I am fleshing out a curriculum for on-line evening classes. It will cover OpenBSD system administration, networking, servers and services, and PF (firewalls). If you would like to be informed when we start delivering these courses, sign up here.

Public OpenBSD Training

I prepared a series of 3 public OpenBSD workshops. They will be delivered in London, United Kingdom. You can request another location, provided you book at least 4 seats. Check your calendar and mine and write to sales {at} devguide {dot} net for details.

If you would rather book a private workshop, write us too.