0

I'm using the Cacti script/command method to collect data. I have a perl script that connects to an Oracle database and returns two numbers. This script works perfectly when run on the command line (Unix).

For this perl script to work properly I have to define several environment variables so that it is able to connect to Oracle.

$ENV{ORACLE_HOME} = ...etc...

But - when I create a data input method in Cacti to run this perl script... I recieve an error stating that it is unable to find the DBD/Oracle.pm. (This is because the environment variables are not being set by Perl).

Does anyone know why the ENV variables are set properly when I run this on command line?

But they are not able to be set when run by Cacti?

By the way - Cacti is running the perl script as root.

mscccc
  • 2,190
  • 6
  • 25
  • 39
  • Could you tell us where your Oracle.pm is located and show us the script? – matthias krull Jul 29 '11 at 23:21
  • $ORACLE_HOME does not affect perl's ability to find `DBD/Oracle.pm`. If `use DBD::Oracle` reports `Cant' locate DBD/ORacle.pm in ...`, then `@INC` is not set up correctly. Have a look at your settings for the environment variables `$PERL5LIB` and `$PERLLIB` which affect the initial setting of `@INC`. In general, I've found that once `DBD::Oracle` has been installed, it is not necessary to set `$ORACLE_HOME` in order to use it. – perlman Aug 01 '11 at 05:10

1 Answers1

0

Solved!

The issue ended up being that Root did not have read access to the Oracle.pm.

Once I stopped looking into the ENV variables being the problem... the permissions were the next obvious issue.

Thanks for your help in the comments.

mscccc
  • 2,190
  • 6
  • 25
  • 39