First of all you need to configure your Linksys device to send its SNMP trap messages to the machine that will be running the Daemon which logs the data to the database. On my device (a BEFSR41) this is accomplished by pointing my web browser to http://192.168.1.1 which logs you in to the administrative functions of your router. Hopefully this is password protected. Once you've logged into your device go to the info tab and enable SNMP traps and set the device to send those traps to the machine that will run the Daemon. I have the traps sent to 192.168.1.10, so my logs setup looks like:
Now you're ready to build Link-n-Log. The distribution includes 2 binaries which were built on my Redhat 8.0 machine. They may work for you (although they won't work until you've completed the configuration instructions below). If they do, great. If not you'll need to build them again. This can be accomplished by first removing GUI/Link-n-Log and Daemon/linknlogd and then running:
export QTDIR=[your qt dir]
Where
qmake Link-n-Log.pro
make[your qt dir]
is the directory where the QT development libraries
are installed (/usr/lib/qt3 on my machine). If you don't have these libraries they
can be downloaded from trolltech, or you should
be able to find rpm's or deb packages for your distro.
You will need to create a database where the alerts can be logged. This database will also contain the port list database (kindly provided by the good folks at Neohapsis.com) that allows you to map ports to services. Do the following:
mysql -u [user] -p[password] -h [host] < dbsetup.sql
where [user]
is a MySQL user that has permissions to create new
databases, [password]
is the MySQL password for that user (recall
that, MySQL uses different users than Linux so the MySQL user "root"
and the Linux user "root" are not the same. Also note that there is
no space between the -p and the password) and [host]
is the host
where the database resides (if the database is on the same machine where
you're running the above commands use "localhost" for the host
value). The dbsetup.sql file should be in the main directory
containing all the source code.
The only things that need to be changed in the supplied Link-n-Log.ini file are probably the username and password. They should reflect the username and password of the MySQL user that you want to access the database.
In the Daemon directory a file called "linknlogd" is created. This is the Daemon that listens for SNMP traps (UDP port 162) generated by the Linksys router and logs the data to the database. The Daemon should be left running so it can log all the alerts to the database. The Daemon generally needs to be run as root as it needs to be able to listen to UDP port 162 which is a privileged port.
Copy the GUI and the Daemon executables to the location of your choice and you're up and running. If you want to create a desktop link to the application in Gnome or KDE a nice little icon (that's supposed to look like a firewall make out of lincoln logs) is supplied.