This section describes how to configure the logging of alert messages to the syslogd daemon and how to configure the operating system to accept syslog alerts.
You can use DSCC to perform this task. For information, see Directory Service Control Center Interface and the DSCC online help.
(Optional) View the current values of the properties for the system log alerts.
$ dpconf get-server-prop -h host -p port syslog-alerts-enabled \ syslog-alerts-facility syslog-alerts-host |
The default properties for the system log alerts are as follows:
syslog-alerts-enabled : false syslog-alerts-facility : USER syslog-alerts-host : localhost |
The syslog-alerts-host property defines the host name of the syslogd daemon to which the messages are sent. The syslog-alerts-facility property is read-only and causes messages to be sent to the user category in the system log.
Enable alert messages to be logged to the syslogd daemon.
$ dpconf set-server-prop -h host -p port syslog-alerts-enabled:true |
(Optional) Send alert messages to the syslogd daemon on a different host.
$ dpconf set-server-prop -h host -p port syslog-alerts-host:hostname |
This section provides instructions on configuring the SolarisTM, Linux, and HP-UX operating systems to accept syslog alerts.
Add the appropriate facility to the syslog configuration file.
For example, to store all alerts using the USER facility, add the following line to /etc/syslog.conf:
user.info /var/adm/info
Here /var/adm/info is an example local directory in which messages will be stored. Ensure that /var/adm/info exists before continuing.
Restart the syslogd daemon.
Verify that messages are logged in syslog.
$ logger -p user.info "Test message" $ cat /var/adm/info Jun 19 17:18:38 host user: [ID 12345 user.info] Test message
Add the appropriate facility to the syslog configuration file.
For example, to store all alerts using the USER facility, add the following line to /etc/syslog.conf:
user.info /var/adm/info
Here /var/adm/info is an example local directory in which messages will be stored. Ensure that /var/adm/info exists before continuing.
Configure the syslogd daemon to run with the -r option.
This option allows syslogd to accept connections from the network. By default, the -r option is not set.
To set the -r option, add the following line to /etc/sysconfig/syslog:
SYSLOGD_OPTIONS="-m 0 -r"
If /etc/sysconfig/syslog does not exist, add the same line to /etc/init.d/syslog.
Restart the syslogd daemon.
$ /etc/init.d/syslog stop | start
Verify that messages are logged in syslog.
$ logger -p user.info "Test message" $ cat /var/adm/info Jun 19 17:18:38 host user: [ID 12345 user.info] Test message
Add the appropriate facility to the syslog configuration file.
For example, to store all alerts using the USER facility, add the following line to /etc/syslog.conf:
user.info /var/adm/info
Here /var/adm/info is an example local directory in which messages will be stored. Ensure that /var/adm/info exists before continuing.
Restart the syslogd daemon.
$ /sbin/init.d/syslogd stop | start
Verify that messages are logged in syslog.
$ logger -p user.info "Test message" $ cat /var/adm/info Jun 19 17:18:38 host user: [ID 12345 user.info] Test message