install_driver(Pg) failed: Can’t locate DBD/Pg.pm in @INC

This error message was received when attempting to run an NRPE command from the shell. The fill error is below followed by how the issue was resolved.

The error has been posted on the next page because of its length.

Error Message:

bash

  1. [root@server libexec]# perl check_pg_connections.pl dev.example.com test_db
  2. install_driver(Pg) failed: Can't locate DBD/Pg.pm in @INC (@INC contains:
  3. /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
  4. /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi
  5. /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi
  6. /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
  7. /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7
  8. /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5
  9. /usr/lib/perl5/site_perl
  10. /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
  11. /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi
  12. /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi
  13. /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
  14. /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7
  15. /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5
  16. /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi
  17. /usr/lib/perl5/5.8.8 .) at (eval 3) line 3.
  18. Perhaps the DBD::Pg perl module hasn't been fully installed,
  19. or perhaps the capitalisation of 'Pg' isn't right.
  20. Available drivers: DBM, ExampleP, File, Gofer, Proxy, Sponge, mysql.
  21.  at check_pg_connections.pl line 24

How to Resolve:
All that’s needs to be done here is to install the Perl Postgres database driver which can be completed by issuing the following command.
shell#yum install perl-DBD-Pg

Once installed you should no longer receive the error above.

More information on Perl can be obtained by reading the book below:

Learning Perl, 5th Edition (Paperback)


List Price: $39.99
New From: $15.82 USD In Stock
Used from: $0.01 USD In Stock

Share