[collectd] oracle plugin can't find tnsnames.ora

Wilfried Goesgens dothebart at citadel.org
Tue Jul 8 21:53:05 CEST 2014


Hm, strace doesn't know about getenv, but ltrace does:   

http://stackoverflow.com/questions/8494434/find-out-which-environment-variable
s-used-by-a-command  

so you can see which environment variables the oracle library code queries...
 
>  Tue Jul 08 2014 15:17:16 EDT from "Giovanni Torres"
><giovtorres at hotmail.com>  Subject: Re: [collectd] oracle plugin can't find
>tnsnames.ora
>
>    Tried that before and it didn't work. Thanks for the suggestion.
> 
> --- Original Message ---
> 
> From: "Toni Moreno" <toni.moreno at gmail.com>
> Sent: July 7, 2014 6:13 PM
> To: "Giovanni Torres" <giovtorres at hotmail.com>
> Cc: collectd at verplant.org
> Subject: Re: [collectd] oracle plugin can't find tnsnames.ora
> 
>
>    You can set  TSN_ADMIN =<path_where_tnsnames..ora> is located.   
>
>  I how this can help you.
>   
>
>   
>
>  
>
>  
>
>  
> 
>  2014-07-02 21:18 GMT+02:00 Giovanni Torres  <giovtorres at hotmail.com>:
>  
>>I successfully compiled the oracle plugin for collectd but I can't get it
>>to work.
>> 
>> I installed oracle-instantclient12.1-devel-12.1.0.10-1.x86_64 and
>>oracle-instantclient12.1-basic-12.1.0.1.0-1.x86_64.  I set $ORACLE_HOME in
>>/etc/profile.d and I set the LD_LIBRARY_PATH in /etc/ld.so.conf.d.
>> 
>> Here is my oracle config in /etc/collectd.d/
>> 
>> LoadPlugin oracle
>> 
>> <Plugin oracle>
>> 
>>   <Query "io_per_tablespace">
>>     Statement "SELECT sum(vf.PHYBLKRD)*8192 AS PHY_BLK_R, \
>>                       sum(vf.PHYBLKWRT)*8192 AS
>>PHY_BLK_W, \
>>                       'tablespace' AS i_prefix, \
>>                       dt.tablespace_name \
>>                    FROM ((dba_data_files dd JOIN
>>v$filestat vf ON dd.file_id = vf.file# ) \
>>                          JOIN dba_tablespaces dt
>>ON dd.tablespace_name = dt.tablespace_name) \
>>                    GROUP BY dt.tablespace_name"
>>     <Result>
>>       Type "io_octets"
>>       InstancesFrom "i_prefix" "TABLESPACE_NAME"
>>       ValuesFrom "PHY_BLK_R" "PHY_BLK_W"
>>     </Result>
>>   </Query>
>> 
>>   <Database "DB1">
>>     ConnectID "DEV"
>>     Username "collectd"
>>     Password "secret"
>>     Query "io_per_tablespace"
>>   </Database>
>> 
>> </Plugin>
>> 
>> 
>> This is the log entry from the oracle plugin:
>> 
>> [2014-07-02 15:12:24] oracle plugin: o_read_database (db = DB1, query =
>>(none)): OCILogon("DEV") failed: ORA-12154: TNS:could not resolve the connect
>>identifier specified
>> 
>> 
>> I have a tnsnames.ora in $ORACLE_HOME/network/admin but the daemon doesn't
>>seem to be looking for it:
>> 
>> strace -e access,open /usr/sbin/collectd -C /etc/collectd.conf -f
>> 
>> open("/etc/collectd.d/oracle.conf", O_RDONLY) = 3
>> open("/usr/lib64/collectd/oracle.so", O_RDONLY) = 6
>> open("/usr/lib/oracle/12.1/client64/lib/libclntsh.so.12.1", O_RDONLY) = 6
>> open("/usr/lib/oracle/12.1/client64/lib/libnnz12.so", O_RDONLY) = 6
>> open("/usr/lib/oracle/12.1/client64/lib/libons.so", O_RDONLY) = 6
>> open("/usr/lib/oracle/12.1/client64/lib/libclntshcore.so.12.1", O_RDONLY)
>>= 6
>> open("/usr/lib/oracle/12.1/client64/lib/libociei.so", O_RDONLY) = 5
>> open("/usr/lib/oracle/12.1/client64/network/admin/oraaccess.xml",
>>O_RDONLY) = -1 ENOENT (No such file or directory)
>> access("/usr/lib/oracle/12.1/client64/network/admin/oraaccess.xml", F_OK)
>>= -1 ENOENT (No such file or directory)
>> access("/usr/lib/oracle/12.1/client64/network/admin/oraaccess.xml", F_OK)
>>= -1 ENOENT (No such file or directory)
>> open("/usr/lib/oracle/12.1/client64/network/admin/oraaccess.xml",
>>O_RDONLY) = -1 ENOENT (No such file or directory)
>> access("/usr/lib/oracle/12.1/client64/network/admin/sqlnet.ora", F_OK) = 0
>> open("/usr/lib/oracle/12.1/client64/network/admin/sqlnet.ora", O_RDONLY) =
>>5
>> access("/root/.sqlnet.ora", F_OK)       = -1 ENOENT (No such file or
>>directory)
>> open("/etc/orabasetab", O_RDONLY)       = -1 ENOENT (No such file or
>>directory)
>> open("/usr/lib/oracle/12.1/client64/install/orabasetab", O_RDONLY) = -1
>>ENOENT (No such file or directory)
>> access("/usr/lib/oracle/12.1/client64/network/admin/sqlnet.ora", F_OK) = 0
>> open("/usr/lib/oracle/12.1/client64/network/admin/sqlnet.ora", O_RDONLY) =
>>6
>> access("/usr/lib/oracle/12.1/client64/network/admin/intchg.ora", F_OK) =
>>-1 ENOENT (No such file or directory)
>> access("/etc/intchg.ora", F_OK)         = -1 ENOENT (No such file
>>or directory)
>> access("/usr/lib/oracle/12.1/client64/network/admin/intchg.ora", F_OK) =
>>-1 ENOENT (No such file or directory)
>> access("/usr/lib/oracle/12.1/client64/network/admin/tnsnav.ora", F_OK) =
>>-1 ENOENT (No such file or directory)
>> access("/etc/tnsnav.ora", F_OK)         = -1 ENOENT (No such file
>>or directory)
>> access("/usr/lib/oracle/12.1/client64/network/admin/tnsnav.ora", F_OK) =
>>-1 ENOENT (No such file or directory)
>> 
>> 
>> It doesn't appear to be looking for tnsnames.ora.  My $ORACLE_HOME is
>>/usr/lib/oracle/12.1/client64.  This is the same ORACLE_HOME that was used
>>when compiling the plugin, if that matters.
>> 
>> 
>> Can someone point out what I may be doing wrong or what I have missed to
>>get this to work?
>> 
>> 
>> Thanks,
>> Giovanni
>> 
>> _______________________________________________
>> collectd mailing list
>> collectd at verplant.org
>> http://mailman.verplant.org/listinfo/collectd

>  
>
>  
> 
>   
>
>  -- 
>  
>
>Att  
>
>Toni Moreno  
>
>699706656  
>   
>
>/Si no quieres perderte en el olvido tan pronto como estés muerto y
>corrompido, /  
>
>/escribe cosas dignas de leerse, o haz cosas dignas de escribirse./  
>
>   
>
>*/Benjamin Franklin/*   
>
>  
>
>  
>
>   (, 0 bytes) [View| Download]
>   
>
>  
>
>  
>
>  

  

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20140708/d1425686/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20140708/d1425686/attachment-0001.ksh>


More information about the collectd mailing list