Comments (4)
我也遇到了这个问题,发现是由于syshook_execve.ko内核模块重启后,需要重新加载才能使用,而驭龙系统在自启动时没有重新加载syshook_execve.ko这个模块,导致无法监控进程,希望官方能在代码上解决这个问题。
#手工解决方式
[root@localhost ~]# cd /usr/yulong-hids/
[root@localhost yulong-hids]# ls
agent daemon data.zip nohup.out syshook_execve.ko
[root@localhost yulong-hids]# ps -ef|grep yulong
root 676 1 0 03:12 ? 00:00:00 /usr/yulong-hids/daemon -netloc 192.168.200.2
root 1384 676 0 03:12 ? 00:00:00 /usr/yulong-hids/agent 192.168.200.2
root 1457 1436 0 03:15 pts/0 00:00:00 grep --color=auto yulong
[root@localhost yulong-hids]# kill 676
[root@localhost yulong-hids]# insmod syshook_execve.ko
[root@localhost yulong-hids]# nohup ./daemon -netloc 192.168.200.2 &
#自写自启动脚本,在驭龙自启动之前加载syshook_execve.ko
from yulong-hids-archived.
经测试,在yulong-hids/agent/agent.go
的15行后面添加如下代码即可解决此问题
if runtime.GOOS == "linux" {
out, _ := common.CmdExec(fmt.Sprintf("lsmod|grep syshook_execve"))
if out == "" {
common.CmdExec(fmt.Sprintf("insmod %s/syshook_execve.ko", common.InstallPath))
}
}
需要导入如下package
import "runtime"
import "yulong-hids/daemon/common"
from yulong-hids-archived.
自己调试后感觉应该是process_linux.go这个文件里的sock_fd = socket(PF_NETLINK, SOCK_RAW, NETLINK_USER);出错,出错信息Protocol not supported。很奇怪为什么不重启的时候好好的,重启后就不行了。
版本:
Linux localhost 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Linux localhost.localdomain 2.6.32-573.el6.x86_64 #1 SMP Thu Jul 23 15:44:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
from yulong-hids-archived.
以上代码会使编译生成的agent体积增大1Mb左右,如果将其放在yulong-hids/daemon/daemon.go
的main函数开始位置,编译生成的daemon体积基本不变,也能解决问题,但重启后,daemon和agent进程会延迟两分钟左右才会启动,不知道是什么问题
from yulong-hids-archived.
Related Issues (20)
- Error compile web binary HOT 6
- 无法卸载agent HOT 1
- 在某些内核版本下加载驱动,会造成系统挂掉
- 忽略
- 点赞 HOT 1
- 单独有一台监控的服务器进程异常敏感,随便敲个命令都会告警 HOT 1
- Available server node 是否支持nat映射 HOT 2
- 是不是打上spectre_v2补丁驱动就不能用了
- 启动web.exe无法绑定ip地址 HOT 1
- cnetos insmod syshook_execve.ko 内核版本 3.10.0-862.el7.x86_64 导致机器挂掉 HOT 3
- 驱动中宽字符(中文)处理问题
- 写的非常棒
- 我想把项目进行32位Linux的移植 HOT 1
- Agent安装失败 HOT 2
- fix task_id error
- agent在windows和linux下都无法运行
- web配置文件app.conf中ylhostname参数不起作用,base.go的24行c.Ctx.Input.Host()获取的不是客户端ip,可以用c.Ctx.Input.IP()替代
- 对进程的规则不起作用 HOT 2
- centos 启动agent时,瞬间把文件描述符打到65K,机器搞死了,怎么解决这个bug
- Process monitoring could not be started (无法实现进程监控)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yulong-hids-archived.