Install, configuring and running DSC on Ubuntu: NOTES: DSC is normally installed on multiple collector nodes, that collect traffic on the DNS nodes themselves, and a presenter, which receives the trace files generated by the collector nodes. In this exercise, we will be installing the collector and presenter on the same host. Also, we will not be using SSL certificates. Part I: Presenter Installation 1. Install Perl dependencies # perl -v If it is not installed, you can always get it with apt-get install perl Let's get all the necessary modules for DSC to run: # perl -MCPAN -e shell (Answer questions, etc...) You should get the following prompt in the end: cpan[1]> At the prompt, for each of the following modules, run: install MODULE_NAME CGI::Untaint CGI Digest::MD5 File::Flock File::Spec File::Temp Geography::Countries Hash::Merge IP::Country MIME::Base64 Math::Calc::Units List::Util Text::Template URI::Escape XML::Simple (Some will aready be part of the base perl install, but they will be ignored, so don't worry) 3. Install other dependencies - To compile DSC modules: # apt-get install gcc # apt-get install make - Additional software required: # apt-get install apache2 # apt-get install ploticus 4. Fetch the latest DSC distribution (Always at http://dns.measurement-factory.com/tools/dsc/download/) # wget http://dns.measurement-factory.com/tools/dsc/download/dsc-200912101623.tar.gz Extract it: # tar xfz dsc-200912101623.tar.gz # cd dsc-200912101623 5. Build the presenter, and install it # cd presenter # make [there should be no errors] # mkdir /usr/local/dsc # make install 6. Make symlinks # cd /usr/lib/cgi-bin # ln -s /usr/local/dsc/libexec/put-file.pl # ln -s /usr/local/dsc/libexec/dsc-grapher.pl # cd /var/www # ln -s /usr/local/dsc/share/html dsc 7. Add a 'dsc' user # useradd dsc -d /usr/local/dsc -c "DSC" # chown dsc /usr/local/dsc 8. Create directories where data will be copied: # mkdir -p /usr/local/dsc/data/aroc-dns/localhost # chown -R dsc /usr/local/dsc/data/aroc-dns 8. Set permissions on various data dirs # chgrp nogroup /usr/local/dsc/data/ # chmod 2775 /usr/local/dsc/data/ # chgrp www-data /usr/local/dsc/var/log/ # chgrp www-data /usr/local/dsc/cache/ 9. Create a crontab for the cleanup jobs: # crontab -e # Presenter * * * * * /usr/local/dsc/libexec/refile-and-grok.sh @midnight find /usr/local/dsc/data/ | /usr/local/dsc/libexec/remove-xmls.pl 7 (save and quit) Part II: Collector Installation 1. Go back to the DSC distribution source directory # cd .../dsc-200912101623 # collector # make # make install 2. Create upload directories # mkdir -p /usr/local/dsc/run/localhost/upload/aroc (This means that we will have XML files in the localhost directory, and they will be moved to the upload directory 'aroc'. These files will be moved by the "upload-prep.sh" cron job: # crontab -e # Collector * * * * * /usr/local/dsc/libexec/upload-prep.sh 3. Let's add cron jobs to "upload" the files to the presenter In reality, this is happening on the same machine, but we set up the system as if we were installing using a separate collector and presenter: # crontab -e * * * * * /usr/local/dsc/libexec/upload-rsync.sh localhost aroc dsc@localhost:/usr/local/dsc/data/aroc-dns/localhost 4. Generate a key for the root user, used to copy files to the data directories # ssh-keygen -t dsa (don't set any passphrase) Copy the /root/ssh/id_dsa.pub to the authorized_keys directory of the DSC user: # mkdir /usr/local/dsc/.ssh # cp /root/ssh/id_dsa.pub /usr/local/dsc/.ssh/authorized_keys # chown -R dsc /usr/local/dsc/.ssh Part III: Configuring and running the collector 1. Configuration # cd /usr/local/dsc/etc # cp dsc.conf.sample dsc.conf Edit the file, and set the variables below as follows: local_address ip_of_your_server; run_dir "/usr/local/dsc/run/localhost"; interface eth0; ... the rest of the values are good defaults. 2. Running # /usr/local/dsc/bin/dsc -d -f /usr/local/dsc/etc/dsc.conf XXX: We have a problem. dsc crashes on Linux when running normally, i.e.: without the -d flag. Bug report will be sent to Duane. As a result, with -d, it only runs once... Part IV: Configure and use the graph viewer # cp dsc-grapher.cfg.sample dsc-grapher.cfg Edit the file, and make the following changes: - Remove these two lines: server f-root pao1 sfo2 server k-root A=k1.A,k2.A B=k1.B,k2.B C=k1.C,k2.C - Add this line instead: server aroc-dns localhost - Change the line valid_domains f-root all_tlds to valid_domains aroc-dns all_tlds That's it! You should be able to start observing the graphs at: http://yourhost/cgi-bin/dsc-grapher.p TODO: test upload-rsync.sh, make sure that the copying is taking place setup a bind nameserver, that receives queries