====== Monitor FreeBSD performance with Cacti ====== ===== Prerequisite ===== * Cacti installed (and working) * Download files provided on [[http://forums.cacti.net/about19429.html|Cacti forum]] ===== Install snmp deamon ===== I use bsnmpd as snmp daemon. There's also snmpd but it doesn't have support for pf. To install bsnmp and bsnmp-ucd, use the following command pkg_add -r bsnmpd pkg_add -r bsnmp-ucd ===== Configure snmp daemon ===== ==== rc.conf ==== In file ''/etc/rc.conf'' add the following line bsnmpd_enable="YES" ==== snmpd.config ==== File ''/etc/snmpd.config'' is the default configuration file for bsnmpd. First edit generic snmp information (location and contact). location := "Server room" contact := "contact@example.com" I also added a variable ''host'' : host := 192.168.10.1 This variable is used later to set which IP address the daemon should be listening on. This is done by finding and editing lines starting with ''begemotSnmpdPortStatus'' : begemotSnmpdPortStatus.[$(host)].161 = 1 begemotSnmpdPortStatus.127.0.0.1.161 = 1 Those two lines will make your daemon listening on localhost and specified IP address in ''host'' variable. Normally MIB-2 module is loaded by default. Just check that the line ''begemotSnmpdModulePath."mibII" = "/usr/lib/snmp_mibII.so"'' is written and not commented (not starting with ''#''). You also want to add Packet Filter stats by adding (or uncommenting) line ''begemotSnmpdModulePath."pf" = "/usr/lib/snmp_pf.so"'' And you also want to add usage statistics (process, memory and load) by adding (or uncommenting) line ''begemotSnmpdModulePath."ucd" = "/usr/local/lib/snmp_ucd.so"''. The module is provided by ''bsnmp-ucd''. You can start snmp daemon with ''/etc/rc.d/bsnmpd start'' ===== Configure Cacti ===== ==== Templates files ==== You should have downloaded four files from Cacti forum. The first is ''pf_flow_167.xml''. This one has to be copied in ''./resources/snmp_queries/pf_flow.xml'' in your Cacti installation directory. Others files can be imported in Cacti via ''Import Templates'' on Cacti admin interface. ==== Create host in Cacti ==== Now you can just create a new device in Cacti and add graphs you need. For Packet Filter graphs use "Packet Filter statistic" as "Associated Data Queries" and then add graphs with graph template "Packet Filter Statistic".