<div dir="ltr">You can set TSN_ADMIN =<path_where_tnsnames.ora> is located.<div><br></div><div>I how this can help you.<br><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2014-07-02 21:18 GMT+02:00 Giovanni Torres <span dir="ltr"><<a href="mailto:giovtorres@hotmail.com" target="_blank">giovtorres@hotmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I successfully compiled the oracle plugin for collectd but I can't get it to work.<br>
<br>
I installed oracle-instantclient12.1-devel-12.1.0.1.0-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.<br>
<br>
Here is my oracle config in /etc/collectd.d/<br>
<br>
LoadPlugin oracle<br>
<br>
<Plugin oracle><br>
<br>
<Query "io_per_tablespace"><br>
Statement "SELECT sum(vf.PHYBLKRD)*8192 AS PHY_BLK_R, \<br>
sum(vf.PHYBLKWRT)*8192 AS PHY_BLK_W, \<br>
'tablespace' AS i_prefix, \<br>
dt.tablespace_name \<br>
FROM ((dba_data_files dd JOIN v$filestat vf ON dd.file_id = vf.file# ) \<br>
JOIN dba_tablespaces dt ON dd.tablespace_name = dt.tablespace_name) \<br>
GROUP BY dt.tablespace_name"<br>
<Result><br>
Type "io_octets"<br>
InstancesFrom "i_prefix" "TABLESPACE_NAME"<br>
ValuesFrom "PHY_BLK_R" "PHY_BLK_W"<br>
</Result><br>
</Query><br>
<br>
<Database "DB1"><br>
ConnectID "DEV"<br>
Username "collectd"<br>
Password "secret"<br>
Query "io_per_tablespace"<br>
</Database><br>
<br>
</Plugin><br>
<br>
<br>
This is the log entry from the oracle plugin:<br>
<br>
[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<br>
<br>
<br>
I have a tnsnames.ora in $ORACLE_HOME/network/admin but the daemon doesn't seem to be looking for it:<br>
<br>
strace -e access,open /usr/sbin/collectd -C /etc/collectd.conf -f<br>
<br>
open("/etc/collectd.d/oracle.conf", O_RDONLY) = 3<br>
open("/usr/lib64/collectd/oracle.so", O_RDONLY) = 6<br>
open("/usr/lib/oracle/12.1/client64/lib/libclntsh.so.12.1", O_RDONLY) = 6<br>
open("/usr/lib/oracle/12.1/client64/lib/libnnz12.so", O_RDONLY) = 6<br>
open("/usr/lib/oracle/12.1/client64/lib/libons.so", O_RDONLY) = 6<br>
open("/usr/lib/oracle/12.1/client64/lib/libclntshcore.so.12.1", O_RDONLY) = 6<br>
open("/usr/lib/oracle/12.1/client64/lib/libociei.so", O_RDONLY) = 5<br>
open("/usr/lib/oracle/12.1/client64/network/admin/oraaccess.xml", O_RDONLY) = -1 ENOENT (No such file or directory)<br>
access("/usr/lib/oracle/12.1/client64/network/admin/oraaccess.xml", F_OK) = -1 ENOENT (No such file or directory)<br>
access("/usr/lib/oracle/12.1/client64/network/admin/oraaccess.xml", F_OK) = -1 ENOENT (No such file or directory)<br>
open("/usr/lib/oracle/12.1/client64/network/admin/oraaccess.xml", O_RDONLY) = -1 ENOENT (No such file or directory)<br>
access("/usr/lib/oracle/12.1/client64/network/admin/sqlnet.ora", F_OK) = 0<br>
open("/usr/lib/oracle/12.1/client64/network/admin/sqlnet.ora", O_RDONLY) = 5<br>
access("/root/.sqlnet.ora", F_OK) = -1 ENOENT (No such file or directory)<br>
open("/etc/orabasetab", O_RDONLY) = -1 ENOENT (No such file or directory)<br>
open("/usr/lib/oracle/12.1/client64/install/orabasetab", O_RDONLY) = -1 ENOENT (No such file or directory)<br>
access("/usr/lib/oracle/12.1/client64/network/admin/sqlnet.ora", F_OK) = 0<br>
open("/usr/lib/oracle/12.1/client64/network/admin/sqlnet.ora", O_RDONLY) = 6<br>
access("/usr/lib/oracle/12.1/client64/network/admin/intchg.ora", F_OK) = -1 ENOENT (No such file or directory)<br>
access("/etc/intchg.ora", F_OK) = -1 ENOENT (No such file or directory)<br>
access("/usr/lib/oracle/12.1/client64/network/admin/intchg.ora", F_OK) = -1 ENOENT (No such file or directory)<br>
access("/usr/lib/oracle/12.1/client64/network/admin/tnsnav.ora", F_OK) = -1 ENOENT (No such file or directory)<br>
access("/etc/tnsnav.ora", F_OK) = -1 ENOENT (No such file or directory)<br>
access("/usr/lib/oracle/12.1/client64/network/admin/tnsnav.ora", F_OK) = -1 ENOENT (No such file or directory)<br>
<br>
<br>
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.<br>
<br>
<br>
Can someone point out what I may be doing wrong or what I have missed to get this to work?<br>
<br>
<br>
Thanks,<br>
Giovanni<br>
<br>
_______________________________________________<br>
collectd mailing list<br>
<a href="mailto:collectd@verplant.org">collectd@verplant.org</a><br>
<a href="http://mailman.verplant.org/listinfo/collectd" target="_blank">http://mailman.verplant.org/listinfo/collectd</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><p align="right"><font face="Verdana, Geneva, Arial, Sans-serif">Att</font></p>
<p align="right"><font face="Verdana, Geneva, Arial, Sans-serif">Toni Moreno</font></p>
<p align="right"><font face="Verdana, Geneva, Arial, Sans-serif">699706656</font></p><img src="http://graphics.hotmail.com/greypixel.gif" height="2" vspace="9" width="100%"><br>
<p align="right"><em>Si no quieres perderte en el olvido tan pronto como estés muerto y corrompido, </em></p>
<p align="right"><em>escribe cosas dignas de leerse, o haz cosas dignas de escribirse.</em></p>
<p align="right"> </p>
<p align="right"><strong><em>Benjamin Franklin</em></strong> <br></p>
</div>