plugin

command
v0.0.0-...-2dec208 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2025 License: MIT Imports: 6 Imported by: 0

README

Tob Plugin

https://pkg.go.dev/plugin

You can create custom functionality for services. This is needed when you want to create a service that is not currently available on Tob, or when you want to create a custom message that will appear on the monitoring Dashboard or a message that will appear on the Notificator.

There are several limitations currently at https://pkg.go.dev/plugin.

  • Binary Plugins must be built with the same code as the code you use to build the main binary.

  • The version of the operating system used to run the plugin binary and main binary must be the same as the one you used to build the plugin binary and main binary. For example, if you want to run the plugin binary and main binary on Ubuntu 20.04, you have to build it using Ubuntu 20.04.

With the limitations above, you will often encounter errors like this /lib64/libc.so.6: version 'GLIBC_2.xx' not found (required by /my/app). So you need to build Tob from source directly.

Getting started

  • Clone the latest Tob code
https://github.com/telkomdev/tob.git
  • create your plugin folder, for example dummyplugin
mkdir dummyplugin
  • copy the templateplugin.go and Makefile into your dummyplugin folder
cp docs/plugin/templateplugin.go dummyplugin/
cp docs/plugin/Makefile dummyplugin/
  • build the binary
cd dummyplugin/
make build
  • add configuration to your json config, by adjusting 2 fields. The kind field is filled with plugin, and pluginPath is filled with plugin files with the extension .so.
"dummy_plugin_one": {
    "kind": "plugin",
    "url": "https://www.google.com",
    "checkInterval": 5,
    "enable": false,
    "tags": ["product 1", "product 2"],
    "pics": ["bob", "john"],
    "pluginPath": "/home/john/tob/dummyplugin/dummyplugin.so",
    .....

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL