Sun Microsystems, Inc.  Sun System Handbook - ISO 3.4 June 2011 Internal/Partner Edition
   Home | Current Systems | Former STK Products | EOL Systems | Components | General Info | Search | Feedback

Asset ID: 1-71-1018006.1
Update Date:2009-09-30
Keywords:

Solution Type  Technical Instruction Sure

Solution  1018006.1 :   Sun Enterprise[TM] 10000:How to log what gets typed at a netcon session  


Related Items
  • Solaris SPARC Operating System
  •  
  • Sun Enterprise 10000 Server
  •  
Related Categories
  • GCS>Sun Microsystems>Servers>High-End Servers
  •  

PreviouslyPublishedAs
229291


Description
This article describes how to enable netcon logging on the System Service
Processor of an Sun Enterprise[TM] 10000.

Steps to Follow
There are occasions where it is useful to know exactly what was typed at a
netcon session, especially if there are multiple administrators and
suspected watchdog resets.
Netcon logging is integrated into SSP 3.1.1 and beyond. To enable logging
for SSP 3.1.1 and higher, edit the /etc/syslog.conf file and uncomment the
local1.debug line, then restart the SSP.
# Uncomment to enable SSP netcon session logging:
local1.debug           /var/opt/SUNWssp/.ssp_private/machine_server_fifo
The output for each domain's console is stored in $SSPVAR/adm/<domain>/netcon.
SSP 3.0 and 3.1 netcon logging use the following 3 programs and 1 crontab
entry:
/etc/rc2.d/S99netcon_logger
===========================
su ssp -c sh <<END_OF_LOGGER >/dev/null
. /etc/opt/SUNWssp/ssp_env.sh
$SSPOPT/bin/netcon_loggerd &
END_OF_LOGGER
/opt/SUNWssp/bin/netcon_loggerd
===============================
#!/bin/sh
while [ `ps -ef | grep netcon_server | grep -v grep | wc -l` = 0 ]
do
sleep 10
done
for domain in `domain_status | tail +2 | awk '{print $1}'`
do
SUNW_HOSTNAME=$domain
export SUNW_HOSTNAME
netcon < /dev/null 1>>$SSPLOGGER/$domain/netcon.log 2>&1 &
joblist="$joblist $!"
done
sleep 5
trap 'kill -9 $joblist ; exec $0' 18 1
wait
/opt/SUNWssp/bin/newnetconlog
=============================
#! /usr/bin/sh
#
# Copyright (c) 1998 by Sun Microsystems, Inc.
# All rights reserved.
#
###############################################################################
#
# This script archives netcon.log messages files.  Normally, it should be
# run once per week.  The number of logs to be kept is controlled by
# the shell variable called "MAX" below.
#
###############################################################################
MAX=8
fatal()
{
	echo "ERROR!  $*" >&2
	echo "ABORTING!" >&2
	exit 2
}
ENV=/etc/opt/SUNWssp/ssp_env.sh
[ -f ${ENV} ] || fatal "Couldn't find ${ENV}!"
. ${ENV}
DOM=/var/opt/SUNWssp/.ssp_private/domain_config
[ -f ${DOM} ] || fatal "Couldn't find ${DOM}!"
DOMAINS=`awk -F: '{print $1}' ${DOM}`
LOG=netcon.log
for domain in $DOMAINS
do
	LOGDIR=$SSPLOGGER/$domain
	if [ ! -d $LOGDIR ]
	then
		rm -f $LOGDIR
		mkdir -p $LOGDIR
	fi
	cd $LOGDIR
	i=$MAX
	while [ $i -gt 0 ]
	do
		j=`expr $i - 1`
		test -f ${LOG}.$j && mv -f ${LOG}.$j ${LOG}.$i
		test -f ${LOG}.$j.Z && mv -f ${LOG}.$j.Z ${LOG}.$i.Z
		i=$j
	done
	test -f $LOG && mv -f $LOG ${LOG}.$i
	( sleep 5 ; compress ${LOG}.$i ) &
	touch $LOG
	chown ssp $LOG
	chgrp staff $LOG
done
pid=`/usr/bin/ps -ef | /usr/bin/grep [n]etcon_loggerd | awk '{print $2}'`
if [ "$pid" != "" ]
then
	kill -HUP $pid
else
	sh /etc/rc2.d/S99netcon_logger start
fi
entry to be added to root's crontab
===================================
5 4 * * 6 /opt/SUNWssp/bin/newnetconlog >/dev/null 2>&1 # archives
netcon.log
		NOTES
		=====
S99netcon_logger starts netcon_loggerd at boot time.
netcon_loggerd records a log of netcon into a file called netcon.log in the
same directory as the messages files for each domain,
i.e. /var/opt/SUNWssp/adm/<domainname>/netcon.log
If the netcon process which is recording the log dies or is killed,
netcon_loggerd will restart it, unless an exclusive netcon session is used.
To restart recording after an exclusive session has been used, send a
SIGHUP signal to netcon_loggerd:
# kill -HUP <pid-of-netcon_loggerd>
If this is forgotten, then newnetconlog will send the SIGHUP each week anyway.
Finally newnetconlog archives the old log files and compresses them where
possible.


Product
Solaris
Sun Enterprise 10000 Server

Internal Comments
For more information:
http://pts-americas.west/esg/hsg/starfire/xftt/ssp_netcon.html#logging

netcon, ssp, logging
Previously Published As
15786

Change History
Date: 2003-10-03
User Name: 72864
Action: Approved
Comment: added trademark name to title and added description section. Minor formatting changes to remove misplaced newlines.
Version: 0
Date: 2003-10-01
User Name: 101037
Action: Approved
Comment: Pushing it on
Version: 0
Date: 2003-09-17
User Name: 111653
Action: Approved
Comment: Added Logging information for SSP 3.1.1 and higher.
Version: 0
Date: 2003-09-16
User Name: 111653
Action: Updated
Comment: Please Review
Version: 0
Date: 2003-05-20
User Name: Administrator
Action: Migration from KMSCreator
Comment: updated by : John Knudsen
comment : admin cleanup, ok
date : Jun 19, 2002



updated by : Thom Chumley
comment : No comment
date : Apr 6, 1998
Version: 0
Product_uuid
3285bfa4-224e-11d6-8eb3-843d3a923213|Solaris
29ddef46-0a18-11d6-92de-ae47474f0f6c|Sun Enterprise 10000 Server

Attachments
This solution has no attachment
  Copyright © 2011 Sun Microsystems, Inc.  All rights reserved.
 Feedback