aix9910
48
October 1999
3
9
36
46
49
Analysing core files remotely
Message of the day
A public domain network monitor
A herald generator
November 1995 – October 1999
index
56 AIX news
© Xephon plc 1999
AIX Update
Published by
Editor
Xephon
27-35 London Road
Newbury
Berkshire RG14 1JL
England
Telephone: 01635 550955
From USA: 01144 1635 33823
E-mail: [email protected]
Harold Lewis
Disclaimer
Readers are cautioned that, although the information in this journal is presented in good
faith, neither Xephon nor the organizations or
individuals that supplied information in this
journal give any warranty or make any repreNorth American office
sentations as to the accuracy of the material it
contains. Neither Xephon nor the contributXephon/QNA
ing organizations or individuals accept any
1301 West Highway 407, Suite 201-405
liability of any kind howsoever arising out of
Lewisville, TX 75077-2150
the use of such material. Readers should
USA
satisfy themselves as to the correctness and
Telephone: 940 455 7050
relevance to their circumstances of all advice,
Contributions
information, code, JCL, scripts, and other
If you have anything original to say about contents of this journal before making any
AIX, or any interesting experience to use of it.
recount, why not spend an hour or two putting
it on paper? The article need not be very long Subscriptions and back-issues
– two or three paragraphs could be sufficient. A year’s subscription to AIX Update, comNot only will you actively be helping the free prising twelve monthly issues, costs £180.00
exchange of information, which benefits all in the UK; $275.00 in the USA and Canada;
AIX users, but you will also gain professional £186.00 in Europe; £192.00 in Australasia
recognition for your expertise and that of
your colleagues, as well as being paid a and Japan; and £190.50 elsewhere. In all
publication fee – Xephon pays at the rate of cases the price includes postage. Individual
£170 ($250) per 1000 words for original issues, starting with the November 1995 issue, are available separately to subscribers
material published in AIX Update.
for £16.00 ($23.00) each including postage.
To find out more about contributing an
article, see Notes for contributors on AIX Update on-line
Xephon’s Web site, where you can download Code from AIX Update is available from
Notes for contributors in either text form or as Xephon’s Web page at www.xephon.com/
an Adobe Acrobat file.
aixupdate (you’ll need the user-id shown on
your address label to access it).
© Xephon plc 1999. All rights reserved. None of the text in this publication may be
reproduced, stored in a retrieval system, or transmitted in any form or by any means, without
the prior permission of the copyright owner. Subscribers are free to copy any code reproduced
in this publication for use in their own installations, but may not sell such code or incorporate
it in any commercial product. No part of this publication may be used for any form of
advertising, sales promotion, or publicity without the written permission of the publisher.
Copying permits are available from Xephon in the form of pressure-sensitive labels, for
application to individual copies. A pack of 240 labels costs $36 (£24), giving a cost per copy
of 15 cents (10 pence). To order, contact Xephon at any of the addresses above.
Printed in England.
2
Analysing core files remotely
The article Who is to blame for the core file? (Werner Klauser, AIX
Update 41, March 1999) explained the ins and outs of locating and
analysing core files. For larger systems, the manual processing of core
files is tedious, and so a script that performs this task is a useful tool.
An example of when such a script is particularly useful is during the
development and debugging of distributed systems, where several
workstations have intercommunicating processes.
In this article we provide a script that remotely and automatically
locates and analyses cores on several machines.
As the previous article in AIX Update stated, a core file is normally
generated when the operating system detects certain error conditions
and sends a signal to the process. These signals are defined in /usr/
include/signal.h, and include, for example, SIGSEG (signal ‘11’),
which typically occurs when an array access is ‘out of bounds’.
Alternatively, you could trigger a core dump manually using the
command kill -11 <pid>, since the handling of this signal triggers a
core dump by default. The signal may also result in an entry in the error
log, which can be viewed using the command errpt -a | more. AIX
provides an optional ‘findcore’ package in /usr/samples that makes
use of the error log, and AIX support staff can usually analyse cores
when provided with the output file /tmp/ibmsupt that is generated by
running the command snap -g. You can locate cores manually using
the find command, determine the originating program using lquerypv
-n core 6b0 16, and analyse them using dbx. For simplicity, our script
is similar to this manual procedure, though the methods used in the
findcore package would also have advantages.
AUTOMATED REMOTE ANALYSIS
Now suppose we are interested in monitoring several machines for
cores. The operations we would like to be able to perform on the cores
are: locate, dbx, and remove. We’ve created a script to accomplish
this, where the script can be invoked with the following command:
probe_site.csh [-x] [-r] machines
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
3
where:
•
x
Extracts the cores through dbx
•
r
Erases the core
•
machines
Is a list of hostnames of machines to be searched.
The default action is simply to list the locations of core files on the
specified machines.
As the script depends on remotely executing commands via the rsh
command, the remote hosts must enable password-less login through
the /.rhosts file.
When the filesystems are large, locating core files can be time
consuming. In our case, cores are located only beneath certain
directories, this standard being enforced by programs running the
chdir subroutine before a core dump. In order to extract the program
stack using dbx, the location of the executable must be known. In
order to save time, our script introduces the variables coreSearchDirs
and exeSearchDirs as a list of directories to be searched. Of course,
you could just set both variables to ‘/’ if execution time is not
important.
Note that we used the output of the dbx core instead of lquerypv to
determine the executable name, as we found this easier to parse.
Below are listings of the scripts and a sample output when the scripts
are invoked by the following command:
probe_site.csh -x cam094 > probe_site.out
By examining the output with some knowledge of the distributed
system, we might conclude that a possible race condition exists
between producers and consumers of an initialization state – the
processes dumped cores because they tried to use data before another
process had initialized it.
Note the use of the continuation character, ‘➤’, in the code that follows
to indicate that one line of code maps to several lines of text.
4
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
PROBE_SITE.CSH
############### probe_site.csh ##################
#!/bin/csh -f
#
# Utility to list and optionally dbx and remove cores
#
# Name: probe_site.csh
#
# Usage:
#
probe_site.csh [-r] [-x] nodes ...
#
-r option causes the script to remove all found core files.
#
-x option to obtain a dbx stack trace from the core.
#
nodes is a list of nodes to check
#
# March 1999 Andre Scheunemann and Jeff Towers
#
Initial Version
#
set
set
set
set
set
➤
thisNode=`hostname`
removeCores=""
dbxCores=""
coreSearchDirs=("/user_fs/dae/err" "/user_fs/user_fs1/log")
exeSearchDirs=("/user_fs/dae/bin" "/user_fs/clmscnf/exercises"
"/user_fs/simex_plus/conf/utilities" "/user_fs1/ship/excon")
#
# parse command line for dbx and remove options
#
while ( 1 )
switch ( "$1" )
case "-r":
set removeCores="YES"
breaksw
case "-x":
set dbxCores="YES"
breaksw
default:
break
endsw
shift
end
set nodes="$*"
if ( "$nodes" == "" ) then
echo "Syntax: $0 [-x] [-r] nodes
exit
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
5
endif
foreach node ( $nodes )
echo "================================= $node
➤ ================================="
set found=`ping -c 1 $node |& grep "1 packets received"`
if ( "$found" == "") then
echo "Node $node not responding to ping."
continue
endif
set cores=""
set i=1
while ( $i <= $#coreSearchDirs )
set d="$coreSearchDirs[$i]"
if ( "$node" == "$thisNode" ) then
set cores=($cores `find $d -name core -ls`)
else
set cores=($cores `rsh $node -l root find $d -name core -ls`)
endif
@ i = $i + 1
end
# while ( $i < $#coreSearchDirs )
if ( "$cores" != "" ) then
echo "Core Files:"
set i=1
while ( $i <= $#cores )
@ a = $i + 10
@ b = $i + 7
@ c = $i + 8
@ d = $i + 9
set f=$cores[$a]
set prog=""
set ex=""
#
# Try to obtain the executable name from the core file.
#
set t=`rsh $node -l root "(cd $f:h; echo quit | dbx core) |& grep
➤ 'Core file program'"`
set prog=`echo $t | awk '{print $4}' | sed -e 's/(//;s/)//'`
set coreDate="$cores[$b] $cores[$c] $cores[$d]"
echo "==>
6
$f [$prog] ($coreDate)"
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
if ( "$dbxCores" == "YES" ) then
#
# Search for a file that matches the program name under one of
# the directories that may contain the executables.
# We then invoke dbx using the found executable and extract the
# stack trace.
#
if ( "$prog" != "" ) then
set j=1
while ( $j <= $#exeSearchDirs && "$ex" == "" )
set ex=`rsh $node -l root find "$exeSearchDirs[$j]" -name
➤ $prog -print`
@ j = $j + 1
end
# while ( $j < $#exeSearchDirs )
if ( "$ex" != "" ) then
#
# If we find the matching executable we get the stack
# trace. Keep only the first match found.
#
if ( $#ex > 1 ) set ex=$ex[1]
echo "dbx $ex core"
rsh $node -l root "echo 'where; quit' | dbx $ex $f |&
➤ fgrep –v 'warning: Unable to access'"
echo "--------------------------------------------------➤ -----------"
echo ""
else
echo "Unable to locate corresponding executable: $prog"
endif
else
echo "Unable to determine executable from core file.":
endif
endif
# if ( $dbxCores == YES )
#
# Now handle removal of core files if requested.
#
if ( "$removeCores" == "YES" ) then
rsh $node -l root "rm -f $f"
endif
@ i = $i + 11
end
# while ( $i <= $#cores )
echo ""
endif
# if ( $cores != empty )
end
# foreach ( $nodes )
############### probe_site.csh ##################
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
7
PROBE_SITE.OUT
############### probe_site.out ##################
============================ cam094 ==============================
Core Files:
==> /user_fs/user_fs1/log/coreAP2/core [ap2c0_excon.exe.287]
➤ (Apr 13 15:17)
dbx /user_fs/clmscnf/exercises/126/ap2c0_excon.exe.287 core
Type 'help' for help.
warning: The core file is truncated. You may need to increase the
ulimit for file and coredump, or free some space on the filesystem.
reading symbolic information ...
[using memory image in /user_fs/user_fs1/log/coreAP2/core]
IOT/Abort trap in raise at 0xd007fa14
0xd007fa14 (raise+0x20) 80410014
l
r2,0x14(r1)
raise(??) at 0xd007fa14
abort() at 0xd001b8a8
abort_logger_(??, ??, ??, ??), line 1179 in "cel_routines.c"
Init_Role(), line 198 in "init_role.c"
AInit(), line 193 in "ainit12_deb.c"
aevent_usleep(0xa), line 144 in "aevent_usleep.c"
aevent_usleep_front(0xa), line 36 in "aevent_front.c"
adisp_usleep(0xa), line 421 in "displib.c"
ainitdisp(), line 327 in "ainitdisp.c"
main(argc = 4, argv = 0x2ff216dc, 0x2ff216f0, 0x2, 0x2ff22ff8, 0x0,
➤ 0x42, 0x80000000), line 97 in "adisp.c"
-------------------------------------------------------------==> /user_fs/user_fs1/log/coreAP1/core [ap1c0_geo_pws.exe.225]
➤ (Apr 13 15:17)
dbx /user_fs/clmscnf/exercises/126/ap1c0_geo_pws.exe.225 core
Type 'help' for help.
warning: The core file is truncated. You may need to increase the
ulimitfor file and coredump, or free some space on the filesystem.
reading symbolic information ...
[using memory image in /user_fs/user_fs1/log/coreAP1/core]
IOT/Abort trap in raise at 0xd007fa14
0xd007fa14 (raise+0x20) 80410014
l
r2,0x14(r1)
raise(??) at 0xd007fa14
abort() at 0xd001b8a8
abort_logger_(??, ??, ??, ??), line 1179 in "cel_routines.c"
Init_Role(), line 198 in "init_role.c"
AInit(), line 185 in "ainit7.c"
aevent_usleep(0xa), line 144 in "aevent_usleep.c"
aevent_usleep_front(0xa), line 36 in "aevent_front.c"
adisp_usleep(0xa), line 421 in "displib.c"
ainitdisp(), line 327 in "ainitdisp.c"
main(argc = 4, argv = 0x2ff21888, 0x2ff2189c, 0x2, 0x2ff22ff8, 0x0,
8
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
➤ 0x42, 0x80000000), line 97 in "adisp.c"
-------------------------------------------------------------############### probe_site.out ##################
Andre Scheunemann and Jeff Towers
Software Analysts
CAE Electronics Ltd (Canada)
© Xephon 1999
Message of the day
INTRODUCTION
This article presents two scripts for managing the ‘message-of-theday’: mmotd.sh, which manages the message-of-the-day, and
rmotd.sh, which replaces the message-of-the-day. In AIX, the contents
of the /etc/motd file are automatically displayed at logon. The scripts
allows this message file to be maintained, allowing users to manipulate
its entries. The script mmotd.sh provides the following options:
•
Add a message-of-the-day
•
Modify the message-of-the-day
•
Delete the message-of-the-day
•
View a specific message-of-the-day
•
View the message file
•
Add a default message
•
Modify the default message
•
Initialize the message file
•
Initialize rmotd’s log file
•
View rmotd’s log file
•
Replace the current motd file.
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
9
rmotd.sh is a shell script that runs as a cron job to replace the contents
of /etc/motd file just after midnight every night. It replaces the
contents of the file with the day’s message from the message file. If
no message for the day is found in the message file, the default
message is used, so this should be maintained in the message file at all
times. The script also maintains a log file.
The mmotd.sh script allows users to add messages only for future
dates and/or the current day. As well as allowing these messages to be
displayed using the rmotd.sh script, mmotd.sh has an option for
replacing the current message-of-the-day file.
MAKING IT WORK
1
2
Set appropriate values for the following variables in the mmotd.sh
script:
–
$MESSAGE_DIR
–
$MESSAGE_FILE
–
$MOTD_PATH (where the scripts reside)
–
$RMOTD_LOG (the log file kept by rmotd.sh).
Set appropriate values for the following variables in the rmotd.sh
script:
–
$MESSAGE_DIR
–
$MESSAGE_FILE
–
$RMOTD_LOG (the log file kept by rmotd.sh).
3
Run mmotd.sh from root account to initialize a new message file
and to add new messages.
4
Make an entry in corncob file under root account as follows:
#
# replace message-of-the-day file at 12.01 am
#
1 0 * * * /home/ecatmgr/sh/rmotd.sh > /dev/null 2>&1
Note the continuation character, ‘➤’, in the code that follows to
indicate that one line of code corresponds to several lines of print.
10
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
MMOTD.SH (MANAGE MESSAGE-OF-THE-DAY)
#! /bin/ksh
#####################################################################
#
#
# mmotd.sh - manage the 'message-of-the-day'
#
#
#
# The script manages all aspects of message-of-the-day.
#
#
#
# Notes
1
The script contains following functions:
#
#
#
#
- InitialiseVariables
#
#
- HandleInterrupt
#
#
- MoveCursor
#
#
- DisplayMessage
#
#
- DisplayMenu
#
#
- ProcessOption
#
#
- GetMessage
#
#
- AddMessage
#
#
- ModifyMessage
#
#
- DeleteMessage
#
#
- ViewSpecificMessage
#
#
- ViewMessageFile
#
#
- AddDefaultMessage
#
#
- ModifyDefaultMessage
#
#
- InitializeMessageFile
#
#
- InitialiseRMOTDLogFile
#
#
- ViewRMOTDLogFile
#
#
- IsNumeric
#
#
- LeapYear
#
#
- IsValidDayOfMonth
#
#
- IsValidMonth
#
#
- IsValidYear
#
#
- ValidateInput
#
#
- GetMessageDate
#
#
- RootUser
#
#
- ProcessExit
#
#
- main
#
#
#
# History
#
# Date
Author
Description
#
# ----------------------------------------------------------------- #
# 09/02/99 A Zaman
Initial build
#
#
#
#####################################################################
#####################################################################
#
#
# InitialiseVariables
#
#
#
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
11
# This function initializes all required variables.
#
#
#
#####################################################################
InitialiseVariables()
{
# define locations
MESSAGE_DIR="/home/ecatmgr/motd"
MESSAGE_FILE="${MESSAGE_DIR}/motd.dat"
RMOTD_LOG="${MESSAGE_DIR}/rmotd.log" # log file written by rmotd.sh
TEMP_FILE="/tmp/mmotd_$$.tmp"
TEMP_FILE_1="/tmp/mmotd_$$_1.tmp"
MOTD_PATH="/home/ecatmgr/sh/temp" ; export MOTD_PATH
# define date-related variables
DAY=
# day of the message
MON=
# month of the message
YEAR=
# year of the message
# define message-related variables
MSG=
# message-of-the-day
# escape sequences
ESC="\0033["
RVON= [7m
RVOFF= [27m
BOLDON= [1m
BOLDOFF= [22m
BON= [5m
BOFF= [25m
#
#
#
#
#
#
reverse video on
reverse video off
bold on
bold off
blinking on
blinking off
# define menu title
MMOTD="${RVON}Manage message-of-the-day${RVOFF}"
# define exit codes
SEC=0
FEC=1
TRUE=0
FALSE=1
SLEEP_DURATION=4
# number of seconds for sleep command
ERROR="${RVON}${BON}mmotd.sh:ERROR:${BOFF}"
INFO="${RVON}mmotd.sh:INFO: "
# messages
INTERRUPT="Program interrupted! Quitting...${RVOFF}"
INVALID_OPTION="Invalid entry ${RVOFF}"
MOTD_EXISTS="A message exist for day \${DOTM}${RVOFF}"
DEFAULT_EXISTS="A default message already exists${RVOFF}"
12
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
MOTD_ADDED="Successfully added message for day \${DOTM}${RVOFF}"
MOTD_EMPTY="Message not modified\; empty message string${RVOFF}"
MOTD_NOT_ADDED="Failed to add message for day \${DOTM}${RVOFF}"
DMOTD_ADDED="Successfully added default message-of-the-day${RVOFF}"
DMOTD_NOT_ADDED="Failed to add default message-of-the-day${RVOFF}"
MSG_NOT_FOUND="No message exists for day \${DOTM}${RVOFF}"
DMSG_NOT_FOUND="No default message-of-the-day exist${RVOFF}"
MSG_FILE_EMPTY="Message file, \${MESSAGE_FILE}, is empty${RVOFF}"
MOTD_MODIFIED="Successfully modified message for day \${DOTM}${RVOFF}"
MOTD_NOT_MODIFIED="Failed to modify message for day \${DOTM}${RVOFF}"
DMOTD_MODIFIED="Successfully modified default message-of-the-day
➤ ${RVOFF}"
DDMOTD_MODIFIED="Failed to modify default message-of-the-day${RVOFF}"
EDIT_MSG="Modify the message and save the file${RVOFF}"
INVALID_ENTRY="Invalid entry ${RVOFF}"
INVALID_MONTH="\${MON}, is an invalid month ${RVOFF}"
INVALID_MONTH_YEAR="\${MON}, is an invalid month for year
➤ \$YEAR${RVOFF}"
INVALID_DAY="\${DAY}, is an invalid day for month, \${MON} ${RVOFF}"
INVALID_YEAR="\${YEAR}, is an invalid year ${RVOFF}"
NOT_NUMERIC="Value must be numeric${RVOFF}"
FILE_NOT_INITIALIZED="Failed to initialize the file
➤ \${FILE_NAME}${RVOFF}"
FILE_INITIALIZED="Successfully initialized the file
➤ \${FILE_NAME}${RVOFF}"
NO_MSG_FILE="Message file, \${MESSAGE_FILE}, does not exist${RVOFF}"
NO_RMOTD_LOG="Log file ,\${RMOTD_LOG} does not exist${RVOFF}"
OSERROR="\${OSEM}${RVOFF}"
ROOT_USER="The script must be executed from the root account${RVOFF}"
# define signals
SIGNEXIT=0 ; export
SIGHUP=1
; export
SIGINT=2
; export
SIGTERM=15 ; export
}
SIGNEXIT
SIGHUP
SIGINT
SIGTERM
#
#
#
#
normal exit
when session disconnected
ctrl-c
kill command
#####################################################################
#
#
# HandleInterrupt
#
#
#
# This function calls ProcessExit.
#
#
#
#####################################################################
HandleInterrupt ()
{
DisplayMessage I "${INTERRUPT}"
ProcessExit $FEC
}
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
13
#####################################################################
#
#
# MoveCursor
#
#
#
# This function moves the cursor to location (Y, X).
#
#
#
# Input
:
X and Y coordinates
#
#
#
# Notes
1
This must be run in ksh for print to work. Also,
#
#
print must be used to move the cursor as echo
#
#
does not seem to work.
#
#
#
#####################################################################
MoveCursor ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
YCOR=$1
XCOR=$2
echo "${ESC}${YCOR};${XCOR}H"
}
#####################################################################
#
#
# DisplayMessage
#
#
#
# This function displays a message.
#
#
#
# Input
1
Message type (E = Error, I = Information)
#
#
2
Error code, as defined in DefineMessages ( ).
#
#
#
#####################################################################
DisplayMessage ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
MESSAGE_TYPE=$1
MESSAGE_TEXT=`eval echo $2`
MoveCursor 24 1
if [ "${MESSAGE_TYPE}" = "E" ]
then
echo "`eval echo ${ERROR}`${MESSAGE_TEXT}\c"
else
echo "`eval echo ${INFO}`${MESSAGE_TEXT}\c"
fi
sleep ${SLEEP_DURATION}
return ${TRUE}
}
14
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
#####################################################################
#
#
# DisplayMenu
#
#
#
# This function displays the menu.
#
#
#
#####################################################################
DisplayMenu ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
clear
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
#######################################"
#
#"
#
$MMOTD
#"
#
#"
#
5 Add a message
#"
# 10 Modify a message
#"
# 15 Delete a message
#"
# 20 View a specific message
#"
# 25 View a message file
#"
# 30 Add a default message
#"
# 35 Modify the default message
#"
# 40 Initialize the message file
#"
# 45 Initialize the RMOTD log file #"
# 50 View the RMOTD log file
#"
# 55 Replace the current MOTD file #"
# 99 Exit
#"
#
#"
#######################################"
Enter your option --->\c"
read OPTION
}
#####################################################################
#
#
# ProcessOption
#
#
#
# This function processes a menu option.
#
#
#
#####################################################################
ProcessOption ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
case $OPTION in
5) AddMessage ;;
10) ModifyMessage ;;
15) DeleteMessage ;;
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
15
20)
25)
30)
35)
40)
45)
50)
55)
99)
* )
ViewSpecificMessage ;;
ViewMessageFile ;;
AddDefaultMessage ;;
ModifyDefaultMessage ;;
InitializeMessageFile ;;
InitialiseRMOTDLogFile ;;
ViewRMOTDLogFile ;;
ReplaceCurrentMotdFile ;;
clear; ProcessExit $SEC ;;
DisplayMessage E "${INVALID_OPTION}"
esac
}
#####################################################################
#
#
# GetMessage
#
#
#
# This function gets the required message.
#
#
#
#####################################################################
GetMessage ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
while true
do
clear
echo "Enter the message:\c"
read MSG
case "${MSG}" in
"" ) DisplayMessage E "${INVALID_ENTRY}" ;;
* ) break ;;
esac
done
}
#####################################################################
#
#
# AddMessage
#
#
#
# This function adds a message to the message file.
#
#
#
# Returns :
$TRUE or $FALSE
#
#
#
# Notes
1
The function checks for an existing message before
#
#
writing the current message.
#
#
#
#####################################################################
AddMessage ( )
{
16
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
# check for the existence of the file
if [ ! -f ${MESSAGE_FILE} ]
then
DisplayMessage E "${NO_MSG_FILE}"
return $FALSE
fi
# get the required message's date
GetMessageDate
# get the message
GetMessage
# check the existing entry
DOTM="${DAY}${MON}${YEAR}"
if grep "${DOTM}" ${MESSAGE_FILE} > /dev/null 2>&1
then
# a message exist for this day
DisplayMessage E "${MOTD_EXISTS}"
return $FALSE
fi
# write away the message
( echo "${DOTM}:${MSG}" 1>> ${MESSAGE_FILE} ) 2> ${TEMP_FILE}
if [ $? -ne 0 ]
then
DisplayMessage E "${MOTD_NOT_ADDED}"
OSEM=`cat ${TEMP_FILE}`
DisplayMessage E "${OSERROR}"
return $FALSE
else
DisplayMessage I "${MOTD_ADDED}"
return $TRUE
fi
}
#####################################################################
#
#
# ModifyMessage
#
#
#
# This function modifies a specific message.
#
#
#
# Returns :
$TRUE or $FALSE
#
#
#
#####################################################################
ModifyMessage ()
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
17
# check for the existence of the file
if [ ! -f ${MESSAGE_FILE} ]
then
# no message file found
DisplayMessage E "${NO_MSG_FILE}"
return $FALSE
fi
# get the required message's date
GetMessageDate
DOTM="${DAY}${MON}${YEAR}"
# get the required message
if ! grep "${DOTM}" ${MESSAGE_FILE} > ${TEMP_FILE} 2>&1
then
DisplayMessage E "${MSG_NOT_FOUND}"
return $FALSE
fi
# pick the message from temporary file
LINE="`cat ${TEMP_FILE}`"
MSG=`echo "${LINE}" | cut -d':' -f2`
echo "${MSG}" > ${TEMP_FILE}
DisplayMessage I "${EDIT_MSG}"
vi ${TEMP_FILE}
MSG=`cat ${TEMP_FILE}`
if [ "${MSG}" = "" ]
then
DisplayMessage E "${MOTD_EMPTY}"
return $FALSE
fi
# write the modified message
sed /^${DOTM}/d ${MESSAGE_FILE} > ${TEMP_FILE}
cp ${TEMP_FILE} ${MESSAGE_FILE}
( echo "${DOTM}:${MSG}" 1>> ${MESSAGE_FILE}) 2> ${TEMP_FILE}
if [ $? -ne 0 ]
then
DisplayMessage E "${MOTD_NOT_MODIFIED}"
OSEM=`cat ${TEMP_FILE}`
DisplayMessage E "${OSERROR}"
return $FALSE
else
DisplayMessage I "${MOTD_MODIFIED}"
return $TRUE
fi
}
#####################################################################
#
#
18
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
# DeleteMessage
#
#
#
# This function deletes a specific message from message file.
#
#
#
# Returns :
$TRUE or $FALSE
#
#
#
#####################################################################
DeleteMessage ()
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
# check for the existence of the file
if [ ! -f ${MESSAGE_FILE} ]
then
# no message file found
DisplayMessage E "${NO_MSG_FILE}"
return $FALSE
fi
# get the required message's date
GetMessageDate
DOTM="${DAY}${MON}${YEAR}"
# get the required message
if ! grep "${DOTM}" ${MESSAGE_FILE} > ${TEMP_FILE} 2>&1
then
DisplayMessage E "${MSG_NOT_FOUND}"
return $FALSE
fi
# delete the message
sed /^${DOTM}/d ${MESSAGE_FILE} > ${TEMP_FILE}
cp ${TEMP_FILE} ${MESSAGE_FILE}
return $TRUE
}
#####################################################################
#
#
# ViewSpecificMessage
#
#
#
# This function is used to view a specific message from the
#
# message file.
#
#
#
# Returns :
$TRUE or $FALSE
#
#
#
#####################################################################
ViewSpecificMessage ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
19
# check for the existence of the file
if [ ! -f ${MESSAGE_FILE} ]
then
# no message file found
DisplayMessage E "${NO_MSG_FILE}"
return $FALSE
fi
# get the required message's date
GetMessageDate
DOTM="${DAY}${MON}${YEAR}"
# get the required message
if ! grep "${DOTM}" ${MESSAGE_FILE} > ${TEMP_FILE} 2>&1
then
DisplayMessage E "${MSG_NOT_FOUND}"
return $FALSE
fi
# view the message
view ${TEMP_FILE}
return $TRUE
}
#####################################################################
#
#
# ViewMessageFile
#
#
#
# This function views all messages from message file.
#
#
#
# Returns :
$TRUE or $FALSE
#
#
#
# Notes
1
Messages are sorted in ascending order by date.
#
#
#
#####################################################################
ViewMessageFile ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
# check for the existence of the file
if [ ! -f ${MESSAGE_FILE} ]
then
# no message file found
DisplayMessage E "${NO_MSG_FILE}"
return $FALSE
fi
# check the message file for existing messages
20
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
if [ ! -s "${MESSAGE_FILE}" ]
then
DisplayMessage E "${MSG_FILE_EMPTY}"
return $FALSE
fi
# sort the message file, first removing the header
sed /^' '/d ${MESSAGE_FILE} > ${TEMP_FILE}
# add header to file for sorted messages
echo "
Message-of-the-day File
echo "
========================
# sort message file without the header
cat ${TEMP_FILE} |sort -t: -k 1.5,1.8
➤ ${TEMP_FILE_1}
" > ${TEMP_FILE_1}
" >> ${TEMP_FILE_1}
-k 1.3,1.4
-k 1.1,1.2 >>
# view the message file
c
view ${TEMP_FILE}
return $TRUE
}
#####################################################################
#
#
# AddDefaultMessage
#
#
#
# This function adds the default message to the message file.
#
#
#
# Returns :
$TRUE or $FALSE
#
#
#
# Notes
1
The function checks for existing message before
#
#
writing the current one.
#
#
#
#####################################################################
AddDefaultMessage ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
# check for the existence of the file
if [ ! -f ${MESSAGE_FILE} ]
then
DisplayMessage E "${NO_MSG_FILE}"
return $FALSE
fi
# check the existing entry
if grep "DEFAULT:" ${MESSAGE_FILE} > /dev/null 2>&1
then
# a default message already exist for this day
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
21
DisplayMessage E "${DEFAULT_EXISTS}"
return $FALSE
fi
# get the required message
GetMessage
# write the message
( echo "DEFAULT:${MSG}" 1>> ${MESSAGE_FILE} ) 2> ${TEMP_FILE}
if [ $? -ne 0 ]
then
DisplayMessage E "${DMOTD_NOT_ADDED}"
OSEM=`cat ${TEMP_FILE}`
DisplayMessage E "${OSERROR}"
return $FALSE
else
DisplayMessage I "${DMOTD_ADDED}"
return $TRUE
fi
}
#####################################################################
#
#
# ModifyDefaultMessage
#
#
#
# This function modifes the default message in the message file.
#
#
#
# Returns :
$TRUE or $FALSE
#
#
#
#####################################################################
ModifyDefaultMessage ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
# check for file existence
if [ ! -f ${MESSAGE_FILE} ]
then
# no message file found
DisplayMessage E "${NO_MSG_FILE}"
return $FALSE
fi
# get the required message
if ! grep "DEFAULT:" ${MESSAGE_FILE} > ${TEMP_FILE} 2>&1
then
DisplayMessage E "${DMSG_NOT_FOUND}"
return $FALSE
fi
LINE="`cat ${TEMP_FILE}`"
echo "${LINE}" ; read dummy
22
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
MSG=`echo "${LINE}" | cut -d':' -f2`
echo "${MSG}" > ${TEMP_FILE}
DisplayMessage I "${EDIT_MSG}"
MSG=`cat ${TEMP_FILE}`
if [ "${MSG}" = "" ]
then
DisplayMessage E "${MOTD_EMPTY}"
return $FALSE
fi
# write the modified message
sed /^DEFAULT/d ${MESSAGE_FILE} > ${TEMP_FILE}
( cp ${TEMP_FILE} ${MESSAGE_FILE} ) 2> ${TEMP_FILE_1}
if [ $? -ne 0 ]
then
DisplayMessage E "${DMOTD_NOT_MODIFIED}"
DisplayMessage E "${OSERROR}"
return $FALSE
OSEM=`cat ${TEMP_FILE_1}`
fi
( echo "DEFAULT:${MSG}" 1>> ${MESSAGE_FILE}) 2> ${TEMP_FILE}
if [ $? -ne 0 ]
then
DisplayMessage E "${DMOTD_NOT_MODIFIED}"
DisplayMessage E "${OSERROR}"
return $FALSE
else
DisplayMessage I "${DMOTD_MODIFIED}"
return $TRUE
fi
}
#####################################################################
#
#
# InitializeMessageFile
#
#
#
# This function initializes the message file.
#
#
#
# Notes
1
A default message-of-the-day is written as part
#
#
of this process.
#
#
#
#####################################################################
InitializeMessageFile ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
FILE_NAME="${MESSAGE_FILE}"
# check for the existence of the file
if [ ! -f ${MESSAGE_FILE} ]
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
23
then
# no message file exists, so initialize a new file
(> ${MESSAGE_FILE} ) > ${TEMP_FILE} 2>&1
if [ $? -ne 0 ]
then
DisplayMessage E "${FILE_NOT_INITIALIZED}"
OSEM=`cat ${TEMP_FILE}`
DisplayMessage E "${OSERROR}"
return $FALSE
else
DisplayMessage I "${FILE_INITIALIZED}"
# write header
echo "
➤ ${MESSAGE_FILE}
echo "
➤ ${MESSAGE_FILE}
Message-of-the-day
File
========================
" >
" >>
# write a default message
echo "DEFAULT:Welcome to AIX" >> ${MESSAGE_FILE}
return $TRUE
fi
fi
# get confirmation for initializing the existing file
while true
do
clear
echo "Message file, ${MESSAGE_FILE} exists"
echo "Confirm initialization (Y/N):\c"
read REPLY
case $REPLY in
Y) break ;;
N) return $FALSE ;;
*) DisplayMessage E "${INVALID_OPTION}" ;;
esac
done
# initialize existing message file
(> ${MESSAGE_FILE}) > ${TEMP_FILE} 2>&1
if [ $? -ne 0 ]
then
DisplayMessage E "${FILE_NOT_INITIALIZED}"
OSEM=`cat ${TEMP_FILE}`
DisplayMessage E "${OSERROR}"
return $FALSE
else
DisplayMessage I "${FILE_INITIALIZED}"
#
# write header
24
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
#
echo "
➤ ${MESSAGE_FILE}
echo "
➤ ${MESSAGE_FILE}
Message-of-the-day
File
========================
" >
" >>
# write a default message
echo "DEFAULT:Welcome to AIX" >> ${MESSAGE_FILE}
return $TRUE
fi
}
#####################################################################
#
#
# InitialiseRMOTDLogFile
#
#
#
# This function initializes the log file.
#
#
#
#####################################################################
InitialiseRMOTDLogFile ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
FILE_NAME="${RMOTD_LOG}"
# check for the existence of the file
if [ ! -f ${RMOTD_LOG} ]
then
# no log file exists, so initialize a new file
(> ${RMOTD_LOG}) > ${TEMP_FILE} 2>&1
if [ $? -ne 0 ]
then
DisplayMessage E "${FILE_NOT_INITIALIZED}"
OSEM=`cat ${TEMP_FILE}`
DisplayMessage E "${OSERROR}"
return $FALSE
else
DisplayMessage I "${FILE_INITIALIZED}"
# write header
echo "
Log File for Message-of-the-day Replacement" >
➤ ${RMOTD_LOG}
echo "
===========================================" >>
➤ ${RMOTD_LOG}
return $TRUE
fi
fi
# get confirmation for initializing existing file
while true
do
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
25
clear
echo "Log file, ${RMOTD_LOG} exists"
echo "Confirm initialization (Y/N):\c"
read REPLY
case $REPLY in
Y) break ;;
N) return $FALSE ;;
*) DisplayMessage E "${INVALID_OPTION}" ;;
esac
done
# initialize the log file
(> ${RMOTD_LOG}) > ${TEMP_FILE} 2>&1
if [ $? -ne 0 ]
then
DisplayMessage E "${FILE_NOT_INITIALIZED}"
OSEM=`cat ${TEMP_FILE}`
DisplayMessage E "${OSERROR}"
return $FALSE
else
DisplayMessage I "${FILE_INITIALIZED}"
# write header
echo "
Log file for Message-of-the-day replacement" >
➤ ${RMOTD_LOG}
echo "
===========================================" >>
➤ ${RMOTD_LOG}
return $TRUE
fi
}
#####################################################################
#
#
# ViewRMOTDLogFile
#
#
#
# This function views the log file, written by rmotd.sh script.
#
#
#
#####################################################################
ViewRMOTDLogFile ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
# check for the existence of the file
if [ ! -f ${RMOTD_LOG} ]
then
# no log file exists
DisplayMessage E "${NO_RMOTD_LOG}"
return $FALSE
fi
26
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
# view the file
cp ${RMOTD_LOG} ${TEMP_FILE}
view ${TEMP_FILE}
}
#####################################################################
#
#
# ReplaceCurrentMotdFile
#
#
#
# This function replaces current motd file with new one by
#
# invoking the script rmotd.sh.
#
#
#
#####################################################################
ReplaceCurrentMotdFile ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
${MOTD_PATH}/rmotd.sh
return $TRUE
}
#####################################################################
#
#
# IsNumeric
#
#
#
# This function checks a given value for to ensure it is numeric.
#
#
#
# Returns :
$TRUE or $FALSE
#
#
#
#####################################################################
IsNumeric ()
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
PARAM="$1"
ARGLEN=`expr "$PARAM" : '.*'`
INDEX=1
while [ $INDEX -le $ARGLEN ]
do
CHAR=`echo "$PARAM" | cut -c$INDEX-$INDEX`
if [ "${CHAR}" != "0" -a "${CHAR}" != "1" -a "${CHAR}" != "2" -a \
"${CHAR}" != "3" -a "${CHAR}" != "4" -a "${CHAR}" != "5" -a \
"${CHAR}" != "6" -a "${CHAR}" != "7" -a "${CHAR}" != "8" -a \
"${CHAR}" != "9" ]
then
DisplayMessage E "${NOT_NUMERIC}"
return $FALSE
fi
INDEX=`expr $INDEX + 1`
done
}
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
27
#####################################################################
#
#
# LeapYear
#
#
#
# This function checks whether a given year is a leap year.
#
#
#
# Input
:
$YEAR
#
#
#
# Returns :
$TRUE or $FALSE
#
#
#
#####################################################################
LeapYear ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
RESULT=`bc <<!
scale=2
$YEAR/4
!`
if [ "`echo $RESULT | cut -d'.' -f2`" = "00" ]
then
# year is a leap year
return $TRUE
else
# year is not a leap year
return $FALSE
fi
}
#####################################################################
#
#
# IsValidDayOfMonth
#
#
#
# This function validates a day for a given month.
#
#
#
# Input
:
a specific day
#
#
#
# Returns :
$TRUE or $FALSE
#
#
#
#####################################################################
IsValidDayOfMonth ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
P_DAY="$1"
# numeric day
CURMON=`date +%m`
CURDAY=`date +%d`
if [ $CURMON -eq $MON ]
then
if [ $P_DAY -eq $CURDAY -o $P_DAY -gt $CURDAY ]
then
28
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
:
else
DisplayMessage E "${INVALID_DAY}"
return $FALSE
fi
fi
# special processing for February
if [ "${MON}" = "02" ]
then
if LeapYear
then
if [ P_DAY -gt 0 -a P_DAY -lt 30 ]
then
# day is valid
return $TRUE
else
DisplayMessage E "${INVALID_DAY}"
return $FALSE
fi
else
if [ P_DAY -gt 0 -a P_DAY -lt 29 ]
then
# day is valid
return $TRUE
else
DisplayMessage E "${INVALID_DAY}"
return $FALSE
fi
fi
# process months with 31 days
elif [ "${MON}" = "01" -o "${MON}" = "03" -o "${MON}" = "05" -o \
"${MON}" = "07" -o "${MON}" = "08" -o "${MON}" = "10" -o \
"${MON}" = "12" ]
then
if [ P_DAY -gt 0 -a P_DAY -lt 32 ]
then
# day is valid
return $TRUE
else
DisplayMessage E "${INVALID_DAY}"
return $FALSE
fi
else
if [ P_DAY -gt 0 -a P_DAY -lt 31 ]
then
# day is valid
return $TRUE
else
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
29
DisplayMessage E "${INVALID_DAY}"
return $FALSE
fi
fi
}
#####################################################################
#
#
# IsValidMonth
#
#
#
# This function validates a given month.
#
#
#
# Input
:
Variable $MON
#
#
#
# Returns :
$TRUE or $FALSE
#
#
#
#####################################################################
IsValidMonth ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
PARAM="$1"
CURMON=`date +%m`
CURYEAR=`date +%Y`
if [ "${PARAM}" != "01" -a "${PARAM}" != "02" -a "${PARAM}" != "03" \
-a "${PARAM}" != "04" -a "${PARAM}" != "05" -a "${PARAM}" != "06" \
-a "${PARAM}" != "07" -a "${PARAM}" != "08" -a "${PARAM}" != "09" \
-a "${PARAM}" != "10" -a "${PARAM}" != "11" -a "${PARAM}" != "12" ]
then
DisplayMessage E "${INVALID_MONTH}"
return $FALSE
fi
# month must be equal to or greater than current month if the year
if [ $YEAR -eq $CURYEAR ]
then
if [ $PARAM -eq $CURMON -o $PARAM -gt $CURMON ]
then
return $TRUE
else
DisplayMessage E "${INVALID_MONTH_YEAR}"
return $FALSE
fi
else
return $TRUE
fi
}
#####################################################################
#
#
# IsValidYear
#
30
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
#
#
# This function validates a given year.
#
#
#
# Input
:
Variable $YEAR
#
#
#
# Returns :
$TRUE or $FALSE
#
#
#
#####################################################################
IsValidYear ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
PARAM="$1"
CURYEAR=`date +%Y`
# check the year is equal to or greater than the current one
if [ ${PARAM} -eq $CURYEAR -o ${PARAM} -gt $CURYEAR ]
then
return $TRUE
else
DisplayMessage E "${INVALID_YEAR}"
return $FALSE
fi
}
#####################################################################
#
#
# ValidateInput
#
#
#
# This function validates all date related values.
#
#
#
# Input
:
1 String that specifies the type of validation
#
#
2 Value to be validated.
#
#
#
#####################################################################
ValidateInput ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
VAL_TYPE="$1"
VALUE="$2"
# validate day
if [ "${VAL_TYPE}" = "DAY" ]
then
# check for number
if ! IsNumeric "${VALUE}"
then
return ${FALSE}
fi
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
31
# check for two digits
ARGLEN=`expr "$VALUE" : '.*'`
if [ $ARGLEN -ne 2 ]
then
DisplayMessage E "${INVALID_LENGTH}"
return ${FALSE}
fi
# validate day of the month
if ! IsValidDayOfMonth "${VALUE}"
then
return ${FALSE}
fi
# input is valid
return ${TRUE}
fi
# validate month
if [ "${VAL_TYPE}" = "MON" ]
then
# check for number
if ! IsNumeric "${VALUE}"
then
return ${FALSE}
fi
# validate month
if ! IsValidMonth "${VALUE}"
then
return $FALSE
fi
# input is valid
return ${TRUE}
fi
# validate year
if [ "${VAL_TYPE}" = "YEAR" ]
then
# check for number
if ! IsNumeric "${VALUE}"
then
return ${FALSE}
fi
# validate for appropriate four digits year
if ! IsValidYear "${VALUE}"
then
return ${FALSE}
fi
# input is valid
return ${TRUE}
fi
}
#####################################################################
32
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
#
#
# GetMessageDate
#
#
#
# This function gets the date for the message.
#
#
#
#####################################################################
GetMessageDate ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
MON=
DAY=
YEAR=
# get year for the message
while true
do
clear
echo "Enter the year (using four digits, eg 1999, 2000) for the
➤ message:\c"
read YEAR
case $YEAR in
"" ) DisplayMessage E "${INVALID_ENTRY}" ;;
* ) if ! ValidateInput "YEAR" "${YEAR}"
then
:
else
break ;
fi ;;
esac
done
# get month for the message
while true
do
clear
echo "Enter the month (using two digits eg 01, 10) for the
➤ message:\c"
read MON
case $MON in
"" ) DisplayMessage E "${INVALID_ENTRY}" ;;
* ) if ! ValidateInput "MON" "${MON}"
then
:
else
break ;
fi ;;
esac
done
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
33
# get day for the message
while true
do
clear
echo "Enter the day (using two digits eg 01, 10) for the
➤ message:\c"
read DAY
case $DAY in
"" ) DisplayMessage E "${INVALID_ENTRY}" ;;
* ) if ! ValidateInput "DAY" "${DAY}"
then
:
else
break ;
fi ;;
esac
done
}
#####################################################################
#
#
# RootUser
#
#
#
# This function checks whether the user is root.
#
#
#
# Returns :
TRUE if the user is root
#
#
FALSE otherwise
#
#
#
#####################################################################
RootUser ( )
{
trap "HandleInterrupt" $SIGINT $SIGTERM $SIGHUP
USER=`id | cut -d'(' -f2 | cut -d')' -f1`
if [ "${USER}" = "root" ]
then
return $TRUE
else
return $FALSE
fi
}
#####################################################################
#
#
# ProcessExit
#
#
#
# This function removes temporary files and makes a graceful exit. #
#
#
# Input
:
Exit code
#
#
#
34
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
#####################################################################
ProcessExit ( )
{
EXIT_CODE="$1"
clear
rm -f ${TEMP_FILE}
rm -f ${TEMP_FILE_1}
exit ${EXIT_CODE}
}
#####################################################################
#
#
# main
#
#
#
# This function invokes all other functions.
#
#
#
#####################################################################
main ( )
{
InitialiseVariables
if ! RootUser
then
DisplayMessage E "${ROOT_USER}"
ProcessExit $FEC
fi
while true
do
DisplayMenu
ProcessOption
done
}
# invoke main
main
This article concludes in next month’s issue with the script RMOTD.SH
(Replace Message-of-the-Day).
Arif Zaman (UK)
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
© Xephon 1999
35
A public domain network monitor
ntop is a public domain utility that gathers and displays statistics
about network traffic on the subnet to which the AIX host is connected.
ntop’s two main characteristics are that it’s able to gather and display
meaningful data in ways beyond the reach of an average system
administrator, and that it has a very advanced Web-based user interface.
NTOP INSTALLATION
The source code for ntop is available by FTP from the following URL:
http://www-serra.unipi.it/~ntop. At the time of writing, the latest
version of the program was 1.1, the source code being delivered in a
file called ntop-1.1.tar.gz. The program uses the lsof utility, which is
described in ‘Using lsof and lslk’ in AIX Update Issue 48 (September
1999). A pre-requisite of installing ntop is that the libpcap library
must be installed. Note that you should install the version of libpcap
that’s referred to by a link at ntop’s Web site. All my attempts to use
more recent versions of this library available from ftp://fpt.ee.lbl.gov/
resulted in non-operational versions of ntop. Also note that the
libpcap installation bundle is supplied as an executable file – this
should be executed first, and then the resulting directory used as the
input to the installp command (this procedure can also be done via
smit). The library and its support files are installed in /usr/local/lib.
After retrieval and unpacking of the archive file, you must configure
the software to match your version of Unix (AIX in our case). To do
so, you must change directory to the root directory of ntop source
code tree and issue the following command:
# ./configure
When the configure script terminates, the top-level directory of the
source code tree contains the source files and the makefile needed for
generation of ntop for your version of AIX.
The next step is to invoke make command to compile and link the
program:
# make.
36
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
Note that the executable generated should be run only on machines
that have the same level of the operating system as the system on
which the program was built. This is because the program is closely
tied to the structure of operating system internals that are frequently
altered by the operating system supplier. I was able to build and use
the program on AIX 4.1, 4.2.1, and 4.3.2.
ntop doesn’t need to be installed at a particular location in the
filesystem. However, the program requires read access to special
device files and, therefore, if it’s going to be used by a non-root user,
its ownership and permissions should be set using following commands:
# chown root.system
# chmod 6111 ntop
/usr/local/bin/ntop
The manual page that’s distributed with the program should be
installed in a directory that contains manual pages of other public
domain tools, for instance: /usr/local/man.
NTOP INVOCATION
There are two ways to invoke ntop – in ‘terminal’ mode and ‘Web’
mode. In the former, the command uses the ‘curses’ library (the curses
library is in /usr/lib/libcurses.a and is a library of functions that enable
the programmer to create applications that work in full-screen mode
on ASCII terminals) and directs its output to a terminal window. The
user is able to customize program display options interactively. In the
latter, the program executes as a daemon and reports its output using
the HTTP protocol, allowing multiple users to view the output using
just a standard Web browser.
The ntop command has following options:
•
-r <refresh_delay>
Specifies the number of seconds between screen updates, the
default being three seconds in terminal mode and 120 seconds in
Web mode. Note that, during screen updates, the program is
unable to process the network traffic fully.
•
-f <traffic_dump_file>
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
37
Directs the program to process a file containing network traffic
data collected by the tcpdump utility.
•
-n
Directs the program to display numeric IP addresses instead of
symbolic host names. This is useful if DNS name resolution is
slow or problematic.
•
-p <protocols>
This flag is used to select specific IP protocols for display. The
format is:
<label>=<protocol_list>[,<label>=<protocol_list>]
where <label> is a symbolic identifier for the protocol list. The
format of <protocol_list> is:
<protocol_name>[|<protocol_name>]
where <protocol_name> is a valid protocol name specified in the
/etc/services file or a numeric port range, such as ‘80’ or ‘70007500’. The default value, which is used when the –p argument is
omitted, is shown below (the whole value is one line, as indicated
by the continuation character, ‘➤’).
FTP=ftp|ftp-data,HTTP=http|www|https,DNS=name,Telnet=telnet,
➤ Nbios-IP=net-bios-ns,netbios-dgm|netbios-ssn,POP=pop-2|pop-3|
➤ kpop,SNMP=snmp|snmp-trap,NFS=mount|pcnfs|bwnfs|nfs|
➤ nfsd-status,X11=6000-6010
•
-i <interface>
Specifies the network interface to be used by ntop. This is useful
when the computer has more than one network interface and the
user needs to capture network traffic from a non-default interface.
•
-w <port_number>
Directs ntop to operate in Web mode. The program utilizes the
HTTP protocol, communicating through the port_number
specified by the -w flag. If port_number is ‘8888’, then users
should point their Web browser to the following URL: http://
ntophost:8888, where ntophost is the name of the host on which
ntop is running.
38
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
To control access to information broadcast by ntop, use
authentication based on user names and passwords. These are
based on the contents of the file ~/.ntop, which has the following
format:
#
# ~/.ntop file format
# name<tab_or_space>password
#
operator #@[email protected]#
•
-m <local_subnets>
This flag is used to specify subnets whose traffic is to be treated
as local. The format of local_subnets is:
<network_address>/<subnet_mask>[,<network_address>/<subnet_mask>]
For instance:
"134.54.0.0/255.255.255.0,167.12.0.0./255.255.192.0"
•
-l <loginterval>
Tells ntop to log collected statistics in the file ntop.log each
<loginterval> seconds. The format of this file is fairly selfexplanatory, and its contents are analysed using third-party tools,
such as gnuplot.
•
-F <flow_definitions>
This is used to define ‘flows’ or ‘streams’ of captured network
packets that match certain criteria. The format of
<flow_definitions> is:
<flow_label>='<matching_expression>'[,<flow_label>=
➤ '<matching_expression>']
where <flow_label> is a symbolic name for the flow. The syntax
of <matching_expression> is explained in the appendix to the
NTP User’s Guide, which can be downloaded from http://wwwserra.unipi.it/~ntop/.
•
[optional filter expression] This allows the user to limit data collected by the program to
include only traffic that matches criteria specified by the
expression. The syntax of the optional filter expression is identical
to that used to define flows.
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
39
NTOP IN INTERACTIVE (SCREEN) MODE
Figure 1 shows the information displayed when ntop is invoked in
interactive mode. The top line on the screen displays the version of the
command, the version of the host’s operating system, and the interface
being monitored. The second line displays the total and current
network throughput in packets and kilobytes.
The first column of the table contains the names of hosts that have
used the network to send or receive data. Hosts are identified by name,
if possible, or IP address. By pressing the ‘n’ key, the user can toggle
the display between symbolic name, IP address, MAC address, and
network interface manufacturer. The second column displays the type
of network by activity in the last period of measurement, possible
values being ‘I’ (Idle), ‘S’ (Send), ‘R’ (Receive), and ‘B’ (Both send
and receive). By default, only active hosts on the local subnet are
shown, though the ‘d’ key can be used to toggle between displaying
only active hosts or all hosts, and the ‘l’ key can be used to toggle
between displaying all communicating hosts or just hosts located on
the local subnet.
The third and fourth columns display the volume of data received and
sent by each host. By default, network traffic is displayed in kilobytes,
though pressing the ‘p’ key changes the display to percentages. The
column used to sort rows of data is highlighted by two dashes (the user
may select different columns by pressing the ‘t’ key). The last three
columns display traffic generated by three specific protocols, the
default ones being TCP, UDP, and ICMP. The user can select different
Figure 1: ntop’s opening screen in console mode
40
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
protocols by pressing the space bar. The ‘y’ key toggles the column
used for sorting to one of the last three.
NTOP IN WEB MODE
When the ntop is invoked in Web mode, users may view network
statistics collected by the program by pointing their browser to http:/
/ntop_host_name:ntop_port_number, where ntop_host_name is the
name of the host that executes ntop as a daemon and ntop_port_number
is the number of the port that was passed as an argument using ntop’s
-w flag (see Figure 2).
Figure 2: ntop’s Web interface
The left frame is the menu and the right one displays the actual
information. The user can sort table rows by clicking on the column
name. Additional information about various items displayed can be
obtained by clicking on the various hyperlinks in the tables. Clicking
on the hostname or IP address results in host-related statistics being
displayed (Figure 3 overleaf).
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
41
Figure 3: Additional host information available
The information is displayed in two tables. The first one contains the
following items:
•
Host’s IP address
•
MAC address
•
Network card vendor
•
Host’s location (local or remote subnet)
•
Total data sent/received in bytes and packets
•
Broadcast and multicast packets sent by the host
•
Distribution of sent and received data by local or remote
destination/source.
The second table contains information about the distribution of send
and receive data by protocol.
The host information table is sorted according to the bandwidth
generated by the host (Figure 4).
42
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
Figure 4: Host information table
The ‘IP subnet traffic matrix’ displays amounts of data exchanged
between different hosts, as shown in Figure 5.
Summaries are available about both sent and received data, and cells
are colour-coded according to level of traffic – cells with high values
have a red background, those with intermediate values have a green
background, and those with low values have a pink background.
Figure 5: The IP subnet traffic matrix
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
43
The network throughput screen (Figure 6) displays histograms of
average network throughput during both the last 60 minutes and the
last 24 hours.
Figure 6: Network throughput screen
Figure 7: Network traffic distribution
44
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
The network traffic distribution screen displays tables that detail the
distribution of network traffic by IP protocol type and remote or local
destination (Figure 7).
In addition to these charts, many other types of report are produced by
ntop in Web mode to display network traffic according to various
useful criteria.
SUMMARY
In my view, ntop is an outstanding program. Its usefulness goes well
beyond that of network utilities such as ping, traceroute, and tcpdump
that are supplied by the operating system vendors. While these
utilities allow system administrators to verify and diagnose basic
network connectivity, and the purchase of more expensive and complex
software, such as TME10 NetView, is necessary to collect meaningful
network statistics, ntop provides system and network administrators
with the means to answer difficult questions such as:
•
Why is local network performance so poor?
•
Who is using most of the available network bandwidth?
•
Which hosts are currently putting a heavy load on the NFS
server?
•
What percentage of network bandwidth does a certain network
host use?
•
Which hosts are connected to processes running on a certain
machine and what kind of traffic are they producing?
Additionally the program excels in the way the information is displayed,
featuring a clear and detailed Web interface.
I am sure that this program has the potential to be an indispensable tool
for every system and network administrator that supervises networks
of any size.
Alex Polak
System Engineer
APS (Israel)
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
© Xephon 1999
45
A herald generator
If an organization has many RS/6000s and uses telnet to access them,
it’s a good idea to ensure that users know exactly which machine they
are logging in to. A good way to do this is to provide a different login
prompt for each machine. This can easily be achieved by changing a
variable called herald in the /etc/security/login.cfg file.
To make this task even easier, I’ve written a small script that converts
a full-screen design to a herald variable string.
The AIX file reference defines a ‘herald’ thus:
“herald: Defines the login message printed when the getty
process opens the port. The default herald is the login prompt.
The value is a character string.”
If the herald is not specified for a port in login.cfg, then a default herald
is got from the message catalogue associated with the language set in
/etc/environment.
A possible format for login.cfg file is as follows (note the use of the
continuation character, ‘➤’, to indicate that one line of code maps to
more than one line of print):
default:
herald="\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\rIBM AIX
➤ Version 4 for RISC System/6000\n\r(C) Copyrights by IBM
➤ and by others 1982, 1991.\n\rlogin: "
/dev/console:
herald="\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\rIBM AIX
➤ Version 4 for RISC System/6000\n\r(C) Copyrights by IBM
➤ and by others 1982, 1991.\n\rCONSOLE LOGIN: "
/dev/tty12:
herald="\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\rIBM AIX
➤ Version 4 for RISC System/6000\n\r(C) Copyrights by IBM
➤ and by others 1982, 1991.\n\rTTY12 login: "
This shows that the herald variable can be used as default for all port’s
stanzas. It is possible also to have a different login prompt for each
‘tty’ port.
46
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
Customers usually want to make some kind of design in their login
prompts. To avoid the trial/error approach, one could create an ASCII
file with the desired result. To fill the initial file, you could use the
banner command. For example:
#banner RS/6000 >> heraldxx
#banner COMPANY >> heraldxx
Opening the file heraldxx using vi allows you to make the desired
changes using your artistic talents. Remember to use the same number
of lines you have available on the TTY on which you want to display
the login prompt (24 lines is the most common). An example of a
heraldxx file is shown below.
#####
#####
#
#
#
#
#
# #
#
#
#
# #
#####
#
#
#
#
#
#####
#
#
##
##
# # # #
# # #
#
#
#
#
#
#
######
#
#
#
#
######
#
#
#
#
# #
#
#
#
#
#######
#
#
#
#
#
# #
#
##
# #
#
# #
#
# #
# # #
#
#
# #
#
#
##
#
#
#
#
######
#####
# #####
###
###
###
#
# #
#
# #
# #
#
#
#
#
#
#
# #
# #
#
# #
# #
#
######
#####
# ###### #
# #
# #
#
#
#
# # #
# #
# #
# #
#
#
# #
# #
#
# #
#
#
#
#
#
#
# ##### #
#####
###
###
###
YOU ARE LOGGING MACHINE
IP ADDRESS 202.36.192.4
IBM AIX Version 4.3.x for RISC System/6000
(C) Copyrights by IBM and by others 1982, 1994
LOGIN:
The following shell script converts the heraldxx ASCII file to a
character string:
HERALD.SC
#!/bin/ksh
# Herald maker
# This shell script produces a herald variable
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
47
# to be pasted on /etc/login.cfg file
#remove the herstring file if it already exists
rm herstring 2>/dev/null
#usage test
if (( $# < 1 )); then
echo "type hermaker <herald file>"
exit
fi
#read the herald file and append to herstring
cat -n $1 | while read x1
do
x2=`echo "$x1" | cut -f2`
if [[ $x2 = +([1-9]) ]]; then
x3=$x3\\\\n
else
x3=$x3\\\\n\\\\r$x2
fi
done
echo "herald = \"$x3 \"" > herstring
Now you’re ready to paste the herald variable into login.cfg. It is
advisable to make a copy of login.cfg before changing it. Then open
login.cfg with vi, put the cursor below the desired point, and paste
‘herstring’. This is done from vi command line using the following
command:
:r herstring
Make sure that there are no blank lines between the herald variable and
the desired stanza. The login prompt will change when the next getty
process is created for that TTY.
Andre Barczak
Technical Consultant (New Zealand)
48
© Xephon 1999
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
November 1995 – October 1999 index
Below is an index of all topics covered in AIX Update since Issue 1,
November 1995. The numbers in bold are issue numbers, and the
numbers in brackets are page numbers. If you’d like to order backissues of AIX Update, please contact Xephon. You’ll find contact
information listed on page 2 – back-issues are available from Issue 1,
and can be obtained from any of Xephon’s offices.
Subject
ADA
addbib
ADSM
Issue (page)
15 (40)
7 (33-35)
Databases
15 (12-18)
Storage
6 (43),
16 (22-31)
Tape volumes
2 (24)
AIX
Enhancements 6 (14-19)
AIX 4.1
1 (32-33),
2 (3-4)
Printing
3 (8-9)
AIX 4.1.4
HACMP
15 (3)
man
13 (3-6)
AIX 4.1.5
25 (16-26)
AIX 4.2
11 (3-10)
AIX 4.2.1
22 (43-54)
AIX 4.3
22 (8-11)
64-bit
34 (33-45)
Documents
37 (9-17)
AIX 4.3.2
41 (3-19)
AIX BOS
21 (3)
AIX Connections
46 (5-6)
AIX Connections II
AIX 4.2.1
22 (53)
AIX hot fixes
26 (46-47)
AIX PDT
Performance
21 (3)
aixterm
33 (34-37)
aixtime
37 (17-29)
aixtimed
37 (17-29)
alt_disk_install
43 (3-13)
Archival
ADSM
16 (25)
arp
7 (7-8)
AS/400
9 (32-39)
AS/U
46 (7-9)
Subject
at
Issue (page)
13 (43-45),
18 (19-23)
audit
Script logging
17 (9)
AutoFS
36 (17-24)
Availability
7 (37)
awk
8 (9-25)
Back-up
6 (40-41)
ADSM
16 (24-25)
AIX 4.1
2 (3-4)
Tape
7 (22-32)
Utility
1 (21-29),
6 (10-14),
9 (9-27),
20 (3-18)
backup
7 (22-26)
batch
Sheduling
13 (43-45)
Batch jobs
5 (40-41)
Best/1
21 (3)
bison
15 (39)
Bonus Pack AIX 4.2
11 (4)
bsh
2 (6),
4 (22),
20 (45)
Bull Advanced Server
7 (40-41)
C and C++ for AIX 3.6
38 (53-54)
C for AIX 4.3
38 (50-52)
C/C++
Binding
43 (14-20)
C/C++ compilers
15 (39),
18 (41-43),
38 (50-55)
CA-Unicenter
6 (32-33)
CacheFS
30 (3-11)
CC-NUMA
35 (30-39),
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
49
Subject
CC-NUMA (cont)
CDE
AIX 4.2.1
ChangePassord()
C function
chdev
checkitall
_check_user
chps
ch_at
CICS
CICS for AIX
Issue (page)
36 (24-31)
22 (44-45)
38 (48-49)
1 (40)
42 (43-51),
43 (23-46)
33 (37-39)
22 (5-6)
37 (3-8)
12 (11-48)
2 (7-23),
3 (10-18)
6 (3-9)
15 (29-36)
29 (30-38)
15 (40)
6 (33)
20 (45-46)
46 (52-53)
11 (19-23)
6 (33)
Resources
cleantab
Client/server
clisp
Command Center
Command line interface
Command prompt
Command retrieval
Command/Post
Communication
Performance 22 (22-25)
compress
14 (50-51),
39 (6-7)
con
Report utility 38 (3-13)
configstatus
30 (11-25)
Core files
41 (52-55)
Remote systems 48 (3-9)
Coupled scripts
17 (3-4)
CPU
Status utility 44 (54-55)
cpuled
Utility
15 (41-42)
create.named
DNS utility 37 (31-50)
cron
13 (43-45)
csh
2 (6),
4 (22),
20 (45)
cu
24 (38-42)
Data migration
ADSM
16 (25-26)
Date and time
24 (48-50),
27 (46-47),
50
Subject
Date and time (cont)
Issue (page)
33 (13-34),
34 (17-32)
DB2/6000 ADSM
15 (16-17)
DC
CICS for AIX
2 (8-11)
DCE
42 (36-43),
43 (46-55),
44 (26-36)
/dev/hd6
Dump devices 41 (20-21)
DHCP
29 (15-29)
Disks
4 (23-27)
AIX 4.1
3 (42-43)
Bus
46 (9-10)
Implementing 36 (32-44)
Management
34 (46)
Mirroring
14 (36-49),
27 (3-17)
Partitioning
4 (25)
Performance
1 (17),
22 (18-22)
Report utility 21 (34-47),
44 (50-52),
46 (10-35)
Striping
4 (37)
VGs
5 (43),
47 (50-55)
DNS
37 (29-50),
40 (8-15)
resolv.conf
40 (12-14)
BIND
41 (5-6)
Configuring 37 (31-50)
NSLOOKUP
40 (11)
NSORDER
40 (11)
Zones
37 (30-31)
Documentation
On-line
37 (9-17)
Utility
2 (28-41),
9 (40-41),
10 (26-36)
DOS
Comms
2 (25-27),
2 (41-43),
4 (38-41),
5 (10-14)
Under AIX
5 (14-16)
dtscript
26 (11-20)
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
Subject
dur
E-mail
Issue (page)
Usage report 46 (10-35)
Migration
36 (3-17)
Utility
33 (3-12)
emacs
15 (40)
Encina
CICS for AIX 2 (11-14)
Enlighten
6 (33-34)
enscript
26 (36-38)
erdemon
15 (19)
errclear
25 (45)
errclear
15 (23)
errlogger
15 (23),
31 (16-17)
errmsg
31 (19-21)
Error logging
15 (18-23),
31 (16-21)
Errors
LC_MESSAGES 34 (47)
errorlog
25 (41-52)
errpt
15 (18-23),
25 (47-49),
31 (16-20)
/etc/group
37 (50-51)
/etc/passwd
37 (50-51)
Excel utility
38 (13-46),
39 (41-55)
Fast IPL
32 (40-42)
Fast IPL
Utility
17 (40-42)
Fault tolerance
1 (7)
Faxes
Utility
30 (30-36)
fdpr
1 (15),
22 (12-13)
File permissions
1 (33-37)
Filesystem Decreasing
31 (3-6)
Large files
30 (25-30)
Utility
23 (58-62),
24 (3-11)
Filesystems
32 (17-22)
Compression 14 (50-51),
39 (3-9)
fsck
34 (47)
LVM
41 (9-12)
Utility
5 (36-40),
20 (23-27)
find
12 (6-11)
Advanced
5 (28-36),
Subject
find (cont)
Issue (page)
6 (19-21)
Utility
9 (42-43)
fixdist
System utility 45 (33-37)
Freeware
45 (50-55)
FTP
8 (3-8)
Netmanage 15 (24-28)
Utility
11 (11-19)
Garbage collection
Utility
11 (42-43)
gatherall Report utility 46 (35-52),
47 (36-42)
gcc
15 (39)
gdb
15 (39)
GeoManager
18 (30)
GeoMessage
18 (31)
GeoMirror
18 (29-30)
getrlimit
4 (3)
gnat
15 (40)
GNU software
15 (39-41)
grep
30 (38-50),
31 (7-16)
gzip
14 (50-51)
HACMP
15 (3-11),
32 (22-40)
Components
15 (6-10)
HAGEO
18 (27-32)
Hard and symbolic links 20 (34-39)
herald
Utility
48 (46-48)
HP-OpenView
6 (34)
IBM 7133 disk array
13 (26)
IBM Digital Library
20 (27-34)
ifconfig
7 (8-9)
iFOR/LS
9 (3-9)
inetd
Extending
42 (52-55)
Performance
1 (18)
Informix-OnLine
ADSM
15 (17)
inode
20 (35)
Internet
10 (6-10)
AIX resources 20 (18-23)
E-mail
18 (3-17)
iostat
1 (11),
20 (43-44)
IP addresses
4 (28-31),
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
51
Subject
Issue (page)
IP addresses (cont)
19 (44-47)
ipreport
7 (14)
iptrace
7 (14)
IPv6
40 (15-26)
Addressing 40 (22-25)
AIX 4.3.2
41 (3-4)
Security
40 (26)
JDK
AIX 4.2.1
22 (54)
Job
Rescheduling
37 (3-8)
Utility
21 (28-34)
Kapture/6000
22 (53)
kill
10 (41-43),
35 (39-43)
ksh
2 (6),
4 (22),
20 (45),
25 (52-55)
History
10 (3-6),
11 (19-23)
Cursor keys
14 (8-9),
16 (42)
LDAP
AIX 4.3.2
41 (4-5)
Licence management
iFOR/LS
9 (3-9)
limit
4 (4)
LISP
15 (40)
locate
Find utility
17 (43)
logger
31 (17-18)
Login
adm
8 (40)
Customization 7 (38-39)
lookbib
7 (33-35)
lp
Errors
17 (5-8)
ls
Options
13 (32-43)
lsattr
1 (40)
lslk
47 (9-10)
lsof
47 (3-9)
lsps
22 (6)
lssrc
7 (13)
lsuser
26 (49-51)
ls_at
37 (3-8)
LVM
6 (17-19)
AIX 4.2
11 (5-6)
man
13 (3-6)
MAXM
6 (34)
52
Subject
mb
Memory
Issue (page)
38 (46-47)
4 (3-8),
4 (42),
8 (35-39)
CICS for AIX 2 (16-18)
Display
40 (50-51)
menu
28 (3-12)
Menus
7 (42)
Utility
3 (3-8),
4 (8-22)
MIME
18 (10-11)
mkpasswd
22 (15),
30 (36-37),
30 (36-37)
mkps
22 (5)
mksysb
AIX 4.2
11 (6)
mmotd
48 (9-35)
Model number
5 (27-28)
Modems
9 (27-32)
Monitoring AS/400s
14 (3-7)
Monitoring using PCs
23 (3-32),
24 (12-38),
24 (36-38),
27 (42-45),
28 (18-34),
29 (39-54)
MTA
18 (3-10)
Netmanage FTP
15 (24-28)
netstat
7 (10-13)
NetView for AIX
6 (35-36)
PTFs
1 (37)
SNMP
11 (23-35)
NetWare
2 (42-43)
Network monitoring
48 (36-45)
Utility
31 (38-41)
Network Station
23 (35)
New hardware
39 (32-40)
NFS
AutoFS
36 (17-24)
CachFS
30 (3-11)
nice
1 (11),
22 (13-14),
41 (27-34)
NIM
25 (30-41)
AIX 4.2
11 (7-8)
Disk usage
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
Subject
NIM (cont)
nslookup
NT
ntop
ODM
ODM
OpenGL
Oracle
oslevel
Issue (page)
AIX 4.3.2
41 (13)
7 (13)
Integration
46 (3-9)
48 (36-45)
37 (51)
1 (39-40)
AIX 4.2.1
22 (52)
ADSM
15 (14-16)
4 (41),
25 (17)
p2c
15 (40)
pack
14 (50-51)
Paging space
22 (3-8)
Utility
18 (23-27)
Pascal
15 (40)
pdt
3 (33-42)
Performance
1 (10-20),
21 (3-17)
3dmon
29 (7-8)
Client/server 28 (35-47)
I/O pacing
34 (3-7)
monitor
26 (39-45)
Monitoring
32 (3-16)
Tuning
27 (17-34)
Utility
10 (10-25),
19 (12-27),
25 (3-12),
35 (10-21)
xmperf
29 (3-14),
31 (21-38)
PerformanceWorks
6 (34-35)
PerfPMR
21 (5)
PEX
AIX 4.2.1
22 (53)
pgid
Groups
40 (36-38)
ph
Hierarchy
44 (3-16)
PHIGS
AIX 4.2.1
22 (53)
ping
7 (5-7)
POP
18 (12)
POWER
3 (22-32)
POWER3
39 (33-34)
PPP
22 (25-43)
bos.net.ppp
22 (31)
pppstat
25 (24-26)
Printing
AIX 4.1
3 (8-9)
Subject
Printing
(cont)
Issue (page)
Form overlays26 (21-36)
Headers
33 (40-51)
Performance
1 (19)
Problems
21 (17-27)
Utility
8 (25-27),
8 (40-42)
probe_site Core file utility 48 (9-35)
Processes
4 (27)
Fork
39 (24-25)
Groups
40 (36-37)
Hierarchy
44 (3-16)
kill
35 (39-43)
Management 10 (36-43)
Threads
39 (24-32)
Utility
12 (3-5),
31 (41-43)
ps
1 (11),
10 (37-40),
22 (15)
PTX
21 (3-5)
AIX 4.2.1
22 (53)
Remote execution
35 (21-29)
renice
22 (13-14),
41 (28-29)
REXX
Utility
1 (30)
RMON
3 (36-41)
rmss
22 (16)
RPC
CICS for AIX
2 (9)
RS/6000
390
4 (43)
43P 150
39 (35-36)
43P 260
39 (34-35)
F50
23 (33),
31 (46-47)
H70
44 (17-19)
S70
27 (47-51)
S7A
39 (32-33)
runsrv
15 (37-39)
Samba
46 (6-7)
sar
1 (11)
save_vg_info
Disk utility 47 (50-55)
Scalability
1 (7)
schedtune
21 (8-13),
22 (14-17),
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
53
Subject
Issue (page)
schedtune (cont)
41 (30-37)
Script logging
Utility
17 (9-21)
SCSI
Addresses
44 (52-54)
Versus SSA 28 (12-17)
Security
7 (36-37),
8 (28-31)
Passwords
24 (43-45)
Root user
34 (7-16)
Utility
26 (3-11)
sed
18 (32-40)
sendmail
18 (3-17)
ServicePac
46 (53-55)
setrlimit
4 (5)
Shell scripts Dates
44 (36-50)
Techniques
45 (3-33)
shutdown
26 (48-49)
skulker
15 (29)
SLIP
22 (25-26)
smit
6 (15-17),
16 (16-22)
Management 5 (41-43)
Utility
8 (27-28)
SMP
CICS for AIX 3 (14-15)
Performance 1 (15-16)
POWER
3 (26-27)
SMTP
18 (3-17)
SNA
3 (18-21),
5 (3-10)
SNMP
3 (33-42)
Using traps 11 (23-35)
Socket programming
13 (6-25)
Sockets
12 (12-16),
16 (33-41),
17 (21-40),
19 (27-43)
sort
39 (12-23),
40 (27-35)
split
31 (43-46)
splitlvcopy
25 (22-25)
SQL-BackTrack
ADSM
15 (14)
SSA
11 (35-42),
13 (26-32),
54
Subject
SSA (cont)
Issue (page)
13 (27-32)
Configuration 42 (3-9)
HACMP
15 (7)
Performance 13 (31-32)
Protocol
13 (29-30)
Reliability
13 (31)
Debugging
47 (43-50)
Versus SCSI 28 (12-17)
su
18 (17-19),
25 (13-16)
suid
6 (42)
Security
16 (31-32)
svmon
22 (15-16)
Swap space
1 (16)
swapon
22 (5)
Sybase
ADSM
15 (13-14)
sysdoc
Utility
45 (37-47)
sysdumdev
41 (22-27)
syslogd
40 (3-7)
Security
8 (28-31)
System configuration
30 (11-25)
System management
1 (7),
6 (31-36),
7 (36)
iFOR/LS
9 (3-9)
System monitoring
19 (3-11)
System parameters
1 (40-42)
SystemGuard
32 (40-42)
SystemView for AIX
6 (35-36)
tap
Tuning
41 (38-52),
42 (9-36)
Tape
6 (36-39)
Tape management
7 (15-32)
tar
7 (22-26),
39 (7-9)
TAS
46 (4-5)
taskbar
Utility
40 (38-49)
TCP
Performance
1 (18)
TCP/IP
2 (41-42)
IP addresses 19 (44-45)
IPv6
40 (15-26)
Routing
4 (28-37)
Troubleshooting 7 (3-15)
TCPAccess Sockets
16 (33-41)
© 1999. Xephon UK telephone 01635 33848, fax 01635 38345. USA telephone (940) 455 7050, fax (940) 455 2492.
Subject
Thread
Threads
Issue (page)
35 (3-10)
39 (24-32)
POSIX
39 (28-32)
timejob
Utility
21 (28-34)
timex
1 (10)
TME
6 (36)
today
Calendar
45 (47-49)
Token Ring CICS for AIX 3 (19-20)
tprof
22 (12)
traceroute
7 (9-10)
UDP
1 (18)
uname
Model number
1 (42)
uncompress
14 (50-51)
Unix to CICS transfer
13 (6-25),
14 (9-35)
unlimit
4 (4)
uptime
1 (11)
User administration
27 (34-41)
uucp
24 (38-42)
ValidUser() C function
39 (10-11)
VG
Utility
25 (27-29)
vi
5 (17-27)
Advanced
16 (3-16)
Editing
6 (42-43)
Search
23 (36-58)
Subject
Issue (page)
Virtual Memory Manager 21 (8-11)
VisualAge for C++
38 (54-55)
Visualization Data Explorer 6 (21-31)
vmstat
20 (39-43)
vmstat
1 (11),
22 (15)
vmtune
4 (23-25),
21 (10-13),
22 (17-19)
VSM
6 (15-17)
VT420
Library
47 (10-36)
WAN
9 (27-32)
whoami
25 (13)
WSM
AIX 4.3.2
41 (13-15)
X Server
Communication 2 (43)
X Terminals xdm
8 (31-35)
X Windows Performance
1 (18)
X/Motif
26 (11-20)
xdm
8 (31-35)
xlC
18 (41-43)
yacc
15 (39)
Year 2000
24 (45-48),
43 (20-22)
zcat
14 (50-51)
Contributing to AIX Update
AIX Update is primarily written by practising AIX specialists
in user organizations – not journalists, consultants, or marketing
people. In our view, such information is far more valuable to
AIX professionals than that from other sources.
If you’re interested in contributing to AIX Update, please
download a copy of Notes for contributors from Xephon’s Web
site at www.xephon.com. Articles to be considered for publication
can be sent the editor at [email protected]
© 1999. Reproduction prohibited. Please inform Xephon of any infringement.
55
AIX news
Merant has announced that Micro Focus
Server Express, the company’s product for
deploying COBOL applications, now runs
on AIX 4.3. Server Express helps extend
applications to the Web, Unix, and other
distributed platforms. Merant also supports
AIX 4.3 through the company’s PVCS
software configuration manager.
For further information contact:
Merant, 2465 E Bayshore Road, Palo Alto,
CA 94303, USA
Tel: +1 650 856 4161
Fax: +1 650 856 3724
Web: http://www.microfocus.com
Merant, Speen Court, 7 Oxford Road,
Newbury, Berks, RG14 1PB, UK
Tel: +44 1635 32646
Fax: +44 1635 33966
***
IBM has announced Version 3.0 of both
WebSphere Enterprise Edition and
Advanced Edition. The Enterprise Edition
includes TXSeries Version 4.3, Component
Broker V3.0, CICS Transaction Gateway
V3.0.2, DE-Light Gateway, and Component
Broker Application Adapters for CICS/IMS,
DB2, Oracle, and MQSeries. Also in the
package are CICS Universal Client V3.0.2
and the Encina Client V4.3.
Other tools include DB2 UDB V5.2, DCE
V2, and MQSeries V5.1, plus a range of
application development tools including an
x
early release of VisualAge for Java
Enterprise Edition V3, C++ Compiler and
Libraries, DB2 Software Developer’s Kit
V5.2, and Component Broker Toolkit V3.0.
Out now on AIX, NT, and Solaris, prices
start at US$35,000.
For further information contact your local
IBM representative.
***
Iona has announced OrbixHome, an IDE for
EJB and CORBA that now includes facilities
for deployment. Previously dubbed Orbix
BeansTalk, the product supports the EJB 1.1
specification and brings together Iona’s
HomeBase EJB container with the Orbix
middleware family, adding a graphical
environment for building and deploying
middleware components. Initial availability
is on AIX, Solaris, HP-UX, Compaq/DEC
Unix, and Windows NT. It’s due to Ship later
this year (prices weren’t announced).
For further information contact:
Iona Technologies, 60 Aberdeen Avenue,
Cambridge, MA 02138, USA
Tel: +1 617 949 9000
Fax: +1 617 949 9001
http://www.iona.com
Iona Technologies UK Ltd, The Atrium
Court, Apex Plaza, Reading RG1 1AX, UK
Tel: +44 118 925 4241
Fax: +44 118 958 7724
xephon
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement