x25accountingd(8X25) — Maintenance
Digital
NAME
x25accountingd, x25newlog, x25stoplogging − Log accounting records
SYNOPSIS
/usr/sbin/x25accountingd [-d directory] [-n maxrecords]
/usr/sbin/x25newlog
/usr/sbin/x25stoplogging
FLAGS
-dStore accounting log files in directory instead of /var/adm/x25.
-nAutomatically switch to a new log file every maxrecords accounting records. The default is 1000 records.
DESCRIPTION
The X.25 Accounting Daemon (x25accountingd) collects accounting records for all X.25 calls made to or from an X.25 for Digital UNIX system. To access this data, use the X.25 accounting utility (x25accounting(8X25)).
Accounting records are generated at the termination of each X.25 call made to or from the X.25 for Digital UNIX system. Calls cleared before being accepted also generate accounting records. Accounting records for PVCs start when the PVC is opened and finish when the PVC is closed.
An accounting record contains information about the duration of the call, the data transferred, the call characteristics, and the local and remote DTEs. If a PVC is being traced, local and remote DTEs have no significance, but the name of the PVC will be recorded. This information can be used for charging purposes or for monitoring performance.
It is not guaranteed that all calls will be logged. Calls are logged only while the accounting daemon is running. When the system is under extreme load, records of calls may be discarded before being collected by the daemon.
Once a record is collected, the system counts the number of records it discards until another record can be collected. The system stores this count of discarded records in the following record. An accounting record, therefore, specifies the number of records discarded between the termination time of that record and the termination time of the previous record.
The X.25 accounting daemon collects accounting records into log files stored, by default, in the /var/adm/x25 directory. The -d option can be used to specify a different directory in which to store the log files. Log files are named using the convention:
x25log.mmdd_n
where mm and dd are numbers specifying the month and day on which the log file was created and n is a unique sequence number used to distinguish between log files created on the same day.
To minimize the possibility of overwriting accounting log file data, the accounting daemon records the current suffix in the file:
/var/run/x25accountingd.log
When invoked, the daemon examines this file, if it exists, to determine what suffix it should use. If the day indicated by the recorded suffix matches the current day, the new log file is created with the next suffix in sequence. This means that if you delete all log files created on a particular day and invoke the accounting daemon on the same day, the suffix used will be given the next sequence number rather than 1.
The accounting daemon switches to a new log file once the maximum number of accounting records have been stored in the current file. By default, this occurs after 1000 records have been logged. A different maximum number can be specified using the -n command line option.
Starting a New Log File
You can request the daemon to create and use a new log file with the x25newlog command. Issuing this command instructs the daemon to close the active log file and create a new one using the naming convention described above, incrementing the sequence number if necessary.
Stopping the Daemon
To terminate the daemon and close the current log file, issue the x25stoplogging command.
RETURN VALUE
x25accountingd returns with status 0 if successfully invoked, otherwise status 1 is returned.
x25newlog and x25stoplogging return status 0 if x25accountingd is running, otherwise they return with status 1.
RESTRICTIONS
Superuser privilege is required to run x25accountingd, x25newlog and x25stoplogging commands.
Only one instance of x25accountingd may be running at any one time.
DIAGNOSTICS
The following messages may be generated when x25accountingd is invoked:
an accounting daemon is already running
Another process is exclusively reading accounting records from the system.
-n option expects numeric parameter
A non-numeric argument was passed with the -n option.
only the super user can run the accounting daemon
A user other than root attempted to run the accounting daemon.
unable to create a new log file
A new log file could not be opened in the log directory.
unable to begin collection of accounting records
The daemon was not able to initiate communications with the system to allow collection of accounting records.
Other messages are logged via syslog(3):
starting the daemon
Startup was successful.
error starting the daemon
Startup was unsuccessful.
switching to a new log file x25log.mmdd_n
Generated when the daemon switches to a new log file as a result of the x25newlog command being used or the limit imposed by the maximum number of records per log file being reached.
error switching to a new log file (system error message)
The daemon could not switch to a new log file. The reason for this is given as a standard system error message.
error collecting accounting records (system error message)
The daemon encountered an error condition while reading accounting records from the system. The reason for this is given as a standard system error message.
error writing to log file (system error message)
The daemon could not write an accounting record to the current log file. The reason for this is given as a standard system error message.
daemon gracefully terminates
The x25stoplogging command was issued.
FILES
/var/adm/x25log.∗X.25 accounting log files
/var/run/x25accountingd.log
Current log file extension
/var/run/x25accountingd.pid
PID of X.25 accounting daemon
RELATED INFORMATION
Commands: x25accounting(8X25).
Functions: X25ReadAccountingLog(3X25), X25WriteAccountingLog(3X25).
X.25 for Digital UNIX − Management Guide.