3 nbdkit-probing - how to probe for nbdkit configuration and plugins
9 nbdkit PLUGIN --dump-plugin
13 You can query information about nbdkit and available plugins from the
16 =head2 Query basic configuration
20 lists information about how nbdkit was configured. The most important
21 fields in the output are the name of the directory where nbdkit looks
22 for plugins and the version of nbdkit, eg:
24 plugindir=/usr/lib64/nbdkit/plugins
27 =head2 Query information about a particular plugin
29 nbdkit pluginname --dump-plugin
31 (where I<pluginname> is the name or full path of a plugin) will dump
32 information about that plugin, eg:
34 $ nbdkit file --dump-plugin
35 path=/usr/lib64/nbdkit/plugins/nbdkit-file-plugin.so
40 thread_model=serialize_requests
43 Plugins which ship with nbdkit usually have the same version as the
44 corresponding nbdkit binary. The nbdkit binary will always be able to
45 utilize plugins compiled against an older version of the header;
46 however, newer plugins may not be fully supported by an older nbdkit
47 binary (for example, a plugin compiled with C<NBDKIT_API_VERSION> of 2
48 fails to load with an older nbdkit that only knows
49 C<NBDKIT_API_VERSION> 1).
51 =head2 Detect if a plugin is installed
53 To find out if a plugin is installed (and working) in the plugin
54 directory, use I<--dump-plugin> as above:
56 $ nbdkit foo --dump-plugin
57 nbdkit: error: cannot open plugin 'foo': /usr/lib64/nbdkit/plugins/nbdkit-foo-plugin.so: cannot open shared object file: No such file or directory
58 Use 'nbdkit --help' or read the nbdkit(1) manual page for documentation.
60 Note it is better to test for the existence of plugins this way rather
61 than just seeing if the F<.so> file exists, because nbdkit will load
62 the plugin and check that all its dependencies can be satisfied, and
63 also that plugin registration works.
65 =head2 List all plugins in the plugin directory
67 You could simply get the plugin directory (from I<--dump-config>) and
68 list all files in this directory called F<nbdkit-*-plugin.so>.
70 However a better test is to run I<--dump-plugin> (see above) on each
71 one to check that it is working and all of its dependencies are
72 installed. A complete shell script which does this is:
75 plugindir=`nbdkit --dump-config | grep ^plugindir= | sed 's/[^=]*=//'`
76 for f in $plugindir/nbdkit-*-plugin.so; do
77 if nbdkit "$f" --dump-plugin >/dev/null 2>&1; then
78 b=`echo "$f" | sed 's,.*/nbdkit-\(.*\)-plugin.so$,\1,'`
83 =head2 Detect if a filter is installed
85 To find out if a filter is installed (and working) use
86 I<--dump-plugin> with the C<null> plugin and the name of the filter to
89 nbdkit --dump-plugin --filter=foo null
91 This will fail with an error and non-zero exit code if the C<foo>
92 filter cannot be loaded.
108 Copyright (C) 2013-2018 Red Hat Inc.