title: Using Monitoring::Plugin
parent: FAQ
---

# How do I use the Monitoring::Plugin module?

The Monitoring::Plugin Perl module can be obtained from two main locations:

* from the Monitoring Plugins tarball with an
  [extra configure option][configure-module]
* from [CPAN][cpan-module]

If you install from the Monitoring Plugins tarball, the Perl module will be
installed in `$prefix/perl`.

If you install from CPAN, the Perl module will be installed into your Perl's
system directories by default.

To write your plugin, you should start it with:

    use FindBin;
    use lib "$FindBin::Bin/../perl/lib";
    use Monitoring::Plugin;

This bit of code tells Perl to look for the Monitoring::Plugin module in a
directory relative to where the plugin is executed - this is a hard
dependency.  If Monitoring::Plugin is not found there, Perl's system directories
will be searched.

This approach allows a system administrator to decide whether they want
Monitoring::Plugin installed via system directories or within the `$prefix` area
of the plugins.

[configure-module]: doc/faq/build-perl-module.html "configure with Monitoring::Plugin"
[cpan-module]: http://search.cpan.org/dist/Monitoring-Plugin/ "Monitoring::Plugin on CPAN"

<!--% # vim:set filetype=markdown textwidth=78 joinspaces expandtab: # %-->