# ANTFARM/Printable version

The current, editable version of this book is available in Wikibooks, the open-content textbooks collection, at
https://en.wikibooks.org/wiki/ANTFARM

# General

Commands for setting up and running Posgresql Database with Antfarm.
Whether you are running Antfarm with a self-defined environment (reflected in defaults.yml file) or with the default environment, the following Antfarm Commands are useful.

# Traceroute

This is a work in progress as of 12/3/08.
Assuming that the user is implementing the latest version of Antfarm, which uses postgresql database. If you are using Antfarm that does not use postgresql database, you can use the following instructions to get started.
Now that you are using Antfarm with postgresql database, use the following Commands to set up your database to be filled with good information!
Parsing a traceroute file using Antfarm:
For your traceroute file:
NOTE: Your customized script will be automatically saved in the following location:
When you run the following command at the prompt ($):
you will see the name of your customized script under "custom".
Run Antfarm traceroute script on your traceroute file (do not include brackets in filenames):
At this point, you have parsed your traceroute file (<traceroute filename>)using the custom traceroute script in Antfarm (<traceroute script filename>) and the parsed information is saved in your environment (<environment name>).
You can view the output on Antfarm by running the following command (3. For traffic view, 4. For network view):
When displaying the traffic flow from a larger traceroute file, the visual becomes harder to read on the screen. Luckily there is an option that will help minimize this. The "collapse-ports" option allows you to only include one node for each port number discovered in the traceroute file.
The latest version of Antfarm the display is static, using the command above. If you wish to see an animated version of the display, use the following command (using display networks as an example):
Sample traceroute script

# PCAP

Parsing a PCAP file using Antfarm:
For your PCAP file:
NOTE: Your customized script will be automatically saved in the following location:
When you run the following command at the prompt ($):
you will see the name of your customized script under "custom".
Run Antfarm pcap script on your pcap file (do not include brackets in filenames unless they are a part of the filename):
For use on a single PCAP file, use:
For use on a whole directory of PCAP files, use:
At this point, you have parsed your pcap file (<PCAP text file>)using a custom PCAP script in Antfarm (<PCAP script filename>) and the parsed information is saved in your environment (<environment name>).
You can view the output on Antfarm by running the following command (4. For traffic view, 5. For network view):
When displaying the traffic flow from a larger PCAP file, the visual becomes harder to read on the screen. Luckily there is an option that will help minimize this. The "collapse-ports" option allows you to only include one node for each port number discovered in the PCAP file.
The latest version of Antfarm the display is static, using the command above. If you wish to see an animated version of the display, use the following command (using display networks as an example):
Sometimes, the PCAP files that are produced are much too large, use the following command to downsize the PCAP file to a more reasonable size (through the number of packets):
Sample PCAP script