A forked repository of official TCollector
tcollector is a framework to collect data points and store them in OpenTSDB. It allows you to write simple collectors that it'll run and monitor. It also handles the communication with the TSDs.
For more info, see the TCollector Documentation
tcolletor
|-- collectors
| |-- 0
| |-- 300
| |-- 900
| |-- etc
| `-- lib
|-- debian
|-- eos
| `-- collectors
|-- rpm
`-- stumbleupon
The Config files are located in tcollector/collectors/etc/
-
opsmxconf.py
related to opsmx collectors configurations.(The following fields need to specify inopsmxconf.py
)GLOBAL_COLLECTORS_INTERVAL
- Used to apply unique time interval for all collectorsOVERRIDE
- Used to override script's collection interval time toGLOBAL_COLLECTORS_INTERVAL
. i.e WhenOVERRIDE
is True,GLOBAL_COLLECTORS_INTERVAL
is applied to all collectors which means every collectors has same unique time interval periodSERVICES
Dictionary - Select the servicies(specifyTrue
) that needs to monitor i.e. RetrivesCPU
andMEM
of the serviceAPACHE_CONFIG
Dictionary - Specifyusername
,password
and base url likehttp://localhost
, if you wish to monitorapache
web serverMYSQL_CONFIG
Dictionary - Specifyusername
,password
,ip
andport
to getmysql
metrics. If you want to get more metrics, please setTrue
forextended
fieldPOSTGRESS_CONFIG
Dictionary - Related to postgress DB, in order to get postgress metrics, specifyusername
,password
,db
,ip
,port
-
config.py
- Most of the configurations is enough, but we need specify
port
(TSDB PORT),host
(TSDB HOST). If necessary setTrue
forhttp
&ssl
- Most of the configurations is enough, but we need specify
Go to tcollector/collectors/0/
, give execute permissions to the collectors that you want to be run.
For example:
chmod +x apache.py mysql.py
Clone the repository
git clone https://github.com/OpsMx/tcollector.git
You should specify host
and port
in tcollecor/collectors/etc/config.py
and go to tcollector
directory(root of the tcollectors) run
python tcollector.py
If you did not specify host
and port
in tcollecor/collectors/etc/config.py
, you can specify host
and port
as command line argument
python tcollector.py -H <HOST IP> -p <PORT>
In this step, host
and port
are already configured, but you need to select which scripts should run by chmod +x <collector name>
in tcollector/collectors/0/
sudo wget -O installer.py https://raw.githubusercontent.com/OpsMx/tcollector/master/installer.sh && chmod +x installer.py && sh installer.py
service tcollector start
service tcollector stop
service tcollector restart
service tcollector uninstall
docker pull opsmx11/tcollector
docker run --net=host --volume=/var/lib/docker/:/var/lib/docker:ro --volume=/sys/fs/cgroup/:/sys/fs/cgroup/:ro -it --name=opsmx-collector -d opsmx11/tcollector