An easily pluggable host level metrics collector. There are a number of plugins included, but it's quite easy to add your own as well.
Your path to getting running is primarily the configuration of your taxman.ini file. The [main]
section is where you are going to define the remote receiver and associated username/password. This works in much the same way as the collectd
write_http
plugin.
Beyond that, you want to enable the default plugins you are intested in. You can enabled them by adding them to the list of plugins_enabled
. To get it up and running, just run taxman.py -c path/to/config
.
First, create a file in libtaxman/plugins
with a legal Python module name. For the purposes of these examples, we'll say your plugin file is named myexample.py
.
The basics of your plugin are pretty simple:
from gdata_subm import Gdata
from libtaxman.collector import BaseCollector
from typing import Union, List
class MyCollector(BaseCollector):
def get_data_for_sub(self) -> Union[Gdata, List[Gdata]]:
# This is where you'll implement your collector and return either
# a Gdata object or a list of Gdata objects
pass
In your collector, you'll have access to your section of the config file as a self.config
variable. This is actually a ConfigParser.SectionProxy
, so you can access everything as a dict.
Adding custom configuration settings for your plugin is pretty simple. Just follow these steps:
- Create a section in the config like
[module_name]
. From the example above, it would be:[myexample]
- The only setting in this section that is required is
name
.name
corresponds to the name of the collector class. From the example above, that would beMyCollector
. - Add any custom configuration items in your section that you might want/need.
- Finally, in the
[main]
section, enable your plugin by adding your plugin to theplugins_enabled
list like this:
[main]
...
plugins_enabled =
netstat
myexample
...
[myexample]
name = MyCollector
...
That's about it. You can obviously enable any of the included plugins.