X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=contrib%2Fexamples%2FMyPlugin.pm;h=13806ee91157fc1592b220b5191b192907ab264c;hb=5e700757575fa6606cf201947cb0efb57ce12e6d;hp=1a0247ff8e068cb7c1fd0d5b30169413f9977635;hpb=d0b7e88ee93371c25241f6a1fed3b4918087bb0c;p=collectd.git diff --git a/contrib/examples/MyPlugin.pm b/contrib/examples/MyPlugin.pm index 1a0247ff..13806ee9 100644 --- a/contrib/examples/MyPlugin.pm +++ b/contrib/examples/MyPlugin.pm @@ -21,7 +21,12 @@ use Collectd qw( :all ); # data set definition: # see section "DATA TYPES" in collectd-perl(5) for details -# (take a look at the types.db file for a large list of predefined data-sets) +# +# NOTE: If you're defining a custom data-set, you have to make that known to +# any servers as well. Else, the server is not able to store values using the +# type defined by that data-set. +# It is strongly recommended to use one of the types and data-sets pre-defined +# in the types.db file. my $dataset = [ { @@ -70,7 +75,8 @@ sub my_read # dispatch the values to collectd which passes them on to all registered # write functions - the first argument is used to lookup the data set - # definition + # definition (it is strongly recommended to use a type defined in the + # types.db file) plugin_dispatch_values ('myplugin', $vl); # A false return value indicates an error and the plugin will be skipped