3

I'd like to record data about system activity under FreeBSD for future analysis. If I were running a SysV system, I'd just sar and its related utilities, but that doesn't exist in the BSDs. (And bsdsar has gone missing.) I don't really care about specific formats or utilities, but I want to keep information about CPU, RAM, and VM utilization, as well as I/O information. At the same time, full acct process accounting both seems like overkill and doesn't really provide data I want: notably, data about preexisting processes.

I could just log the output from long-running vmstat, iostat, etc. commands, but it seems like there ought to be something tidier.

Ultimately, the question is:

What is a good way to find out recent past system utilization under FreeBSD?

wfaulk
  • 6,828
  • 7
  • 45
  • 75
  • As is always the way, I ran across a solution in the middle of posting this. atop seems likely to have the features I need. – wfaulk Oct 07 '13 at 17:09

2 Answers2

3

I ended up using atop (which is available in FreeBSD ports as sysutils/atop), and it's awesome. I would very much consider using it in preference of sar on systems where sar is available. It comes with a curses-based UI that is easy to navigate and shows a lot of data at once. It's incredibly handy.

wfaulk
  • 6,828
  • 7
  • 45
  • 75
2

collectd is available for FreeBSD. From the collectd website:

collectd gathers statistics about the system it is running on and stores this information. Those statistics can then be used to find current performance bottlenecks (i.e. performance analysis) and predict future system load (i.e. capacity planning). Or if you just want pretty graphs of your private server and are fed up with some homegrown solution you're at the right place, too ;).

You can collect lots of information with the plugins it ships with, and you can roll your own with its various language bindings.

If you want to use it on more than one host, you can collect data with collectd on one host as an agent and make it forward the data using the network plugin and plot RRD graphs there, or plug it into Grafana (for example with the kafka output plugin) and make more fancy graphs there.

From the FreshPorts page:

The following configuration options are available for collectd5-5.8.0_1:
 CGI=off: Install collection.cgi (requires rrdtool)
 GCRYPT=on: Build with libgcrypt
 JAVA=off: Java platform support
 LOGGING=on: Enable debug logging
 LOGSTASH=off: Enable log_logstash plugin (requires json)
 VIRT=off: Enable libvirt plugin (requires XML)
Options available for the group INPUT
 CHRONY=off: Enable chronyd plugin
 CURL=off: Enable curl-based plugins (apache, nginx, etc)
 CURL_JSON=off: Enable curl_json plugin (implies curl and json)
 CURL_XML=off: Enable ascent, bind, curl_xml plugins (implies curl and xml)
 DBI=off: Enable dbi plugin
 IPMI=off: Enable OpenIPMI plugin
 JSON=off: Enable JSON plugins
 MEMCACHEC=off: Enable memcachec plugin
 MODBUS=off: Enable modbus plugin
 MQTT=off: Enable MQTT broker metrics
 MYSQL=off: Enable mysql-based plugins
 NUTUPS=off: Enable nut (ups) plugin
 OLSRD=off: Enable olsrd plugin
 ONEWIRE=off: Eanble onewire plugin (via owfs)
 OPENLDAP=off: Enable OpenLDAP plugin
 PERL=off: Enable libperl plugin and binding
 PGSQL=off: Enable postgresql-based plugins
 PINBA=off: Enable pinba plugin (via protobuf-c)
 PING=on: Enable ping plugin
 PYTHON=off: Enable python-based plugins
 RABBITMQ=off: Enable rabbitmq-based plugins
 REDIS=off: Enable redis-based plugins
 ROUTEROS=off: Enable routeros plugin
 SIGROK=off: Enable sigrok plugin
 SNMP=off: Enable SNMP plugin
 STATSD=off: Enable statsd plugin
 TOKYOTYRANT=off: Enable tokyotyrant plugin
 VARNISH=off: Enable varnish 4.x cache statistics
 XML=off: Enable XML plugins
 XMMS=off: Enable xmms plugin
 ZOOKEEPER=off: Enable zookeeper plugin
Options available for the group OUTPUT
 KAFKA=off: Enable write_kafka plugin
 MONGODB=off: Enable write_mongodb plugin (BROKEN)
 NOTIFYDESKTOP=off: Enable desktop notifications
 NOTIFYEMAIL=off: Enable notifications via email
 PROMETHEUS=off: Enable write prometheus plugin
 RIEMANN=off: Enable write_riemann plugin (via riemann-c-client)
 RRDTOOL=off: Enable rrdtool plugin (also rrdcached plugin)
 TSDB=off: Enable write_tsdb plugin
fuero
  • 9,413
  • 1
  • 35
  • 40
  • 1
    More detail would improve this. Link only answers are note great once the link breaks. Can you add some info about collectd to improve? – Dave M Oct 07 '13 at 18:37