Ever since I sow the oscon presentation of reconnoiter I wanted to check it out and play with it. Yesterday, I finally had some time to do this and thought it would be a good idea to document it as a short howto. Most of the infos I used are from the readme (BUILDING), the wiki and the excellent writeup of Thomas Dudziak on how to install reconnoiter on ubuntu.
The daemons noitd and stratcond are written in C, and the database used is postgressql, while the web interface is written in php. We will need to install a few dependencies to be able to compile noitd/stratcond:
Dependencies
1 2 3 4 5 | |
In case you don’t have already installed svn, we will need that also (to download the sources):
1
| |
Compiling
Next we will download the source and compile it. I used the trunk version bellow, but you might want use a stable tag (Urskek is the latest when writing this):
1 2 3 4 5 6 7 | |
Database
We need to instal PostgreSQL 8.4 and this is not available in lenny; the simplest way we can do this is to use the backports package. To enable the backports sources add this line
1
| |
to your /etc/apt/sources.list and run apt-get update to refresh your apt indexes. And finally add the backports key into apt:
1
| |
Now we can install postgres 8.4 using:
1
| |
Next we’ll need to edit /etc/postgresql/8.4/main/pg_hba.conf and replace this line
1
| |
with
1
| |
and restart postgres:
1
| |
to allow local access without password.
Next we can install the dbs, using:
1 2 3 4 5 | |
DB crontab
You can find a sample crontab in the sql folder that needs to be customized for our particular setup (/opt/psql835/bin -> /usr/bin/), and it should look like this:
1 2 3 4 5 6 7 8 9 10 11 | |
!!! I would suggest to run the daily crons manually once as they create the needed tables and in case you don’t have them you will receive various errors (I know I lost a lot of time trying to figure out why those were not there). This should be just like:
1
| |
and so on for each of the 5 daily crons from above.
keys
For a production install you will obviously create some real certs, but in my case where I was just testing this out the test certs build by the installer are just fine:
1 2 | |
In dealing with the configuration files uuid’s you will find useful the uuidgen program from the uuid-runtime package:
1
| |
that will generate a new uuid on each run:
1 2 | |
noitd
We will start from the sample configuration:
1
| |
and edit/remove it as needed. Be sure to edit the sslconfig part with the keys you copied above. For more details on the config file look on the wiki.
Finally run noitd and see if all is good:
1
| |
If there are no errors stop it, and run it in the background (without -D):
1
| |
stratcon
For stratcon we are going to use a similar approach:
1
| |
and then customize the config based on our needs. Set the keys in sslconfig section and the db details
1 2 3 4 5 6 | |
the password is “stratcon” or whatever you set in scaffolding.sql if you customized it (a good idea ;) ). and finally run it with debuging in the foreground:
1
| |
and if all is good (you did ran the db creation task, right?) you can start it in the background without -D and move to the final step:
1
| |
Web interface
Finally the last step is to configure the web interface. For this we need to be sure we have apache/php installed and the pgsql module:
1
| |
and to enable the rewrite module
1
| |
Next we would copy the web files ui to some place like /var/www/ui and create a vhost for reconnoiter inside /etc/apache2/sites-available:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | |
enable the config:
1
| |
and restart apache to enable it: /etc/init.d/apache2 restart
After this hopefully you can open the web interface and start adding some metrics. My goal was to test this with collectd and if there is interest I could describe the details on how to make reconnoiter work with collectd in another post. let me know…