Index: pkg-nagios-plugins-contrib/check_printer/check_printer
===================================================================
--- pkg-nagios-plugins-contrib.orig/check_printer/check_printer
+++ pkg-nagios-plugins-contrib/check_printer/check_printer
@@ -33,11 +33,27 @@
 use strict;
 use warnings;
 
-my $OS = `uname`;
-if ($OS =~ m/^\wBSD/){
-	use lib "/usr/local/libexec/nagios";
-} elsif ($OS =~ m/Linux/){
-	use lib "/usr/local/nagios/libexec";
+sub load_module {
+    my @names = @_;
+    my $module;
+    for my $name (@names) {
+        my $file = $name;
+        # requires need either a bare word or a file name
+        $file =~ s{::}{/}gsxm;
+        $file .= '.pm';
+        eval {
+            require $file;
+            $name->import(qw(%ERRORS));
+            $module = $name;
+		};
+		last if $module;
+    }
+    return $module;
+}
+
+my $plugin_module;
+BEGIN {
+	$plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' );
 }
 
 use Getopt::Long;
