I don't understand from the official documentation of OpenTSDB how to create a collector and how to make it running. In addition to that, i would like to make one collector in Java language. I'm also a bit new to Unix systems, but i know the basics
Writing a collector for OpenTSDB is quite simple, if you have cloned from git repository the tcollector
script you will see the startstop
executable, this daemon once being launched will execute all files that are stored inside ./tcollector/collectors/NUMBER
where NUMBER
is the periodicity in minutes.
Said that, what you need to do is coding those scripts that will be stored inside collectors
folder. When OpenTSDB executes those scripts it expects the following output:
<METRIC> <UNIX_TIMESTAMP> <VALUE>
So, in your case. Imaging you want to report the temperature of your PC (call each 5 minutes, you will have to follow the next steps:
pc.temperature 1371075574 40
./tcollector/collectors/5/
so OpenTSDB will launch it each 5 minutesstartstop
(OpenTSDB must be running)A more detailed explanation here.