Solaris extended accounting tips

Accounting types available: Task, Process, Flow (IPQoS), and Net (Crossbow). Each accounting type has a datafile to store records in which is user defined. A variety of different resources can be tracked for each accounting type, which can either individually selected or specified as either "extended" or "basic", which are groupings of resources.

    Activating:

  • Become superuser or assume an equivalent role.

  • Activate extended accounting for processes.

    # acctadm -e extended -f /var/adm/exacct/proc process

  • Activate extended accounting for tasks.

    # acctadm -e extended,mstate -f /var/adm/exacct/task task

  • Activate extended accounting for flows.

    # acctadm -e extended -f /var/adm/exacct/flow flow

  • Activating on persistent basis:

    # ln -s /etc/init.d/acctadm /etc/rc2.d/Snacctadm

    # ln -s /etc/init.d/acctadm /etc/rc2.d/Knacctadm


  • Display Extended Accounting Status

    $acctadm

  • View Available Accounting Resources

    $acctadm -r

  • Turn off process accounting.

    # acctadm -x process

  • Turn off task accounting.

    # acctadm -x task

  • Turn off flow accounting.

    # acctadm -x flow


Commands which use it's databases:

  • lastcomm

  • acctcom

  • exdump?


If you really want to take advantage of accounting data you'll need to build your own custom tools using either the Exacct PERL module (written by Sun, found in CPAN, and part of the Solaris PERL distribution) or the libexacct C library.


Good article:

http://www.cuddletech.com/blog/pivot/entry.php?id=1017

Comments