1823202 Members
3694 Online
109648 Solutions
New Discussion юеВ

Accounting

 
Fuad_1
Regular Advisor

Accounting

I need a full description of how to install and configure the acct utility, and from where I can find it? I have many HP-UX servers needs this facility.
Set goals, and work to achieve them
11 REPLIES 11
John Carr_2
Honored Contributor

Re: Accounting

Hi

system accounting is part of the core O/S and just needs activiating to collect info.

These files need to be created by root cron jobs to collect and format the data properly.

Man sar, sa, sa1, sa2 will give you more information.


example cron file
#
# Caputure system data for sar
#
0 * * * 0,6 /usr/lbin/sa/sa1 1200 3
0 8-17 * * 1-5 /usr/lbin/sa/sa1 900 4
0 18-7 * * 1-5 /usr/lbin/sa/sa1 1200 3
45 23 * * 1-5 /usr/lbin/sa/sa2 -s 0:00 -e 23:30 -i 3600 -A
15 6 * * * find /var/adm/sa -name 'sa*' -mtime +7 -exec rm {} \; > /dev/null 2>&1
Steven Sim Kok Leong
Honored Contributor

Re: Accounting

Hi,

Check out the man pages:

# man 1m acct

accton either activates (when file argument is specified) or deactivates accounting (when file argument is not specified).

Hope this helps. Regards.

Steven Sim Kok Leong
Fuad_1
Regular Advisor

Re: Accounting

Whenever I write the accton command, it gives sh: accton: not found.
Set goals, and work to achieve them
Steven Sim Kok Leong
Honored Contributor

Re: Accounting

Hi,

All the accounting administration commands reside in /usr/sbin/acct.

# /usr/sbin/acct/accton

Hope this helps. Regards.

Steven Sim Kok Leong
Steven Sim Kok Leong
Honored Contributor

Re: Accounting

Hi,

Unless you decide to use a non-standard accounting file (i.e. other than /var/adm/pacct), it will be better to use turnacct than accton.

According to the man page, turnacct is the interface to accton to turn process accounting on or off. The switch argument turns accounting off, moves the current /var/adm/pacct to the next free name in /var/adm/pacctincr then turns accounting back on again. (incr is a number starting with 1 and incrementing by one for each additional pacct file.) turnacct is called by ckpacct, and thus can be run under cron and used to keep pacct to a reasonable size.

By default, accounting is turned on by the system. That is why the command last etc. which uses wtmp/utmp works.

Hope this helps. Regards.

Steven Sim Kok Leong
John Carr_2
Honored Contributor

Re: Accounting

Hi

to automatically start accounting after reboot edit file /etc/rc.config.d/acct
and change START_ACCT=0 to =1

cheers
John.
Steven Sim Kok Leong
Honored Contributor

Re: Accounting

Hi,

There are mainly two types of accounting:
1) connect time accounting (/etc/utmp)
2) process accounting (/var/adm/pacct)

Connect time accounting is started by the system by default (/etc/utmp is present) while process accounting is not (/var/adm/pacct is not present).

Once you activate accounting, you can perform runacct in a cron to perform daily accounting from the accounting files.

According to the man page, runacct is the main daily accounting shell procedure. It is normally initiated via cron. runacct processes connect, fee, disk, and process accounting files. It also prepares summary files for prdaily or billing purposes.

# man 1m runacct

Hope this helps. Regards.

Steven Sim Kok Leong
John Carr_2
Honored Contributor

Re: Accounting

Fuad

please ignore my first reply I did not read the question properly.

Steven you are quite right.

cheers
John.
Fuad_1
Regular Advisor

Re: Accounting

Hi all, please look in this:

# usr/sbin/acct/runacct
May 4 04:44:25 bat-y2k sendmail[6905]: unable to qualify my own domain name (ba
t-y2k) -- using short name
May 4 04:44:26 bat-y2k sendmail[6910]: unable to qualify my own domain name (ba
t-y2k) -- using short name
Set goals, and work to achieve them
U.SivaKumar_2
Honored Contributor

Re: Accounting

hi,
do you need sendmail ?. if not disable it in
/etc/rc.config.d/mailservs.
#ps -ef | grep sendmail
#kill "sendmail's pid"
if you want sendmail running , still want to stop errors put a dot at the end as follows in
/etc/sendmail.cf and restart the sendmail.
Cwlocalhost.

regards,
U.SivaKumar


Innovations are made when conventions are broken
Steven Sim Kok Leong
Honored Contributor

Re: Accounting

Hi,

Check out James R Ferguson's detailed response to resolve your sendmail issue:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x79617d4cf554d611abdb0090277a778c,00.html

Hope this helps. Regards.

Steven Sim Kok Leong