solaris 8 system admin ii sa 288 phần 2 pdf

57 304 0
solaris 8 system admin ii sa 288 phần 2 pdf

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

3-1 Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services September 2000, Revision A.1 SolarisOperatingEnvironment syslog 3 Objectives Upon completion of this module, you should be able to: ● Configure syslog message routing ● Modify log message priority and severity ● Determine the effect of the LOGHOST variable on the syslog process ● Describe the two methods of starting the syslogd daemon ● Add entries to a system log using the logger utility Additional Resources Additional resources – The following references provide additional details on the topics discussed in this module: ● System Administration Guide, Volume 2, Part Number 805-7229-10 ● System Administration Guide, Volume 3, Part Number 806-0916-10 3 3-2 Solaris™ 8 Operating Environment System Administration II Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services September 2000, Revision A.1 The syslog Facility The syslog() function sends messages generated by the kernel and system utilities to the syslogd daemon. Depending on the configuration of the /etc/syslog.conf file, this daemon can: ● Write messages to a system log ● Write messages to the system console ● Forward messages to a list of users ● Forward messages to the syslogd on other hosts over the network The most valuable feature of syslog is that it puts you in control of message logging. This enables you to decide which messages are to be kept and where the messages are to be placed. 3 Solaris Operating Environment syslog 3-3 Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services September 2000, Revision A.1 Figure 3-1 The syslog Concept kernel Daemons User processes logger command syslogd Reads /etc/syslog.conf Logs messages Writes messages Forwards messages The syslog Concept Destinations Programs/ generates messages Processes messages 3 3-4 Solaris™ 8 Operating Environment System Administration II Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services September 2000, Revision A.1 Controlling the Behavior of syslogd Many processes are programmed to generate messages at various levels of importance in response to actions taken, or conditions encountered, during operation. You can control the manner in which syslogd manages these messages by modifying the /etc/syslog.conf configuration file. From this configuration file, you can instruct syslogd to sort messages by their source or their importance and route them to a specified destination. 3 Solaris Operating Environment syslog 3-5 Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services September 2000, Revision A.1 Configuring the /etc/syslog.conf File A configuration entry in the /etc/syslog.conf file consists of two tab-separated fields: selector and action. The selector field consists of a facility and a level written as facility.level . Facilities represent categories of system processes that can generate messages. Levels represent the severity or importance of the message. The action field determines where to send the message. For example, placing the following entry in the /etc/syslog.conf file causes error messages for all facilities to be sent to the /var/adm/messages file: ! Caution – Only use tabs as white space in the /etc/syslog.conf file. Selector Field The selector field is a semicolon-separated list of priority specifications of the form: facility.level; facility.level . *.err /var/adm/messages where *.err Is the selector field; * is the facility, . is the delimiter, and err is the level of the message /var/adm/messages Is the action field 3 3-6 Solaris™ 8 Operating Environment System Administration II Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services September 2000, Revision A.1 Facility is a system facility that is defined by the items shown in Table 3-1. Note – You can use the * to select all facilities (for example *.err); however, you cannot use it to select all levels for a facility (for example, kern.*) Table 3-1 Facility kern Messages generated by the kernel. user Messages generated by user processes. This is the default priority for messages from programs or facili- ties not listed in this file. mail The mail system. daemon System daemons, such as in.ftpd and telnetd. auth The authorization system including login, su, and getty. syslog Messages generated internally by syslogd. lpr The line printer spooling system – lpr and lpc. news Files reserved for the USENET network news system. uucp The UNIX-to-UNIX copy (UUCP) system; does not use syslog. cron The cron and at facilities, including crontab, at, and cron. local0-7 A field reserved for local use. mark Time-stamp messages produced internally by syslogd. * All facilities, except the mark facility. 3 Solaris Operating Environment syslog 3-7 Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services September 2000, Revision A.1 Level is the severity of the message. Levels in order of descending order of severity are shown in The none message is normally used only when debugging a program. The none message appears when messages are not sent from the indicated facility to the selected file; for example, a selector of *.debug;mail.none sends all messages except mail messages to the selected file. Note – Not all levels of severity are implemented for all facilities in the same way. For more information, refer to the online manual pages. Table 3-2 Levels emerg Panic conditions that are normally to be broadcast to all users. alert Conditions that should be corrected immediately, such as a corrupted system database. crit Warnings about critical conditions, such as hard device errors. err Other errors. warning Warning messages. notice For conditions that are not error conditions, but might require special handling. info Informational messages. debug Messages that are normally used only when debugging a program. 3 3-8 Solaris™ 8 Operating Environment System Administration II Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services September 2000, Revision A.1 Action Field The action field defines where the message should be forwarded. It can have any one of the following forms: ● /filename The absolute path for log file is required. Note – This file must be manually created if it does not exist. ● @host You must prefix the host name or IP address with an @ sign. Messages are forwarded to the syslogd of the remote system. ● user1 , user2 user1 and user2 receive messages if they are logged in. ● * All logged-in users will receive messages. 3 Solaris Operating Environment syslog 3-9 Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services September 2000, Revision A.1 The /etc/syslog.conf File A sample /etc/syslog.conf configuration file is: #ident "@(#)syslog.conf 1.5 98/12/14 SMI" /* SunOS 5.0 */ # # Copyright (c) 1991-1998, by Sun Microsystems, Inc. # All rights reserved # # syslog configuration file. # # This file is processed by m4 so be careful to quote (‘’) names # that match m4 reserved words. Also, within ifdef's, arguments # containing commas must be quoted. # *.err;kern.notice;auth.notice /dev/sysmsg *.err;kern.debug;daemon.notice;mail.crit /var/adm/messages *.alert;kern.err;daemon.err operator *.alert root *.emerg * # if a non-loghost machine chooses to have authentication messages # sent to the loghost machine, un-comment out the following line: #auth.notice ifdef(‘LOGHOST’, /var/log/authlog, @loghost) mail.debug ifdef(‘LOGHOST’, /var/log/authlog, @loghost) # # non-loghost machines will use the following lines to cause "user" # log messages to be logged locally. # ifdef (‘LOGHOST’, , user.err /dev/sysmsg user.err /var/adm/messages user.alert ‘root, operator’ user.emerg * ) 3 3-10 Solaris™ 8 Operating Environment System Administration II Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services September 2000, Revision A.1 Starting and Stopping syslogd The configuration file is read each time syslogd starts. The /etc/rc2.d/S74syslog file starts syslogd during each system boot. You can manually start or stop syslogd, if the configuration file has been modified, with the command: # /etc/init.d/syslog start | stop [...]... DiskSuite 4 .2 User’s Guide, Part Number 80 6- 320 5-10 q 4 -2 System Administration Guide, Volume I, Part Number 80 5- 72 28 Sun Enterprise Volume Manager 2. 5 Administration Guide, Part Number 80 5-1607 Solaris 8 Operating Environment System Administration II Copyright 20 00 Sun Microsystems, Inc All Rights Reserved Enterprise Services September 20 00, Revision A.1 4 Physical Disks In a standard Solaris 8 Operating... September 20 00, Revision A.1 3 Detailed Operation You must first consider two examples of the host1 system s /etc/hosts file Note – These /etc/hosts file examples have been excerpted for brevity Example A 1 92. 9 .20 0.1 host1 loghost 1 92. 9 .20 0 .2 host2 Example B 1 92. 9 .20 0.1 host1 1 92. 9 .20 0 .2 host2 loghost You must next consider two examples of the m4 command line 1 /usr/ccs/bin/m4 /etc/syslog.conf 2 /usr/ccs/bin/m4... grow a file system 4-1 Copyright 20 00 Sun Microsystems, Inc All Rights Reserved Enterprise Services September 20 00, Revision A.1 4 Additional Resources Additional resources – The following references provide additional details on the topics discussed in this module: q q System Administration Guide, Volume II, Part Number 80 5- 722 9 q Solstice DiskSuite 4 .2. 1 Reference Guide, Part Number 80 6- 320 4-10 q Solstice... log message priority and severity u Determine the effect of the LOGHOST variable on the syslog process u Describe the two methods of starting the syslogd daemon u 3 -24 Configure syslog message routing Add entries to a system log using the logger utility Solaris 8 Operating Environment System Administration II Copyright 20 00 Sun Microsystems, Inc All Rights Reserved Enterprise Services September 20 00,... structure is assembled and managed transparently /dev/md/dsk/d 42 d 42 is called a metadevice /dev/rdsk/c0t0d0s7 /dev/rdsk/c0t1d0s4 /dev/rdsk/c0t2d0s6 Figure 4-1 4-6 Solstice DiskSuite Management of Disk Slices Solaris 8 Operating Environment System Administration II Copyright 20 00 Sun Microsystems, Inc All Rights Reserved Enterprise Services September 20 00, Revision A.1 4 Sun StorEdge Volume Manager Sun StorEdge... utility to better monitor your system, perform the following steps: 1 Configure syslog logging for the login and telnet daemons a Make a backup file of the original /etc/syslog.conf file # cp /etc/syslog.conf /etc/syslog.conf.orig 3 -20 Solaris 8 Operating Environment System Administration II Copyright 20 00 Sun Microsystems, Inc All Rights Reserved Enterprise Services September 20 00, Revision A.1 3 b Edit... Enterprise Services September 20 00, Revision A.1 3 4 Exit the telnet session, and observe the syslog entry # exit Connection closed by foreign host Note – Nothing is logged when you exit the telnet session 5 Press Control-C to stop the output of the tail command running in the other window 3 -22 Solaris 8 Operating Environment System Administration II Copyright 20 00 Sun Microsystems, Inc All Rights Reserved... bundled with the Solaris 8 Operating Environment server release can be used to expand (or grow) the size of a file system using concatenation 4 -8 Solaris 8 Operating Environment System Administration II Copyright 20 00 Sun Microsystems, Inc All Rights Reserved Enterprise Services September 20 00, Revision A.1 4 Adding a Disk Before you can use the disk management tools to configure additional disk space,... q Create a /reconfigure file and reboot the system The disadvantage to these methods is that each requires you to reboot the system In today’s computer environments, many systems have a 24 hours a day, seven days a week (24 x7) uptime requirement; therefore, rebooting the system to add new devices is not an option The devfsadmd Daemon For systems that have a 24 x7 uptime requirement, you can add new devices... the system 4-10 Solaris 8 Operating Environment System Administration II Copyright 20 00 Sun Microsystems, Inc All Rights Reserved Enterprise Services September 20 00, Revision A.1 4 Installing the Solstice DiskSuite Software The following steps describe how to install the Solstice DiskSuite application software to manage the disk partitions of multiple disks and multiple controllers: 1 Insert the Solaris . Volume 2, Part Number 80 5- 722 9-10 ● System Administration Guide, Volume 3, Part Number 80 6-0916-10 3 3 -2 Solaris 8 Operating Environment System Administration II Copyright 20 00 Sun Microsystems,. 13:15:39 host1 inetd [23 59]:[ID 317013 daemon.notice] telnet [23 61] from 1 92. 9 .20 0.1 4 580 0 3 3- 18 Solaris 8 Operating Environment System Administration II Copyright 20 00 Sun Microsystems, Inc. All. examples have been excerpted for brevity. Example A 1 92. 9 .20 0.1 host1 loghost 1 92. 9 .20 0 .2 host2 Example B 1 92. 9 .20 0.1 host1 1 92. 9 .20 0 .2 host2 loghost You must next consider two examples of the

Ngày đăng: 14/08/2014, 02:22

Tài liệu cùng người dùng

Tài liệu liên quan