| Setup Procedures for the "xmon" user nameThe "xmon" user name is used across all AIX machines as a systems
management user name.  The procedures to setup this user on an AIX
platform follows: 
 
NEWXMONID=$( echo "xmon" | sum | sed -e "s/ //g" )
if id xmon
then
  OLDXMONID="$( id xmon | awk '{ print $1 }' | sed -e "s/[^0-9]//g" )"
  [[ -f /home/xmon/.rhosts ]] && chown xmon:staff /home/xmon/.rhosts
  find / -user xmon -exec ls -ld {} \; 2>/dev/null
  ps -ef | grep -i xmon
  NEWXMONID=$( echo "xmon" | sum | sed -e "s/ //g" )
  chuser id=${NEWXMONID} xmon
  id xmon
  find /home -user xmon -exec ls -ld {} \;
  find /home -user ${OLDXMONID} -exec ls -ld {} \;
  find /home -user ${OLDXMONID} -exec chown xmon:staff {} \; -print
  find /home -user xmon -exec ls -ld {} \;
  unset OLDXMONID
else
  mkuser id="${NEWXMONID}" pgrp='staff' gecos='xmonitor ' xmon
  pwdadm -c xmon
fi
 Setup the the ".rhosts" file for the "xmon"
user to allow the "xmon" user access to the AIX machine as
the user "root" or "cricket". 
 
cd /home
[[ -d /home/xmon ]] &&
  chown -R xmon:staff xmon
cd /home/xmon &&
  [[ ! -f .rhosts ]]  &&
  echo "mtxdoc cricket" > .rhosts &&
  echo "mtxdoc.mtxia.com cricket" >> .rhosts
  echo "mtxdoc root" >> .rhosts
  echo "mtxdoc.mtxia.com root" >> .rhosts
chown xmon.staff /home/xmon/.rhosts
chmod 600 /home/xmon/.rhosts
pwd
ls -al
 Now setup the "xmserv" daemon process to allow cricket
to obtain statistics from this machine: 
 
ps -ef | egrep -i "xm|filtd|topas"
ipcs -m | grep -i 0x78
#  Remove segments identified by previous command
ipcrm -m <segment id>
 Clean memory and prepare the "xmservd.res" file: 
 
slibclean
if [[ ! -f /etc/perf/xmservd.res ]]
then
   cat /usr/samples/perfagent/server/xmservd.res |
   sed -e "s/^# *dosmux/dosmux/g" > /etc/perf/xmservd.res
fi
ls -l /etc/perf/xmservd.res
 If the file "/etc/perf/xmservd.res" was created
correctly, start the "xmpeek" process and send it an
INTerrupt signal.  The INTerrupt signal causes "xmpeek" to
generate a MIB file: 
 
xmpeek -l; sleep 10
kill -2 `ps -ef -F pid,args |
  grep xmservd |
  grep -v grep |
  awk '{ print $1 }'`
ps -ef | grep xmservd ; ls -l /etc/perf/xmservd.mib
ls -l /etc/mib*
 If the MIB file "/etc/perf/xmservd.mib" was created
correctly, copy the original MIB file to a backup name and run the
"mosy" command on the MIB file: 
 
cp /etc/mib.defs /etc/mib.defs.org
mosy -o /tmp/mib.defs /etc/perf/xmservd.mib
 If the "mosy" command runs correctly, "vi"
the MIB file "/etc/perf/xmservd.mib", and delete those
stanzas with a plus sign "+" in the stanza title.  There
should be two stanzas: 
 
vi /etc/perf/xmservd.mib
/+
/
8dd
/
8dd
:wq
 Rerun the "mosy" command, copy the original MIB file to
"/etc/mib.defs", append the newly edited MIB file to the
end of  "/etc/mib.defs", cleanup the temporary files and
check to see if the "public" group is defined in the SNMP
configuration file: 
 
mosy -o /tmp/mib.defs /etc/perf/xmservd.mib
cp /etc/mib.defs.org /etc/mib.defs
cat /tmp/mib.defs >> /etc/mib.defs
rm /tmp/mib.defs
grep "public" /etc/snmpd.conf
 Refresh the SNMP daemon and check to see the "xm"
information now appears in the "snmpinfo": 
 
refresh -s snmpd
snmpinfo -md -v xmdLAN
 Add the "xmservd" daemon to the
"/etc/inetd.conf" file if it is not already in this
file: 
 
if ! grep -i "xmservd" /etc/inetd.conf
then
echo "xmquery   \
dgram   \
udp     \
wait    \
root    \
/usr/bin/xmservd        \
xmservd -p3" >> /etc/inetd.conf   
tail /etc/inetd.conf  
fi
refresh -s inetd
 |