
Monday, December 17, 2007
Sunday, December 16, 2007
MRTG for SQUID
MRTG for SQUID gives you a detail idea of what is happening behind the scene. In this tutorial I'll make sure that you will successfully set up one like below.

First thing is to make sure that you have given --enable-snmp option while compiling your squid. If you have not done so then its time to do so. Compile your squid with --enable-snmp and then 'make clean', 'make', and 'make install'
Edit you squid.conf file so that
snmp_port 3401
acl snmppublic snmp_community public
snmp_access allow snmppublic localhost
snmp_access deny all
The first line defines the port SNMP is listening on squid.
Second line defines public as the community string or lets say password.
Third line defines that from localhost snmp query can be made to squid.
Fourth line denies query from all.(except localhost)
Now you need a web server to serve the graphs.
Download apache from http://www.reverse.net/pub/apache/httpd/httpd-2.2.6.tar.bz2
mv ./httpd-2.2.6.tar.bz2 /usr/local/src
cd /usr/local/src
bunzip2 -c /usr/local/src/httpd-2.2.6.tar.bz2 | tar xvf -
rm httpd-2.2.6.tar.bz2
mv httpd-* httpd
cd httpd
./configure --enable-prefix=/usr/local/httpd
make
make install
Now you need to configure apache. Lets just host it in a simple way.
mkdir -p /usr/local/www/mrtg
vi /us/local/httpd/conf/httpd.conf
Change DocumentRoot to "/usr/local/www/mrtg"
save and exit
run /usr/local/httpd/bin/apachectl -k start
Now its time for setting MRTG server. Download the following programs:
http://www.gzip.org/zlib (gzip
http://www.libpng.org/pub/png/libpng.html (libpng)
http://www.libgd.org/ (gd)
http://oss.oetiker.ch/mrtg/pub (mrtg)
Copy zlib to /usr/local/src
gunzip -c zlib-*.tar.gz | tar xvf -
rm zlib-*.tar.gz
mv zlib-* zlib
cd zlib
./configure
make
cd ..
Copy libppng to /usr/local/src
gunzip -c libpng-*.tar.gz |tar xvf -
rm libpng-*.tar.gz
mv libpng-* libpng
cd libpng
make -f scripts/makefile.std CC=gcc ZLIBLIB=../zlib ZLIBINC=../zlib
rm *.so.* *.so
cd ..
The \ in the following line means that they are same line.
Copy gd to /usr/local/src
gunzip -c gd-2.0.11.tar.gz |tar xf -
mv gd-2.0.11 gd
cd gd
env CPPFLAGS="-I../zlib -I../libpng" LDFLAGS="-L../zlib -L../libpng" \
./configure --disable-shared --without-freetype --without-jpeg
make
cp .libs/* .
cd ..
Copy mrtg to /usr/local/src
gunzip -c mrtg-2.15.2.tar.gz | tar xvf -
cd mrtg-2.15.2
./configure --prefix=/usr/local/mrtg-2 \
--with-gd=/usr/local/src/gd \
--with-z=/usr/local/src/zlib \
--with-png=/usr/local/src/libpng
make
make install
mkdir -p /usr/localmrtg-2/cfg
Now lets make graph for squid.
Download the following two files
mrtg-squid.cfg
squid.mib
Copy them to /usr/local/mrtg-2/cfg/
edit mrtg-squid.cfg and do as the file says. Put working dir as /var/www/mrtg
Lets make graph
/usr/local/mrtg-2/bin/mrtg /usr/local/mrtg-2/cfg/mrtg-squid.cfg
Run this for three times. Its OK for now to see few errors.
Lets make index page
/usr/locl/mrtg-2/bin/indexmaker --title="OSR" --show=day --section=title --output=/var/www/mrtg/index.html /usr/local/mrtg-2/cfg/mrtg-squid.cfg
Fire your browser and you should see the graph
For continous monitoring
crontab -e
*/5 * * * * /usr/local/mrtg-2/bin/mrtg /usr/local/mrtg-2/cfg/mrtg-squid.cfg --logging=/var/log/mrtg.log
Additional reading: http://wiki.squid-cache.org/SquidFaq/SquidSnmp

First thing is to make sure that you have given --enable-snmp option while compiling your squid. If you have not done so then its time to do so. Compile your squid with --enable-snmp and then 'make clean', 'make', and 'make install'
Edit you squid.conf file so that
snmp_port 3401
acl snmppublic snmp_community public
snmp_access allow snmppublic localhost
snmp_access deny all
The first line defines the port SNMP is listening on squid.
Second line defines public as the community string or lets say password.
Third line defines that from localhost snmp query can be made to squid.
Fourth line denies query from all.(except localhost)
Now you need a web server to serve the graphs.
Download apache from http://www.reverse.net/pub/apache/httpd/httpd-2.2.6.tar.bz2
mv ./httpd-2.2.6.tar.bz2 /usr/local/src
cd /usr/local/src
bunzip2 -c /usr/local/src/httpd-2.2.6.tar.bz2 | tar xvf -
rm httpd-2.2.6.tar.bz2
mv httpd-* httpd
cd httpd
./configure --enable-prefix=/usr/local/httpd
make
make install
Now you need to configure apache. Lets just host it in a simple way.
mkdir -p /usr/local/www/mrtg
vi /us/local/httpd/conf/httpd.conf
Change DocumentRoot to "/usr/local/www/mrtg"
run /usr/local/httpd/bin/apachectl -k start
Now its time for setting MRTG server. Download the following programs:
http://www.gzip.org/zlib (gzip
http://www.libpng.org/pub/png/libpng.html (libpng)
http://www.libgd.org/ (gd)
http://oss.oetiker.ch/mrtg/pub (mrtg)
Copy zlib to /usr/local/src
gunzip -c zlib-*.tar.gz | tar xvf -
rm zlib-*.tar.gz
mv zlib-* zlib
cd zlib
./configure
make
cd ..
Copy libppng to /usr/local/src
gunzip -c libpng-*.tar.gz |tar xvf -
rm libpng-*.tar.gz
mv libpng-* libpng
cd libpng
make -f scripts/makefile.std CC=gcc ZLIBLIB=../zlib ZLIBINC=../zlib
rm *.so.* *.so
cd ..
The \ in the following line means that they are same line.
Copy gd to /usr/local/src
gunzip -c gd-2.0.11.tar.gz |tar xf -
mv gd-2.0.11 gd
cd gd
env CPPFLAGS="-I../zlib -I../libpng" LDFLAGS="-L../zlib -L../libpng" \
./configure --disable-shared --without-freetype --without-jpeg
make
cp .libs/* .
cd ..
Copy mrtg to /usr/local/src
gunzip -c mrtg-2.15.2.tar.gz | tar xvf -
cd mrtg-2.15.2
./configure --prefix=/usr/local/mrtg-2 \
--with-gd=/usr/local/src/gd \
--with-z=/usr/local/src/zlib \
--with-png=/usr/local/src/libpng
make
make install
mkdir -p /usr/localmrtg-2/cfg
Now lets make graph for squid.
Download the following two files
mrtg-squid.cfg
squid.mib
Copy them to /usr/local/mrtg-2/cfg/
edit mrtg-squid.cfg and do as the file says. Put working dir as /var/www/mrtg
Lets make graph
/usr/local/mrtg-2/bin/mrtg /usr/local/mrtg-2/cfg/mrtg-squid.cfg
Run this for three times. Its OK for now to see few errors.
Lets make index page
/usr/locl/mrtg-2/bin/indexmaker --title="OSR" --show=day --section=title --output=/var/www/mrtg/index.html /usr/local/mrtg-2/cfg/mrtg-squid.cfg
Fire your browser and you should see the graph
For continous monitoring
crontab -e
*/5 * * * * /usr/local/mrtg-2/bin/mrtg /usr/local/mrtg-2/cfg/mrtg-squid.cfg --logging=/var/log/mrtg.log
Additional reading: http://wiki.squid-cache.org/SquidFaq/SquidSnmp
Thursday, December 13, 2007
Winter Darkness / Geminids Meteor Shower
The deepening darkness of winter has arrived and with it the beautiful winter skies. The earliest sunset has already passed, but the longest night is yet to come on Friday December 20th when we will experience over 14 hours of twilight and darkness from sunset to sunrise. This date is known as the Winter Solstice and it marks the day when the sun appears to be at its lowest point in the sky (at noon) compared to every other day of the year. From our latitude in San Francisco, this means that the sun will only appear approximately 30 degrees above the southern horizon at noon on December 20th - very low indeed!
December also brings the annual Geminid Meteor Shower. If you spend enough time looking up at the sky on any night of the year you will likely see a few meteors streak across the sky. However, a meteor shower is a special time in which a much higher number of meteors are visible. December 13-15 is a time when the Earth passes through a part of the Solar System which contains a particularly high concentration of dust and particles which enter the atmosphere and burn up, creating the beautiful "shooting stars" that we have come to know. This year the Geminid Meteor Shower comes at a time when moonlight will not interfere with seeing and the weather prospects are good (at least as of the time of this writing). The meteor shower is called the Gemenids because the meteors in the shower all seem to emanate from the same part of the sky in the constellation Gemini.
To see the Geminids, you need to look east in the evening after 9:00 pm, or straight up around midnight, or due west in the pre-dawn skies in the morning. The twin stars of Gemini (Castor and Pollux) are a bright pair and brilliant orange Mars is nearby. These stars and planet mark the spot where the meteors will appear to come from. It's rumored that the early morning hours of Friday 14th should bring some of the finest viewing to us on the west coast. Bundle up in a very warm jacket and hat and take a look. There's no need for a telescope or binoculars. You should see at least a few meteors even in the bright city skies of the Bay Area.
December also brings the annual Geminid Meteor Shower. If you spend enough time looking up at the sky on any night of the year you will likely see a few meteors streak across the sky. However, a meteor shower is a special time in which a much higher number of meteors are visible. December 13-15 is a time when the Earth passes through a part of the Solar System which contains a particularly high concentration of dust and particles which enter the atmosphere and burn up, creating the beautiful "shooting stars" that we have come to know. This year the Geminid Meteor Shower comes at a time when moonlight will not interfere with seeing and the weather prospects are good (at least as of the time of this writing). The meteor shower is called the Gemenids because the meteors in the shower all seem to emanate from the same part of the sky in the constellation Gemini.
To see the Geminids, you need to look east in the evening after 9:00 pm, or straight up around midnight, or due west in the pre-dawn skies in the morning. The twin stars of Gemini (Castor and Pollux) are a bright pair and brilliant orange Mars is nearby. These stars and planet mark the spot where the meteors will appear to come from. It's rumored that the early morning hours of Friday 14th should bring some of the finest viewing to us on the west coast. Bundle up in a very warm jacket and hat and take a look. There's no need for a telescope or binoculars. You should see at least a few meteors even in the bright city skies of the Bay Area.
Wednesday, November 7, 2007
Comet Holmes

There are excellent accounts of Comet Holmes on many websites. Start at www.skyandtelescope.com and you will find photos, charts and links with the latest information about the comet, since it is such a dynamic object. Astronomers are at a loss to explain exactly what happened to cause Comet Holmes to suddenly flare up. There is no way to know when it might fade from view, but by most accounts it should stay bright and visible for the days ahead.
Wednesday, October 17, 2007
Waxing Moon / International Space Station
Last weekend I was at Ocean Beach as the sun set. Minutes after sunset I spotted a thin crescent moon hovering low on the western horizon. I find the very young crescent moon a beautiful thing in part because of its rarity. We are all quite acquainted with the "normal" appearance of the night sky -- lots of stars! But I find myself drawn to moments when something rare or unique happens in the sky such as the times I have seen a total solar eclipse or a close alignment of planets with a bright star. When a very thin crescent moon emerges in the sunset or sunrise sky, it is quite often a stunning sight because it is so low on the horizon and therefore looks large against the horizon, and because the "earthshine" on the dark portion of the moon gives it a ghostly appearance.
This week the moon is waxing and moving across familiar territory along the ecliptic past Jupiter and through Sagittarius. The moon is, of course, a satellite of the earth. That is to say, it is held in an orbit by earth's gravity and is close enough to the earth that when it is visible it dominates the night sky. There are, of course, many other satellites orbiting earth. These are man-made satellites and they too can be exciting to see in part due to their rarity and in part due to their unusual motion or brightness. The most distinctive satellite we can see on a regular basis is the International Space Station, also known as ISS. It orbits the earth every 90 minutes and is approximately 200 miles above the earth. It makes a fairly constant trip around the earth but each time it does so, the earth rotates part of the way through the day. ISS is quite large (about the size of a football field) and reflects sunlight very well, so when it passes directly overhead just after sunset or just before sunrise (when our skies are darkened but ISS is still in sunlight), it shines very brightly and moves quickly across the sky, much faster than airplanes.
If you want to get a look at this, you need clear skies, attentive eyes, and an accurate wristwatch. NASA maintains a website with all the details when it will appear over which parts of the United States. The website address is http://www.jsc.nasa.gov/sightings/index.html (or just type "ISS sighting" into your search engine). The next opportunity to see ISS from the Bay Area is on Friday Oct 19th at 7:29 pm and Saturday Oct 20th at 7:52 pm. In both cases look to the north-west. The ISS will take about 2 minutes from the time it appears above the horizon until it travels into the shadow of the earth and goes dark.
Good luck and happy viewing.
This week the moon is waxing and moving across familiar territory along the ecliptic past Jupiter and through Sagittarius. The moon is, of course, a satellite of the earth. That is to say, it is held in an orbit by earth's gravity and is close enough to the earth that when it is visible it dominates the night sky. There are, of course, many other satellites orbiting earth. These are man-made satellites and they too can be exciting to see in part due to their rarity and in part due to their unusual motion or brightness. The most distinctive satellite we can see on a regular basis is the International Space Station, also known as ISS. It orbits the earth every 90 minutes and is approximately 200 miles above the earth. It makes a fairly constant trip around the earth but each time it does so, the earth rotates part of the way through the day. ISS is quite large (about the size of a football field) and reflects sunlight very well, so when it passes directly overhead just after sunset or just before sunrise (when our skies are darkened but ISS is still in sunlight), it shines very brightly and moves quickly across the sky, much faster than airplanes.
If you want to get a look at this, you need clear skies, attentive eyes, and an accurate wristwatch. NASA maintains a website with all the details when it will appear over which parts of the United States. The website address is http://www.jsc.nasa.gov
Good luck and happy viewing.
Wednesday, October 3, 2007
Planet Lineup
As the days grow shorter and the nights longer and the Fall weather brings clearer skies to San Francisco, I find myself with more opportunities to gaze into the heavens. While some may groan that it is dark when they wake up in the morning, I think it is a perfect time for a 60-second peek into the sky. There is much going on so take note and enjoy the fact that Daylight Savings Time lasts an extra week this year (it ends on November 4th).
After the Moon, the five nearest planets are the brightest objects in the night sky. Right now we have clear views of four of them (Mercury is too close to the setting Sun to be seen at this time). Jupiter is an evening object low in the southwest after sunset. By the end of October it will be setting shortly after the Sun. Mars is a nightime object rising due east and moving directly overhead by morning. The diagram illustrates its location this week drifting through Gemini with a close encounter with one of the two bright "twin" stars of Gemini. Venus and Saturn are both morning objects. Given that sunrise is just after 7:00 am this week, the two planets are quite bright in the pre-dawn sky around 6:00 or earlier. Next week there are some beautiful combinations of planets, stars and Moon that you will want to see. The grouping on Sunday morning October 7th should be very striking.
After the Moon, the five nearest planets are the brightest objects in the night sky. Right now we have clear views of four of them (Mercury is too close to the setting Sun to be seen at this time). Jupiter is an evening object low in the southwest after sunset. By the end of October it will be setting shortly after the Sun. Mars is a nightime object rising due east and moving directly overhead by morning. The diagram illustrates its location this week drifting through Gemini with a close encounter with one of the two bright "twin" stars of Gemini. Venus and Saturn are both morning objects. Given that sunrise is just after 7:00 am this week, the two planets are quite bright in the pre-dawn sky around 6:00 or earlier. Next week there are some beautiful combinations of planets, stars and Moon that you will want to see. The grouping on Sunday morning October 7th should be very striking.
Wednesday, September 12, 2007
Venus, Jupiter and Brightness / Magnitude
Welcome back to another year of astronomy tips and news from the Urban Astronomer. I enjoy the opportunity to share astronomy with the Waldorf community and am glad to appear in the school newsletter from time to time. Throughout the year I'll talk about the changes in the night sky from season to season, share some insights about constellations and other celestial objects, provide information about special events such as eclipses and meteor showers, and of course highlight the changing positions of the planets and the beautiful arrangements of the moon, planets and stars that fill our skies throughout the year.
As we move toward Fall, the days are rapidly getting shorter and you might find yourself in the dark in the morning. Sunrise is at approximately 6:50 am which means if you are an early riser, you will have noticed brilliant Venus which is increasing in brightness and is rising due east more than two hours before the Sun. Just how bright is Venus? Astronomers use a curious system to measure the brightness of stars and planets. The system is called the "magnitude" system and it work the opposite of what you might expect, with lower numbers (and negative numbers) being brighter than higher numbers. For example, the north star (Polaris) is magnitude 2, but a brighter star directly overhead right now is Vega and its magnitude is 0. Venus is even brighter still, blazing at magnitude -4, almost the brightest it gets all year.
In the evening you can see Jupiter which dominates the southwest sky after sunset. Using the same brightness scale, Jupiter shines at magnitude -2. You can compare this to the red giant star Antares which is nearby Jupiter and although impressive at magnitude 1, seems faint compared to bright Jupiter. In the coming weeks you will notice Jupiter getting lower and lower in southwest sky, eventually fading into the sunset in a few months. Next week on Monday and Tuesday the waxing Moon will have a close encounter with Jupiter so if weather permits, enjoy the show anytime after sunset which next week is at approximately 7:15 pm.
As we move toward Fall, the days are rapidly getting shorter and you might find yourself in the dark in the morning. Sunrise is at approximately 6:50 am which means if you are an early riser, you will have noticed brilliant Venus which is increasing in brightness and is rising due east more than two hours before the Sun. Just how bright is Venus? Astronomers use a curious system to measure the brightness of stars and planets. The system is called the "magnitude" system and it work the opposite of what you might expect, with lower numbers (and negative numbers) being brighter than higher numbers. For example, the north star (Polaris) is magnitude 2, but a brighter star directly overhead right now is Vega and its magnitude is 0. Venus is even brighter still, blazing at magnitude -4, almost the brightest it gets all year.
In the evening you can see Jupiter which dominates the southwest sky after sunset. Using the same brightness scale, Jupiter shines at magnitude -2. You can compare this to the red giant star Antares which is nearby Jupiter and although impressive at magnitude 1, seems faint compared to bright Jupiter. In the coming weeks you will notice Jupiter getting lower and lower in southwest sky, eventually fading into the sunset in a few months. Next week on Monday and Tuesday the waxing Moon will have a close encounter with Jupiter so if weather permits, enjoy the show anytime after sunset which next week is at approximately 7:15 pm.
Subscribe to:
Posts (Atom)