我有一个关于使用osquery-python创建osquery扩展的新手问题。我创建了一个小扩展,从我的linux系统获得一些额外的RPM信息。按照文档中的说明,我在/etc/osquery/extensions.load中添加了扩展路径,以使其自动加载。我重新启动了osqueryd,我看到使用ps ax运行扩展。
如果我以交互方式运行osqueryi,我可以看到表并获取数据。一切都很完美。
然而,当我运行osqueryi命令'one-liner'时,例如:
osqueryi .tables我的输出中出现了以下一些错误:
#INFO:thrift.transport.TSocket:Could not connect to /root/.osquery/shell.em
Traceback (most recent call last):
File "build/bdist.linux-x86_64/egg/thrift/transport/TSocket.py", line 104, in open
handle.connect(sockaddr)
File "/usr/lib64/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
error: [Errno 2] No such file or directory
ERROR:thrift.transport.TSocket:Could not connect to any of ['/root/.osquery/shell.em']
我做错了什么?
答案 0 :(得分:0)
扩展程序在单独的进程中运行。您可以看到套接字错误,这表明扩展进程无法与osquery进程通信。确保osqueryd或osqueryi正在运行。链接:osquery doc page for extensions。