examples]$ python run.py 'select * from time' Tried out the python example and running in to the following issue. Have osquery service running - sud./build/debug_centos7/osquery/osqueryd -allow_unsafe -pidfile /tmp/osquery.pid -database_path /tmp/osquery.db -extensions_socket=/var/osquery/osquery.emĪnd would like execute queries on the running instance.
Osquery kills ec2 how to#
Thanks in advance How to get a python table to autoload?
Osquery kills ec2 code#
Should I run this code differently, when using python3, or is this a bug? TypeError: string argument expected, got 'bytes'
Self.writeI32(TBinaryProtocol.VERSION_1 | type)įile "/usr/local/lib/python3.4/dist-packages/thrift/protocol/TBinaryProtocol.py", line 111, in writeI32įile "/usr/local/lib/python3.4/dist-packages/thrift/transport/TTransport.py", line 168, in writeįile "/usr/local/lib/python3.4/dist-packages/thrift/transport/TTransport.py", line 164, in write
I think this link, can provide more details on this issue.Ĭhanging python version to 2.x does the job ! Capture unhandled exception messages and send to logger pluginįile "/usr/local/lib/python3.4/dist-packages/osquery-1.5.3-p圓.4.egg/osquery/extensions/ExtensionManager.py", line 183, in queryįile "/usr/local/lib/python3.4/dist-packages/osquery-1.5.3-p圓.4.egg/osquery/extensions/ExtensionManager.py", line 187, in send_queryįile "/usr/local/lib/python3.4/dist-packages/thrift/protocol/TBinaryProtocol.py", line 46, in writeMessageBegin Traceback (most recent call last): File "C:/Users/Mobeen/Documents/GitHub/osquery-python/examples/foobar_table.py", line 7, in import osquery File "C:\Users\Mobeen\Documents\GitHub\osquery-python\osquery\_init_.py", line 33, in from osquery.extension_client import DEFAULT_SOCKET_PATH, ExtensionClient File "C:\Users\Mobeen\Documents\GitHub\osquery-python\osquery\extension_client.py", line 17, in from import Client File "C:\Users\Mobeen\Documents\GitHub\osquery-python\osquery\extensions\ExtensionManager.py", line 10, in import File "C:\Users\Mobeen\Documents\GitHub\osquery-python\osquery\extensions\Extension.py", line 11, in from ttypes import * ModuleNotFoundError: No module named 'ttypes'
Osquery-python scripts aren't running in python 3. Osquery successfully returned deb_packages two times in the loop but raised a BrokenPipeError exception on the third iteration of the loop. I expected osquery to return the query result for deb_packages 5 times(in the above demo example). Raise TTransportException(message="unexpected exception", inner=e) Query = ("select * from deb_packages")įile "/home/ubuntu/.local/lib/python3.10/site-packages/osquery/extensions/ExtensionManager.py", line 181, in queryįile "/home/ubuntu/.local/lib/python3.10/site-packages/osquery/extensions/ExtensionManager.py", line 190, in send_queryįile "/home/ubuntu/.local/lib/python3.10/site-packages/thrift/transport/TTransport.py", line 179, in flushįile "/home/ubuntu/.local/lib/python3.10/site-packages/thrift/transport/TSocket.py", line 185, in write File "/home/ubuntu/.local/lib/python3.10/site-packages/thrift/transport/TSocket.py", line 178, in writeĭuring handling of the above exception, another exception occurred:įile "/home/ubuntu/osquery_demo.py", line 9, in