netdata icon indicating copy to clipboard operation
netdata copied to clipboard

Custom plugin - not showing in charts, no errors

Open jchrisweaver opened this issue 9 years ago • 4 comments

Custom python plugin because I have some special data gathering requirements. However, I'm just trying to get the plugin to appear in charts so I can start that custom work.

Here's the output of python.d.plugin debug 1 mytester:

2017-09-04 23:08:37: python.d INFO: MODULES_DIR='/opt/netdata/usr/libexec/netdata/python.d/', CONFIG_DIR='plugins.d/../../../../etc/netdata/', UPDATE_EVERY=1, ONLY_MODULES=['mytester']
2017-09-04 23:08:37: python.d DEBUG: mytester: loading module configuration: 'plugins.d/../../../../etc/netdata/python.d/mytester.conf'
2017-09-04 23:08:37: python.d DEBUG: mytester: reading configuration

2017-09-04 23:08:37: python.d INFO: redis import /usr/local/lib/python2.7/dist-packages/redis/__init__.pyc
2017-09-04 23:08:37: python.d DEBUG: mytester: job added
2017-09-04 23:08:37: python.d DEBUG: all job objects [<Service(None, initial daemon)>]
2017-09-04 23:08:37: python.d INFO: CHECKED OK: mytester
2017-09-04 23:08:37: python.d DEBUG: overridden job names: []
2017-09-04 23:08:37: python.d DEBUG: all remaining job objects: [<Service(None, initial daemon)>]
Raw data: -->['test', 'data', '5']<--
CHART mytester.processing '' 'Currently Processing' 'current number images processing' mytester mytester.cur_processing line 90000 1
DIMENSION cur_processing cur_processing absolute 1 1
CHART mytester.total_processed '' 'Total Processed' 'total number of images processing' imageindx mytester.total_processed line 90001 1
DIMENSION total_processed total_processed incremental 1 1
CHART mytester.download_speed '' 'Download Speed' 'bytes per second' imageindx mytester.download_speed line 90002 1
DIMENSION download_speed download_speed absolute 1 1

CHART netdata.plugin_pythond_mytester '' 'Execution time for mytester plugin' 'milliseconds / run' python.d netdata.plugin_python area 145000 1
DIMENSION run_time 'run time' absolute 1 1

2017-09-04 23:08:37: python.d DEBUG: created charts for mytester
2017-09-04 23:08:37: python.d DEBUG: mytester starting data collection - update frequency: 1.0  retries allowed: 60
2017-09-04 23:08:37: python.d DEBUG: mytester sleeping for 0.318516969681 secs to reach frequency of 1.0 secs, now: 1504566517.68  next: 1504566518.0  penalty: 0
Raw data: -->['test', 'data', '5']<--
BEGIN mytester.processing 0
SET cur_processing = 5
END
BEGIN mytester.total_processed 0
SET total_processed = 20
END
BEGIN mytester.download_speed 0
SET download_speed = 55
END

BEGIN netdata.plugin_pythond_mytester 0
SET run_time = 0
END

Here's what I've added into netdata-configs/netdata.conf:

[netdata:plugin_pythond_mytester]

[mytester:processing]

The only thing that appears in the error.log is:

2017-09-04 22:03:17: python.d INFO: CHECKED OK: mytester

The new charts don't appear in 19999/api/v1/charts.

I've read the two main pages on the wiki re: custom plugins. I've read all the other docs I could find. I've looked at most of the python examples. I've reloaded the service. I've tried A LOT of variations for entries in the netdata.conf. Any assistance would be greatly appreciated....

jchrisweaver avatar Sep 04 '17 23:09 jchrisweaver

Hi,

Could you please run:

python.d.plugin 1 mytester 2>/dev/null

I think you are printing to stdout this:

Raw data: -->['test', 'data', '5']<--

And netdata disables the entire python.d.plugin because it receives garbage. There should be a log about this.

Please note that you don't need to configure anything for netdata to accept the metrics. Just push them.

ktsaou avatar Sep 05 '17 05:09 ktsaou

netdata disables the entire python.d.plugin because it receives garbage.

This was the key part. I deleted my trace prints (which you referred to), deleted the netdata.conf and the plugin details showed up in the charts.

There should be a log about this.

There was nothing in the logs that indicated an issue that I could find by searching for "mytester"

Thank you for your assistance.

jchrisweaver avatar Sep 05 '17 12:09 jchrisweaver

There was nothing in the logs that indicated an issue that I could find by searching for "mytester"

Yes you are right. netdata does not know anything about this module. netdata should have complained about python.d.plugin.

ktsaou avatar Sep 05 '17 22:09 ktsaou

I am closing this. If you need more help, just post.

ktsaou avatar Sep 05 '17 22:09 ktsaou