Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/crustymonkey/taxman
An easily expandable host level metrics collector
https://github.com/crustymonkey/taxman
Last synced: about 2 months ago
JSON representation
An easily expandable host level metrics collector
- Host: GitHub
- URL: https://github.com/crustymonkey/taxman
- Owner: crustymonkey
- License: gpl-2.0
- Created: 2020-10-23T19:54:51.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-31T22:29:20.000Z (6 months ago)
- Last Synced: 2024-08-14T07:08:30.701Z (5 months ago)
- Language: Python
- Size: 3.75 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - crustymonkey/taxman - An easily expandable host level metrics collector (Python)
README
# About
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.# Getting Running with Default Plugins
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`.
# Creating Your Own Plugin
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`.## Stubbing Out `myexample.py`
The basics of your plugin are pretty simple:```
from gdata_subm import Gdata
from libtaxman.collector import BaseCollector
from typing import Union, Listclass 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.
## Configuring Your Plugin
Adding custom configuration settings for your plugin is pretty simple. Just follow these steps:1. Create a section in the config like `[module_name]`. From the example above, it would be: `[myexample]`
2. 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 be `MyCollector`.
3. Add any custom configuration items in your section that you might want/need.
4. Finally, in the `[main]` section, enable your plugin by adding your plugin to the `plugins_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.