我正在尝试从 scollector 运行 /path-to-scollector/collectors/0 文件夹中的外部 example.py 脚本。
scollector.toml:
Host = "localhost:0"
ColDir="//path-to-scollector//collectors//"
BatchSize=500
DisableSelf=true
运行 scollector 的命令:
scollector-windows-amd64.exe -conf scollector.toml -p
但我没有在输出中获取sample.py 指标。它预计将连续运行并将输出打印到 cnosole。当我运行时:
scollector-windows-amd64.exe -conf scollector.toml -l
我的外部收集器未列出。
最佳答案
在你的 scollector.toml 中,你应该有一行如下,
Filter=["sample.py"]
。
在你的sample.py中,你需要这一行
#!/usr/bin/python
关于python - 如何从 Scollector 运行外部收集器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48073918/