github.com/netdata/go.d.plugin@v0.58.1/modules/example/README.md (about) 1 <!-- 2 title: "Example module" 3 description: "Use this example data collection module, which produces example charts with random values, to better understand how to build your own collector in Go." 4 custom_edit_url: "https://github.com/netdata/go.d.plugin/edit/master/modules/example/README.md" 5 sidebar_label: "Example module in Go" 6 learn_status: "Published" 7 learn_topic_type: "References" 8 learn_rel_path: "Integrations/Monitor/Mock Collectors" 9 --> 10 11 # Example module 12 13 An example data collection module. Use it as an example writing a new module. 14 15 ## Charts 16 17 This module produces example charts with random values. Number of charts, dimensions and chart type is configurable. 18 19 ## Configuration 20 21 Edit the `go.d/example.conf` configuration file using `edit-config` from the 22 Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md), which is typically at `/etc/netdata`. 23 24 ```bash 25 cd /etc/netdata # Replace this path with your Netdata config directory 26 sudo ./edit-config go.d/example.conf 27 ``` 28 29 Disabled by default. Should be explicitly enabled 30 in [go.d.conf](https://github.com/netdata/go.d.plugin/blob/master/config/go.d.conf). 31 32 ```yaml 33 # go.d.conf 34 modules: 35 example: yes 36 ``` 37 38 Here is an example configuration with several jobs: 39 40 ```yaml 41 jobs: 42 - name: example 43 charts: 44 num: 3 45 dimensions: 5 46 47 - name: hidden_example 48 hidden_charts: 49 num: 3 50 dimensions: 5 51 ``` 52 53 --- 54 55 For all available options, see the Example 56 collector's [configuration file](https://github.com/netdata/go.d.plugin/blob/master/config/go.d/example.conf). 57 58 ## Troubleshooting 59 60 To troubleshoot issues with the `example` collector, run the `go.d.plugin` with the debug option enabled. The output 61 should give you clues as to why the collector isn't working. 62 63 - Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on 64 your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. 65 66 ```bash 67 cd /usr/libexec/netdata/plugins.d/ 68 ``` 69 70 - Switch to the `netdata` user. 71 72 ```bash 73 sudo -u netdata -s 74 ``` 75 76 - Run the `go.d.plugin` to debug the collector: 77 78 ```bash 79 ./go.d.plugin -d -m example 80 ```