AIX has a special system daemon, syslogd, used to record system information. the configuration file is in/etc/syslog. conf. this file describes the destination and activation event when the syslogd daemon sends information. There is also a/etc/syslog. pid file and syslog. conf, syslog... AIX has a special system daemon, syslogd, used to record system information. the configuration file is in/etc/syslog. conf. this file describes the destination and activation event when the syslogd daemon sends information.
There is also a/etc/syslog. pid file that works with syslog. conf. syslog. pid has only one line of content. the syslogd daemon process ID can be used to terminate or configure the log daemon process.
We can customize the/etc/syslog. conf file to define the destination and reflection mechanism of system information.
# Cat/etc/syslog. conf
# @ (#) 34 1.11.2.1 src/bos/etc/syslog. conf, net, bos61N, n20151113b1 2/21/11 04:02:04
# IBM_PROLOG_BEGIN_TAG
# This is anautomatically generated prolog.
#
# Bos61Nsrc/bos/etc/syslog. conf 1.11.2.1
#
# LicensedMaterials-Property of IBM
#
# COPYRIGHTInternational Business Machines Corp. 1988,1989
# All RightsReserved
#
# US GovernmentUsers Restricted Rights-Use, duplication or
# Disclosurerestricted by gsa adp Schedule Contract with IBM Corp.
#
# IBM_PROLOG_END_TAG
#
# COMPONENT_NAME: (CMDNET) Network commands.
#
# FUNCTIONS:
#
# ORIGINS: 27
#
# (C) COPYRIGHTInternational Business Machines Corp. 1988,198 9
# All RightsReserved
# LicensedMaterials-Property of IBM
#
# US GovernmentUsers Restricted Rights-Use, duplication or
# Disclosurerestricted by gsa adp Schedule Contract with IBM Corp.
#
#/Etc/syslog. conf-control output of syslogd
#
#
# Each line mustconsist of two parts :-
#
#1) A selectorto determine the message priorities to which
# Line applies
#2) An action.
#
# Each line cancontain an optional part :-
#
#3) Rotation.
#
# The fieldsmust be separated by one or more tabs or spaces.
#
# Format:
#
# [Rotate [size K | m] [files ] [Time H | d | w | m | y] [compress] [archive]
#
# Where Is a semicolon separated list .
# Where:
#
# Is:
# *-All (random T mark)
# Mark-time marks
Function option
# Kern, user, mail, daemon, auth,... (seesyslogd (AIX Commands Reference ))
#
# Is one of (from high to low ):
Error priority
# Emerg/panic, alert, crit, err (or), warn (ing), notice, info, debug
# (Meaning all messages of this priority orhigher)
#
# Is:
#/Filename-log to this file
# Username [, username2. ..]-write touser (s)
# @ Hostname-send to syslogd on thismachine
# *-Send to all logged in users
#
# [Rotate [size K | m] [files ] [Time H | d | w | m | y] [compress] [archive] is:
# If Is a regular fileand the word "rotate" is
# Specified, then Is limited by either
# Or , Or both And . Causes
# To be limited , Files
# Kept in the rotation. Causes To be rotated after
# . If bothAnd Are specified then logfiles
# Will be rotated once the logfilesize exceeds
# Or after , Whichever isearlier. The rotated filenames
# Are created by appending a period and anumber ,
# Starting with ". 0 ".
#
# If compress option is specified then thelogfile names will be
# Generated with a ". Z" extension. The files keyword will be applicable
# To the logfiles which are currentlyunder rotation. For example
# If we specify the compress option thenonly fileis with ". Z" extension
# Will be under rotation and number ofsuch files will be limited
# Files. Any logfiles withan extension other than ". Z"
# Will not be under the rotation schemeand thus will not be
# The limit Files. Similarly if we remove the compress
# Option then the files which have beengenerated with ". Z" extension
# Will no longer be the part of rotationscheme and will not be limited
# By Files.
#
# The minimum size that can be specifiedis 10 k, the minimum
# Number of files that can be specified is2. The default
# Size is 1 m (meg) and the default Is unlimited.
# Therefore, if only "rotate" isspecified, the log will be
# Rotated = 1 m.
# The compress option means that rotatedlog files that are not
# In use will be compressed.
# The archive option will save rotated logfiles that are not
# In use.
# The default is not to rotate log files.
#
# Example:
# "Mailmessages, at debug or higher, go to Log file. File must exist ."
# "Allfacilities, at debug and higher, go to console"
# "Allfacilities, at crit or higher, go to all users"
# Mail. debug/usr/spool/mqueue/syslog
# *. Debug/dev/console
# *. Crit *
# *. Debug/var/log/syslog. out rotate size 100 k files 4
# *. Crit/var/log/syslog. out rotate time 1d
*. Info/var/adm/ras/syslog. caarotate size 1 m files 10
/Etc/syslog. conf can be used to customize the generation and output of system logs. after editing, restart syslogd to take effect.
The following are some basic startup and shutdown commands:
#
# Lssrc-s syslogd
Subsystem Group PID Status
Syslogd ras 5177376 active
# Cat/etc/syslog. pid
5177376
# Ps-ef | grep syslogd
Root 5177376 2162834 0 Feb 01-/usr/sbin/syslogd
Root 5898452 5767218 0 10:49:35 pts/1 grep syslogd
# Stopsrc-s syslogd
0513-044 Thesyslogd Subsystem was requested to stop.
# Ps-ef | grep syslogd
Root 5898454 5767218 0 10:50:01 pts/1 grep syslogd
# Startsrc-s syslogd
0513-059 Thesyslogd Subsystem has been started. Subsystem PID is 5898456.
# Ps-ef | grep syslogd
Root 5898456 2162834 0 10:50:09-/usr/sbin/syslogd
Root 7209178 5767218 0 10:50:20 pts/1 grep syslogd
#
Custom instance: www.2cto.com
1. record all debugging-level or higher Mail function messages to the file/tmp/mailsyslog. you can enter the following command:
Mail. debug/tmp/mailsyslog
Where:
Mail is a function.
Debug is the priority.
/Tmp/mailsyslog is the target.
2. send all system messages except from the email function to the host named rigil (IP addresses can be directly used here). run the following command:
*. Debug; mail. none @ rigil
Where:
* And mail are functions.
Debug and none are priorities.
@ Rigil is the target.
3. send emerg priority messages from all functions, crit messages from emails and daemon, and other priority messages to nick and jam users. run the following command:
*. Emerg; mail, daemon. crit nick, jam
Where:
* Mail and daemon are functions.
Emerg and crit are priorities.
Nick and jam are targets.
4. run the following command to send all email function messages to the terminal screens of all users:
Mail. debug *
Where:
Mail is a function.
Debug is the priority.
* Is the target.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service