1

I am trying to run external sample.py script in /path-to-scollector/collectors/0 folder from scollector.

scollector.toml:

Host = "localhost:0"
ColDir="//path-to-scollector//collectors//"
BatchSize=500
DisableSelf=true

command to run scollector:

scollector-windows-amd64.exe -conf scollector.toml -p

But I am not getting the sample.py metrics in the output. It is expected to run continuosly and print output to cnosole. Also when I am running:

 scollector-windows-amd64.exe -conf scollector.toml -l

my external collector is not listed.

Mohd Waseem
  • 1,244
  • 2
  • 15
  • 36

2 Answers2

2

In your scollector.toml, You should one line as below,
Filter=["sample.py "] .

in your sample.py, you need this line
#!/usr/bin/python

Hua Zhang
  • 349
  • 3
  • 6
1

For running scollector on linux machine the above solution works well. But with windows its a bit tricky. Since scollector running on windows can only identify batch files. So we need to do a little extra work for windows.

create external collector :- It can be written in any language python,java etc. It contains the main code to get the data and print to console.

Example my_external_collector.py

create a wrapper batch script :- wrapper_external_collector.bat.

Trigger my_external_collector.py inside wrapper_external_collector.bat.

python path_to_external/my_external_collector.py

You can pass arguments to the script also.Only disadvantage is we need to maintain two scripts.

Mohd Waseem
  • 1,244
  • 2
  • 15
  • 36