<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">    I think i installed DBD::Oracle
      successfully, otherwise, i do not think i could have check this:<br>
      nagios@monitor:/usr/local/nagios/libexec$ ./check_oracle_health
      --connect IGAS --username ABC --password ABC
      --mode=connection-time<br>
      OK - 0.09 seconds to connect as ABC | connection_time=0.0934;1;5<br>
      <br>
      The env variables were set as nagios user, not as root. However
      there seems to be some sort of env variable problem, but i cannot
      figure out what.<br>
      <br>
          I deleted the env variables from bashrc of nagios user, and
      set them globally in /etc/env<br>
      nagios@monitor:/usr/local/nagios/etc/Eureko$ cat /etc/environment<br>
PATH="/home/nagios/perl5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/oracle/11.2/client/bin"<br>
      ORACLE_HOME="/usr/lib/oracle/11.2/client"<br>
      LD_LIBRARY_PATH="/usr/lib/oracle/11.2/client/lib"<br>
      <br>
      And define the following scripts<br>
      <br>
      nagios@monitor:/usr/local/nagios/libexec$ cat <b>check_oracle_health_time</b><br>
      #!/bin/bash<br>
      export ORACLE_HOME=/usr/lib/oracle/11.2/client<br>
      export PATH=$PATH:$ORACLE_HOME/bin<br>
      export LD_LIBRARY_PATH=$ORACLE_HOME/lib<br>
      perl /usr/local/nagios/libexec/check_oracle_health --connect IGAS
      --username ABC --password ABC --mode=connection-time<br>
      <br>
      nagios@monitor:/usr/local/nagios/libexec$ cat <b>check_oracle_health_tnsping</b><br>
      #!/bin/bash<br>
      export ORACLE_HOME=/usr/lib/oracle/11.2/client<br>
      export PATH=$PATH:$ORACLE_HOME/bin<br>
      export LD_LIBRARY_PATH=$ORACLE_HOME/lib<br>
      perl /usr/local/nagios/libexec/check_oracle_health --connect IGAS
      --username ABC --password ABC--mode=tnsping -method=sqlplus<br>
      <br>
      Both of this scrips should first set (again) the env variable and
      then run the desired check_oracle_health plugin.<br>
      <br>
      From CLI, all 4 execution as nagios user works:<br>
      nagios@monitor:/usr/local/nagios/libexec$
      ./check_oracle_health_tnsping<br>
      OK - connection established to IGAS.<br>
      nagios@monitor:/usr/local/nagios/libexec$ ./check_oracle_health
      --connect IGAS --username ABC --password ABC --mode=tnsping
      -method=sqlplus<br>
      OK - connection established to IGAS.<br>
      nagios@monitor:/usr/local/nagios/libexec$
      ./check_oracle_health_time<br>
      OK - 0.09 seconds to connect as ABC | connection_time=0.0897;1;5<br>
      nagios@monitor:/usr/local/nagios/libexec$ ./check_oracle_health
      --connect IGAS --username iapc_etl --password etl14admin
      --mode=connection-time<br>
      OK - 0.09 seconds to connect as ABC | connection_time=0.0915;1;5<br>
      <br>
      <br>
      But when defining services in Nagios strange thing happens:<br>
      <br>
      The services defined in Nagios with <br>
      check_oracle_health_tnsping and <br>
      /check_oracle_health --connect IGAS --username ABC --password ABC
      --mode=tnsping -method=sqlplus<br>
      both work, returning the corect result.<br>
      <br>
      The services defined with <br>
      check_oracle_health_time and<br>
      check_oracle_health --connect IGAS --username ABC --password ABC
      --mode=connection-time<br>
      both do not work returning:<br>
      CRITICAL - cannot connect to IGAS. install_driver(Oracle) failed:
      Can't locate DBD/Oracle.pm in @INC (@INC contains:
      /usr/local/nagios/libexec /etc/perl /usr/local/lib/perl/5.14.2
      /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5
      /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl
      .) at (eval 13) line 3. <br>
      <br>
      <br>
      So my question for someone who has made check_oracle_healt work
      is:<br>
      How come all 4 invocation from CLI as nagios user work, but when
      Nagios runs them, only 2 of them work.<br>
      I know that the error message tells me that there is some env
      variable path problem, but why are the first 2 calls of
      check_oracle_healt work then?<br>
      <br>
      <br>
      <br>
      <br>
      <pre class="moz-signature" cols="72"> Cosmin Neagu
 NOC Team Leader
 Str. I. G. Duca nr. 36
 Otopeni, Judetul Ilfov, 075100 Romania
 Tel: 021 303 3159 / 0732 669 193
 <a class="moz-txt-link-abbreviated" href="http://www.omnilogic.ro">www.omnilogic.ro</a>
</pre>
      On 10/29/2012 11:06 AM, Claudio Kuenzler wrote:<br>
    </div>
    <blockquote
cite="mid:CAF-yqggWiViqyp6ZGLgsQJtxCU4KRwpaiAk-imSb=K9PK9AyqQ@mail.gmail.com"
      type="cite">You didn't correctly install the DBD::Oracle or your
      env variables are not correct, as your error message shows it:<br>
      <br>
      Can't locate DBD/Oracle.pm in @INC (@INC contains:
      /usr/local/nagios/libexec /etc/perl /usr/local/lib/perl/5.14.2
      /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5
      /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl
      .) at (eval 13) line 3. <br>
      <br>
      You said that you have set the paths in .bashrc:<br>
      <br>
      <blockquote>I also set in .bashrc the enviroment variables:<br>
        export ORACLE_HOME=/usr/lib/oracle/11.2/client<br>
        export PATH=$PATH:$ORACLE_HOME/bin<br>
        export LD_LIBRARY_PATH=$ORACLE_HOME/lib<br>
      </blockquote>
      <div>You probably set this as root. Don't forget that Nagios runs
        under its own user! (by default: nagios). <br>
        <br>
      </div>
      <br>
      <br>
      <div class="gmail_quote">
        On Mon, Oct 29, 2012 at 9:50 AM, Cosmin Neagu <span dir="ltr"><<a
            moz-do-not-send="true"
            href="mailto:cosmin.neagu@omnilogic.ro" target="_blank">cosmin.neagu@omnilogic.ro</a>></span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div text="#000000" bgcolor="#FFFFFF">
            <div>Hi Nagios Users,<br>
              Can someone help me or give a hint on why
              check_oracle_health does not work (as describe below) ?
              <div>
                <div class="h5"><br>
                  On 10/23/2012 04:59 PM, Cosmin Neagu wrote:<br>
                </div>
              </div>
            </div>
            <blockquote type="cite">
              <div>
                <div class="h5">
                  <div>Hi all,<br>
                    <br>
                    I manage to install the oracle client on nagios
                    machine after all (google is the best) and making
                    all the necesary setting so that check_oracle_health
                    is working from command line as nagios user:<br>
                    <br>
                    nagios@monitor:/usr/local/nagios/libexec$
                    ./check_oracle_health --connect IGAS --username abc
                    --password abc --mode=tnsping<br>
                    Use of qw(...) as parentheses is deprecated at
                    ./check_oracle_health line 4163.<br>
                    Use of qw(...) as parentheses is deprecated at
                    ./check_oracle_health line 6167.<br>
                    OK - connection established to IGAS.<br>
                    nagios@monitor:/usr/local/nagios/libexec$
                    ./check_oracle_health --connect IGAS --username abc
                    --password abc --mode=connection-time<br>
                    Use of qw(...) as parentheses is deprecated at
                    ./check_oracle_health line 4163.<br>
                    Use of qw(...) as parentheses is deprecated at
                    ./check_oracle_health line 6167.<br>
                    OK - 0.10 seconds to connect as iapc_etl |
                    connection_time=0.0968;1;5<br>
                    nagios@monitor:/usr/local/nagios/libexec$
                    ./check_oracle_health --connect IGAS --username abc
                    --password abc --mode=connected-users<br>
                    Use of qw(...) as parentheses is deprecated at
                    ./check_oracle_health line 4163.<br>
                    Use of qw(...) as parentheses is deprecated at
                    ./check_oracle_health line 6167.<br>
                    OK - 31 connected users | connected_users=31;50;100<br>
                    <br>
                    <br>
                    The command is defined like this:<br>
                    define command{<br>
                            command_name check_oracle_health<br>
                            command_line $USER1$/check_oracle_health
                    $ARG1$<br>
                    }<br>
                    <br>
                    And the services:<br>
                    define service {<br>
                            use                     generic-service<br>
                            host_name               DBIGASDS<br>
                            service_description     Reachability via
                    tnsping<br>
                            check_command           check_oracle_health!
                    --connect IGAS --username abc --password abc
                    --mode=tnsping<br>
                            contacts                cosmin<br>
                    }<br>
                    <br>
                    define service {<br>
                            use                     generic-service<br>
                            host_name               DBIGASDS<br>
                            service_description     Connection time to
                    DB<br>
                            check_command          
                    check_oracle_health!--connect IGAS --username abc
                    --password abc mode=connection-time<br>
                            contacts                cosmin<br>
                    }<br>
                    define service {<br>
                            use                     generic-service<br>
                            host_name               DBIGASDS<br>
                            service_description     Connected users to
                    DB<br>
                            check_command          
                    check_oracle_health!--connect IGAS --username abc
                    --password abc mode=connected-users<br>
                            contacts                cosmin<br>
                    <br>
                    <br>
                    I also set in .bashrc the enviroment variables:<br>
                    export ORACLE_HOME=/usr/lib/oracle/11.2/client<br>
                    export PATH=$PATH:$ORACLE_HOME/bin<br>
                    export LD_LIBRARY_PATH=$ORACLE_HOME/lib<br>
                    <br>
                    <br>
                    But, in Nagios 3.4.1, i do not receive the corect
                    status for those services:<br>
                    For all 3 services i receive:<br>
                    CRITICAL - cannot connect to IGAS.
                    install_driver(Oracle) failed: Can't locate
                    DBD/Oracle.pm in @INC (@INC contains:
                    /usr/local/nagios/libexec /etc/perl
                    /usr/local/lib/perl/5.14.2
                    /usr/local/share/perl/5.14.2 /usr/lib/perl5
                    /usr/share/perl5 /usr/lib/perl/5.14
                    /usr/share/perl/5.14 /usr/local/lib/site_perl .) at
                    (eval 13) line 3. <br>
                    <br>
                    <br>
                    I realy don't know what to check anymore and why
                    does it say that, so any help would be apreciated.<br>
                    <br>
                        More info:<br>
                    nagios@monitor:/usr/local/nagios/libexec$
                    ./check_oracle_health -V<br>
                    check_oracle_health (1.7.3)<br>
                    nagios@monitor:/usr/local/nagios/etc$ uname -a<br>
                    Linux monitor 3.2.0-29-generic-pae #46-Ubuntu SMP
                    Fri Jul 27 17:25:43 UTC 2012 i686 i686 i386
                    GNU/Linux<br>
                    nagios@monitor:/usr/local/nagios/etc$ lsb_release -a<br>
                    No LSB modules are available.<br>
                    Distributor ID: Ubuntu<br>
                    Description:    Ubuntu 12.04.1 LTS<br>
                    Release:        12.04<br>
                    Codename:       precise<br>
                    <br>
                    <pre cols="72"> Cosmin Neagu
 NOC Team Leader
 Str. I. G. Duca nr. 36
 Otopeni, Judetul Ilfov, 075100 Romania
 Tel: 021 303 3159 / 0732 669 193
 <a moz-do-not-send="true" href="http://www.omnilogic.ro" target="_blank">www.omnilogic.ro</a>
</pre>
                    On 10/03/2012 09:34 AM, Claudio Kuenzler wrote:<br>
                  </div>
                  <blockquote type="cite">It's not that hard and a lot
                    of things are written in the documentation of
                    check_oracle_health. <br>
                    I even wrote an article about this in September 2011
                    explaining the steps:<br>
                    <a moz-do-not-send="true"
href="http://www.claudiokuenzler.com/blog/192/install-perl-dbd-oracle-DBD::Oracle-on-SuSE-SLES10-without-cpan"
                      target="_blank">http://www.claudiokuenzler.com/blog/192/install-perl-dbd-oracle-DBD::Oracle-on-SuSE-SLES10-without-cpan</a>
                    <br>
                    <br>
                    You should do it the way you prefer of course. But
                    in my setup I wanted to run check_oracle_health on a
                    standalone Nagios server. That way I also see if
                    there's a latency in the remote sql query. Real life
                    applications rarely use localhost connections.<br>
                    <br>
                    <div class="gmail_quote">On Wed, Oct 3, 2012 at 8:14
                      AM, Cosmin Neagu <span dir="ltr"><<a
                          moz-do-not-send="true"
                          href="mailto:cosmin.neagu@omnilogic.ro"
                          target="_blank">cosmin.neagu@omnilogic.ro</a>></span>
                      wrote:<br>
                      <blockquote class="gmail_quote" style="margin:0 0
                        0 .8ex;border-left:1px #ccc
                        solid;padding-left:1ex">
                        <div bgcolor="#FFFFFF" text="#000000">
                          <div>Well, thats the hard part for me,
                            installing those ORA files - didnt find yet
                            how to do that. I think installing the
                            plugin on DBServer and using NRPE is easier.
                            <div><br>
                              <pre cols="72"> Cosmin Neagu
 NOC Team Leader
 Str. I. G. Duca nr. 36
 Otopeni, Judetul Ilfov, 075100 Romania
 Tel: 021 303 3159 / 0732 669 193
 <a moz-do-not-send="true" href="http://www.omnilogic.ro" target="_blank">www.omnilogic.ro</a>
</pre>
                            </div>
                            <div>
                              <div> On 10/02/2012 06:05 PM, Claudio
                                Kuenzler wrote:<br>
                              </div>
                            </div>
                          </div>
                          <blockquote type="cite">
                            <div>
                              <div><br>
                                <div class="gmail_quote">
                                  <blockquote class="gmail_quote"
                                    style="margin:0 0 0
                                    .8ex;border-left:1px #ccc
                                    solid;padding-left:1ex"> The plugin
                                    needs to be installed on the Oracle
                                    Database server.<br>
                                  </blockquote>
                                  <div><br>
                                    That's not entirely correct. It can
                                    also run on a standalone Nagios
                                    server.<br>
                                    But you need to install the ora
                                    files to be able to launch the
                                    plugin against an Oracle DB server.<br>
                                    I did that successfully on Nagios
                                    3.3.1 against ORA11. <br>
                                     </div>
                                  <br>
                                </div>
                                <br>
                                <fieldset></fieldset>
                                <br>
                              </div>
                            </div>
                            <div>
                              <pre>------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
<a moz-do-not-send="true" href="http://p.sf.net/sfu/newrelic-dev2dev" target="_blank">http://p.sf.net/sfu/newrelic-dev2dev</a></pre>
                              <br>
                              <fieldset></fieldset>
                              <br>
                              <pre>_______________________________________________
Nagios-users mailing list
<a moz-do-not-send="true" href="mailto:Nagios-users@lists.sourceforge.net" target="_blank">Nagios-users@lists.sourceforge.net</a>
<a moz-do-not-send="true" href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null</pre>
                            </div>
                          </blockquote>
                          <br>
                        </div>
                        <br>
------------------------------------------------------------------------------<br>
                        Don't let slow site performance ruin your
                        business. Deploy New Relic APM<br>
                        Deploy New Relic app performance management and
                        know exactly<br>
                        what is happening inside your Ruby, Python, PHP,
                        Java, and .NET app<br>
                        Try New Relic at no cost today and get our sweet
                        Data Nerd shirt too!<br>
                        <a moz-do-not-send="true"
                          href="http://p.sf.net/sfu/newrelic-dev2dev"
                          target="_blank">http://p.sf.net/sfu/newrelic-dev2dev</a><br>
                        _______________________________________________<br>
                        Nagios-users mailing list<br>
                        <a moz-do-not-send="true"
                          href="mailto:Nagios-users@lists.sourceforge.net"
                          target="_blank">Nagios-users@lists.sourceforge.net</a><br>
                        <a moz-do-not-send="true"
                          href="https://lists.sourceforge.net/lists/listinfo/nagios-users"
                          target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
                        ::: Please include Nagios version, plugin
                        version (-v) and OS when reporting any issue.<br>
                        ::: Messages without supporting info will risk
                        being sent to /dev/null<br>
                      </blockquote>
                    </div>
                    <br>
                    <br>
                    <fieldset></fieldset>
                    <br>
                    <pre>------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
<a moz-do-not-send="true" href="http://p.sf.net/sfu/newrelic-dev2dev" target="_blank">http://p.sf.net/sfu/newrelic-dev2dev</a></pre>
                    <br>
                    <fieldset></fieldset>
                    <br>
                    <pre>_______________________________________________
Nagios-users mailing list
<a moz-do-not-send="true" href="mailto:Nagios-users@lists.sourceforge.net" target="_blank">Nagios-users@lists.sourceforge.net</a>
<a moz-do-not-send="true" href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null</pre>
                  </blockquote>
                  <br>
                  <br>
                  <fieldset></fieldset>
                  <br>
                </div>
              </div>
              <pre>------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
<a moz-do-not-send="true" href="http://p.sf.net/sfu/appdyn_sfd2d_oct" target="_blank">http://p.sf.net/sfu/appdyn_sfd2d_oct</a></pre>
              <div class="im"> <br>
                <fieldset></fieldset>
                <br>
                <pre>_______________________________________________
Nagios-users mailing list
<a moz-do-not-send="true" href="mailto:Nagios-users@lists.sourceforge.net" target="_blank">Nagios-users@lists.sourceforge.net</a>
<a moz-do-not-send="true" href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null</pre>
              </div>
            </blockquote>
            <br>
          </div>
          <br>
------------------------------------------------------------------------------<br>
          The Windows 8 Center - In partnership with Sourceforge<br>
          Your idea - your app - 30 days.<br>
          Get started!<br>
          <a moz-do-not-send="true"
            href="http://windows8center.sourceforge.net/"
            target="_blank">http://windows8center.sourceforge.net/</a><br>
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/<br>
          _______________________________________________<br>
          Nagios-users mailing list<br>
          <a moz-do-not-send="true"
            href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
          <a moz-do-not-send="true"
            href="https://lists.sourceforge.net/lists/listinfo/nagios-users"
            target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
          ::: Please include Nagios version, plugin version (-v) and OS
          when reporting any issue.<br>
          ::: Messages without supporting info will risk being sent to
          /dev/null<br>
        </blockquote>
      </div>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">------------------------------------------------------------------------------
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
<a class="moz-txt-link-freetext" href="http://windows8center.sourceforge.net/">http://windows8center.sourceforge.net/</a>
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Nagios-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/nagios-users">https://lists.sourceforge.net/lists/listinfo/nagios-users</a>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null</pre>
    </blockquote>
    <br>
  </body>
</html>