NFS Services Administrator's Guide (B.11.31.03) August 2008

To Control the Size of LogFiles
Logfiles grow without bound, using up disk space. You might want to create a cron
job to truncate your logfiles regularly. Following is an example crontab entry that
empties the logfile at 1:00 AM every Monday, Wednesday, and Friday:
0 1 * * 1,3,5 cat /dev/null > log_file
For more information, type man 1M cron or man 1 crontab at the HP-UX prompt.
To Configure Logging for the Other NFS Services
1. Add the -l logfile option to the lines in /etc/inetd.conf for the services
you want to log. In the following example, logging is turned on for rpc.rexd
and rpc.rstatd:
rpc xit tcp nowait root /usr/sbin/rpc.rexd 100017 1 \
rpc.rexd -l /var/adm/rpc.log
rpc dgram udp wait root /usr/lib/netsvc/rstat/rpc.rstatd \
100001 1-3 rpc.rstatd -l /var/adm/rpc.log
2. Enter the following command to restart inetd:
/usr/sbin/inetd -c
If you do not specify a logfile for the other NFS services (with the -l option), they do
not log any messages. The NFS services can all share the same logfile.
For more information, see rexd(1M), rstatd(1M), rusersd(1M), rwalld(1M) , and sprayd(1M).
Logging With nettl and netfmt
1. Enter the following command to make sure nettl is running:
/usr/bin/ps -ef | grep nettl
If nettl is not running, enter the following command to start it:
/usr/sbin/nettl -start
2. Enter the following command to start logging:
/usr/sbin/nettl -l i w e d -e all
The logging classes are specified following the -l option. They are i
(informational), w (warning), e (error), and d (disaster). Disaster logging is always
on. You cannot turn it off. Information logging (i) fills up your logfile faster than
the other classes, so you might want to leave it off.
3. Recreate the event you want to log.
4. Enter the following command to turn logging off:
/usr/sbin/nettl -l d -e all
This command changes the logging class back to disaster only for all subsystems.
5. Enter the following command to format the binary logfile:
Logging and Tracing of NFS Services 141