NAmpel - the Nagios Ampel Project
Welcome to my latest toy: Nagios meets Blinkenlights
June 13th 2006
v0.5-rc1 out now
This is mainly a bugfix release but a new feature is also available:
The init script is now able to kill the daemon.
Read more about it ...
June 8th 2006
v0.4 is available for download !
Finally there is no need to edit the script itself, since there is a decent
config file and handling of default values.
Debugging also becomes significantly easier with the brand new debug
configuration directve.
Consult the changelog as usual ...
February 5th 2006
started to document the circuitry
February 1st 2006
v0.3 has been released !
Major improvements include: HTTP Basic authentication is now supported !
see the changelog for details.
January 11th 2005
the hardware part is now ready for daily use
and the image gallery got updated accordingly
January 3rd 2005
v0.2 now a daemon
see the changelog for details.
December 30th 2004
v0.1 initial release
WARNING ! This software is still in an early development stage ! It runs as root so it may do nasty things to your system ! DO NOT USE THIS SOFTWARE ON A PRODUCTION NETWORK ! (see disclaimer at the end of this page) If you do run this program on your computer(s) you do this at your own risk.
Introduction
NAmpel is the 'Nagios Ampel Project', started by me to keep a closer eye on my net.
Nagios is an open source host, service and network monitoring program. Read all about it at http://www.nagios.org
'Ampel' is the german word for traffic lights, which is the intended hardware part of this project. It will resemble traffic lights, indicating the state of affairs by means of three lights. Check out the pictures !
Green: everything is ok, no need to check Nagios.
Orange: there are at least one warnings from Nagios. Better take a look.
Red: One or more services are in 'critical' state. Panic.
The project was inspired by an idea once published at the Snort website. (not the Nagios website, as stated in earlier versions of this document) There was an image of a device doing something similar and the announcement, it would be published as soon as it was ready.
I waited and waited and finally I did the thing myself.
The software part is a Perl script, checking the 'Tactical Overview' of Nagios
at certain intervals and writing the results to the parallel port. It uses four
bits to do so: Bit 0 for the green, 1 for the yellow and 2 for the red light.
Finally a fourth light (I chose blue) is available as a 'heartbeat' signal,
flashing once every second to show the daemon is still running.
Detailed instructions how to build the hardware part will be available soon.
It is derived from a project which can be
found at: easy-mod
(in german).
The basic wiring follows this simple scheme: The transistor ia a BC548A (or similar NPN amplifier) and as LEDs I used ultra
bright 5mm LEDs right from my favourite electronics vendor.
The parallel port offers 8 output bits (compare centronics pinout)
where I use the lower 4.
The problem of the 5V power source was puzzling me for a while. First I
hooked up an old power plug from some electronic gadget long deceased. But
then I found an additional power outlet wasted a sad idea and looked for 5V of
power inside my PC.
Yes, there are 5V and 12V (and lots more) on every power plug hanging out of
the internal PSU. Drilling a hole in the back of the case, just to get to those
power lines seemed a bit rude to me.
But wait ! What do keyboards, mice and USB devices have in common ? ... They
are 5V powered ! If you have a spare PS/2 or USB port and a dead mouse, keyboard
or some USB corpse, cut off the cord and grab the voltage ! (
PS/2 or USB)
The script depends on two Perl modules from CPAN
: Device::ParallelPort and
HTTP::Lite
Again, I'll comment it further soon.
Here is a loose list of milestones I wish to pass before the version number
will be 1.0:
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU
General Public License
as published by the Free Software Foundation
; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
The Hardware
The Software
Things to do
the script has to be run as root (at least at my testing environments) to
access the port. this should not be necessary.
giving reasonable status output about the daemon itself is quite a challenge
given the limited capacity ;-) It should flash its lights in easily
distinguishable ways, depending on what went wrong (server unavailable,
incompatible Nagios output ...)
how about something similar to 'make install' after unpackung the tarball ?
Sounds nice ? Hang on !
the way the status is recieved is a quick and dirty hack ! As are several
other parts of those few codelines ;-)
The road ahead
Copyright notice