zeek/auxil/zeekctl/testing/Cfg/plugins/optionstest.py
Patrick Kelley 8fd444092b initial
2025-05-07 15:35:15 -04:00

30 lines
738 B
Python

# Zeekctl test plugin that defines plugin options.
import ZeekControl.plugin
class OptionsTest(ZeekControl.plugin.Plugin):
def __init__(self):
super().__init__(apiversion=1)
def name(self):
return "optionstest"
def pluginVersion(self):
return 1
def init(self):
with open("options.out", "w") as f:
f.write(f"{self.getOption('opt1')}\n")
f.write(f"{self.getOption('opt2')}\n")
f.write(f"{self.getOption('opt3')}\n")
return True
def options(self):
return [
("opt1", "bool", True, "Boolean option"),
("opt2", "string", "test str", "String option"),
("opt3", "int", 42, "Int option"),
]