当前位置: 首页 > BASIC > 正文

OSWBB随系统自动启动

下面是在solaris 11.2环境中测试oswbb随系统自动启动,不同环境需要更改一下OSW的目录

root@solaris:~# cat /etc/init.d/osw.sh

########################################################################

# Establish default values

########################################################################

# Set OSW_HOME to the directory where your OSWatcher tools are installed

OSW_HOME=/export/home/oracle/oswbb

# Set OSW_INTERVAL to the number of seconds between collections

OSW_INTERVAL=30

# Set OSW_RETENTION to the number of hours logs are to be retained

OSW_RETENTION=48

# Set OSW_COMPRESSION to the desired compression scheme

OSW_COMPRESSION=gzip

# Set OSW_ARCHIVE where the logs should be stored

OSW_ARCHIVE=$OSW_HOME/archive

########################################################################

 

echo $OSW_HOME

echo "******************************************************" >> $OSW_HOME/init_osw.log

case $1 in

‘start’)

echo "…Starting OSWBB from init at `date` " >> $OSW_HOME/init_osw.log

cd $OSW_HOME

./startOSWbb.sh "${OSW_INTERVAL}" "${OSW_RETENTION}" "${OSW_COMPRESSION}" "${OSW_ARCHIVE}"

;;

‘stop’)

echo "…Stopping OSWBB from init at `date` " >> $OSW_HOME/init_osw.log

cd $OSW_HOME

./stopOSWbb.sh

;;

*)

echo "Usage: $0 start|stop" >&2

exit 1

;;

esac

exit 0

给执行权限,并增加到/etc/inittab

chmod +x /etc/init.d/osw.sh start

echo "osw:3:respawn:/etc/init.d/osw.sh start >/dev/null 2>&1 </dev/null" >>/etc/inittab

 

下面查询日志文件

root@solaris:/export/home/oracle/oswbb# tail -f init_osw.log

******************************************************

…Starting OSWBB from init at Friday, January 23, 2015 02:31:11 PM UTC

******************************************************

…Starting OSWBB from init at Friday, January 23, 2015 02:31:11 PM UTC

******************************************************

…Starting OSWBB from init at Friday, January 23, 2015 02:31:11 PM UTC

******************************************************

…Starting OSWBB from init at Friday, January 23, 2015 02:31:11 PM UTC

******************************************************

…Starting OSWBB from init at Friday, January 23, 2015 02:31:11 PM UTC

本文固定链接: http://www.htz.pw/2015/01/23/oswbb%e9%9a%8f%e7%b3%bb%e7%bb%9f%e8%87%aa%e5%8a%a8%e5%90%af%e5%8a%a8.html | 认真就输

该日志由 huangtingzhong 于2015年01月23日发表在 BASIC 分类下, 通告目前不可用,你可以至底部留下评论。
原创文章转载请注明: OSWBB随系统自动启动 | 认真就输
关键字: