OS Watcher (OSW) 安装、启动及开机自启动配置
2021/12/21 6:21:14
本文主要是介绍OS Watcher (OSW) 安装、启动及开机自启动配置,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
OS Watcher (OSW) 安装、启动及开机自启动配置
2020-05-15watch
根据操作系统版本分为两种,Linux 6之前、Linux 6及之后。
一、 Linux 6之前的OSW
1. 下载地址
文档 ID 301137.1(目前已不再提供下载)。可以网上搜,或者从其他安装了osw的服务器打包oswbb目录,到目标服务器解压即可。
2. 安装
解压tar包即可,无需额外操作。
1 | tar -xvf oswbb.tar |
3. 启动、检查及关闭
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
#以下需先cd至解压目录 #后台启动(不加参数默认每30秒收集一次,数据保留48小时) nohup ./startOSWbb.sh & #带参数启动(后台启动,每30秒收集一次,数据保留168小时(7天)) nohup ./startOSWbb.sh 30 168 & #带参数启动(前台启动) ./startOSWbb.sh 60 10 #指定归档目录 export OSWBB_ARCHIVE_DEST=/usr/app/archive ./startOSWbb 30 48 None /usr/app/archive #是否启动osw ps -ef |grep -i osw #关闭 ./stopOSWbb.sh |
4. 配置开机自启动
Linux 6之前的osw不带开机自启动功能,需要自己写脚本并配置,方法如下:
编写osw启动脚本
1 2 3 4 5 6 7 |
vi /home/oracle/oswbb/auto_start_osw.sh #内容如下 cd /home/oracle/oswbb nohup ./startOSWbb.sh 30 168 & # 加执行权限 chmod +x /home/oracle/oswbb/auto_start_osw.sh |
设置服务器启动时执行该脚本
1 2 |
crontab -e @reboot /home/oracle/oswbb/auto_start_osw.sh |
二、 Linux 6及之后的OSW
1. 下载地址
文档 ID 301137.1,Linux 6开始报错了rpm包,有el6、el7版本
2. 安装
1 2 3 4 5 |
rpm -ivh oswatcher-7.3.3-2.el6.noarch.rpm Preparing... ################################# [100%] Updating / installing... 1:oswatcher-7.3.3-2.el6 ################################# [100%] |
3. 启动、检查及关闭
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#启动 /etc/init.d/oswatcher start Starting oswatcher (via systemctl): [ OK ] #检查 ps -ef |grep -i osw root 590 1 0 03:13 ? 00:00:00 /bin/bash /sbin/OSWatcher -i 30 -m 48 -l /var/log/oswatcher/log /var/log/oswatcher root 946 31065 0 03:14 pts/0 00:00:00 grep --color=auto -i osw #目录结构 [root@localhost ~]# cd /var/log/oswatcher/archive/ [root@localhost archive]# ls oswifconfig oswmeminfo oswnetstat oswps oswtop oswiostat oswmpstat oswprvtnet oswslabinfo oswvmstat |
4. 配置开机自启动
Linux 6开始osw自带开机自启动功能
查看是否开机自启动
1 2 3 |
chkconfig --list oswatcher ... oswatcher 0:off 1:off 2:on 3:on 4:on 5:on 6:off |
设置开机自启动
1 | chkconfig oswatcher on |
这篇关于OS Watcher (OSW) 安装、启动及开机自启动配置的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-06-06Package Easy(基于 NSIS 的打包exe安装包工具)使用方法-icode9专业技术文章分享
- 2024-06-06基于 casdoor 的 ELK 开源登录认证解决方案: elk-auth-casdoor-icode9专业技术文章分享
- 2024-05-29Elasticsearch慢查询日志配置
- 2024-05-29揭秘华为如此多成功项目的产品关键——Charter模板
- 2024-05-29海外IDC业务拓展的7大挑战
- 2024-05-29InLine Chat功能优化对标Github Copilot,CodeGeeX带来更高效、更直观的编程体验!
- 2024-05-29CodeGeeX 智能编程助手 6 项功能升级,在Visual Studio插件市场霸榜2周!
- 2024-05-29AutoMQ 生态集成 Apache Doris
- 2024-05-292024年IDC行业的深度挖掘:机遇、挑战与未来展望
- 2024-05-29五款扩展组件齐发 —— Volcano、Keda、Crane-scheduler 等,邀你体验