Code Monkey home page Code Monkey logo

Comments (15)

anishshaw avatar anishshaw commented on August 30, 2024

I too found the same issue, whereas I can see that file is present on my server.
[root@seliicbl01060 user]# /root/prometheus/oracledb_exporter.0.2.2.linux-amd64/oracledb_exporter -l log.level debug -l web.listen-address 9161
/root/prometheus/oracledb_exporter.0.2.2.linux-amd64/oracledb_exporter: error while loading shared libraries: libclntsh.so.18.1: cannot open shared object file: No such file or directory

[root@seliicbl01060 user]# find / -name libclntsh* -ls 2>/dev/null
536871462 76368 -rwxr-xr-x 1 root root 78200832 Feb 26 2019 /usr/lib/oracle/18.5/client64/lib/libclntsh.so.18.1
536871463 8164 -rwxr-xr-x 1 root root 8357160 Feb 26 2019 /usr/lib/oracle/18.5/client64/lib/libclntshcore.so.18.1
109193783 7848 -rwxr-x--- 1 oracle dba 8033199 Apr 12 2019 /opt/oracle/product/12gr2/db/inventory/Scripts/ext/lib/libclntshcore.so.12.1
109193786 69960 -rwxr-x--- 1 oracle dba 71638263 Apr 12 2019 /opt/oracle/product/12gr2/db/inventory/Scripts/ext/lib/libclntsh.so.12.1
511713792 7848 -rw-r----- 1 oracle dba 8033199 Apr 12 2019 /opt/oracle/product/12gr2/db/inventory/backup/2019-04-12_06-58-35PM/Scripts/ext/lib/libclntshcore.so.12.1
511713795 69960 -rw-r----- 1 oracle dba 71638263 Apr 12 2019 /opt/oracle/product/12gr2/db/inventory/backup/2019-04-12_06-58-35PM/Scripts/ext/lib/libclntsh.so.12.1
251662958 0 lrwxrwxrwx 1 oracle dba 17 Apr 12 2019 /opt/oracle/product/12gr2/db/lib/libclntsh.so -> libclntsh.so.12.1
251814403 7848 -rwxr-xr-x 1 oracle dba 8033608 Apr 12 2019 /opt/oracle/product/12gr2/db/lib/libclntshcore.so.12.1
251814406 69964 -rwxr-xr-x 1 oracle dba 71640160 Apr 12 2019 /opt/oracle/product/12gr2/db/lib/libclntsh.so.12.1
251814408 0 lrwxrwxrwx 1 oracle dba 12 Apr 12 2019 /opt/oracle/product/12gr2/db/lib/libclntsh.so.10.1 -> libclntsh.so
251814409 0 lrwxrwxrwx 1 oracle dba 12 Apr 12 2019 /opt/oracle/product/12gr2/db/lib/libclntsh.so.11.1 -> libclntsh.so
251658785 0 lrwxrwxrwx 1 oracle dba 21 Apr 12 2019 /opt/oracle/product/12gr2/db/lib/libclntshcore.so -> libclntshcore.so.12.1

As per pre-requisite I installed Oracle basic instant client 18.5 (earlier I installed 19.3 version but as per thrown error seems it was looking for 18.x version hence downgraded to 18.5, Still the same error)

from oracledb_exporter.

daveram avatar daveram commented on August 30, 2024

Actually got this working following previous issues posted by setting LD_LIBRARY_PATH. Also had ot install libaio as it's a prereq for oracle instantclient

If you want to see which libraries are missing
ldd <path_to_oracledb_exporter>

Don't forget when setting LD_LIBRARY_PATH to ensure it has no trailing slash as that's been a problem for some previously based on issue history

from oracledb_exporter.

Yannig avatar Yannig commented on August 30, 2024

I'm working on a release with several supported versions of Oracle libraries. But even in this case, the version used is anyway too old (11g).

Thanks @daveram for your answer.

from oracledb_exporter.

Duks03 avatar Duks03 commented on August 30, 2024

I observed that differnet version of Oracle basic instant client will have libclntsh.so.{version}.{sub-version} . Can any one please help me to understand why oracledb_exporter is asking only for libclntsh.so.18.1? I am using oracle client 12.1 for one of my old project and had same issue. I created libclntsh.so.18.1 symbolic link file to point libclntsh.so.12.1 which is working for me. Still little curious about this behaviour. Thanks :-)

from oracledb_exporter.

Yannig avatar Yannig commented on August 30, 2024

Programs written in go are static. Unfortunately, the Oracle lib forbids doing so. Therefore it remains an external dependency. Another problem, the lib file change is name with each release. Hence the symbolic link to make.

But another solution exists: use a Docker image. In this case, the exporter embarks dependencies and you no longer have to worry.

from oracledb_exporter.

packergundo avatar packergundo commented on August 30, 2024

I'm seeing that issue while using the docker image.... however, using the latest alpine image was successful. Or not. While it stays up unlike the standard docker image, it disconnects right away.

from oracledb_exporter.

Yannig avatar Yannig commented on August 30, 2024

There's a problem in value of the LD_LIBRARY_PATH.

To workaround this issue, you can run the exporter by exporting this:

docker run -it -e LD_LIBRARY_PATH=/usr/lib/oracle/18.5/client64/lib iamseth/oracledb_exporter:0.2.5

from oracledb_exporter.

packergundo avatar packergundo commented on August 30, 2024

I also found that 0.2.3. worked without that error, and thank you for that prompt update.

from oracledb_exporter.

Yannig avatar Yannig commented on August 30, 2024

I have released version 0.2.6a to fix this issue.

from oracledb_exporter.

m934030039 avatar m934030039 commented on August 30, 2024

Hi Yanning,

I am using your oracledb_exporter 0.2.6a but I got same issue.

 I am not using Docker but an physical HW server with Oracle 12.2.0 (Red Hat Enterprise Linux Server release 6.9 (Santiago)) 

NOTE: we must use Oracle 12.2.0

[oracledb_exporter.0.2.6a-ora18.5.linux-amd64]# ./oracledb_exporter
./oracledb_exporter: error while loading shared libraries: libclntsh.so.18.1: cannot open shared object file: No such file or directory

Many thanks,

-Sheng

from oracledb_exporter.

Yannig avatar Yannig commented on August 30, 2024

The problem here is that you are trying to use an Oracle client with very recent binaries (version 18.xxx) with an old Oracle base version (12c). To get around the problem, you have to install the binaries of 18 next to those of 12c.
The easiest way - by far - is to launch the exporter using Docker. This way, you will no longer have these dependencies problems.

from oracledb_exporter.

m934030039 avatar m934030039 commented on August 30, 2024

from oracledb_exporter.

Yannig avatar Yannig commented on August 30, 2024

If you are not sure what to do, nothing prevents you from using an exporter that is on another machine (running with Docker for example). Thus, no modification to be made on the production server.

from oracledb_exporter.

chabater avatar chabater commented on August 30, 2024

i have same issue on oracle version 1.12 , i try to link libclntsh.so.18.1 to /ora_sys/app/db12c/lib/libclntsh.so.18.1 , but it still error on oracledb_exporter[66102] : /root/oracledb_exporter.0.2.9-ora18.5.linux-amd64/oracledb_exporter: error while loading shared libraries: libclntsh.so.18.1: cannot open shared object file: No such file or directory

from oracledb_exporter.

6fears7 avatar 6fears7 commented on August 30, 2024

I figured it out:

What I did was made a new directory for my desired update version. In this case, it was 18.5:

/usr/lib/oracle/18.5/client64/lib

I then downloaded the 18.5 version from Oracle: https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html

I took the downloaded folder, "instantclient_18_5", and copied its contents into the /lib folder shown above.

I manage our oracle exporters via Ansible, so my env variables were set to my newly created directory when deploying locally:

oracle_home: /usr/lib/oracle/18.5/client64

ld_library_path: /usr/lib/oracle/18.5/client64/lib

You'll want to ensure your .service file within /etc/systemd/system/oracledb_exporter-<SID> has the following (adjust as needed in your environment):

ExecStart=/usr/local/bin/oracledb_exporter \ --web.listen-address 0.0.0.0:{{ item.exported_port }} \ --query.timeout=15 \ --default.metrics=/opt/prometheus/oracledb_exporter/default-metrics.toml \ --custom.metrics=/opt/prometheus/oracledb_exporter/custom-metrics-{{ item.oracle_database }}.toml \

BIG NOTE: Originally, I kept receiving "default-metrics not found: Exit Code 2", and discovered it was due to a permissions issue, so make sure your default metrics location has the proper permissions for the exporter to access.

I also performed systemctl daemon-reload when it seemed like my Ansible wasn't updating the configs.

Finally, systemctl status oracledb_exporter-<SID>.service showed me that my desired version, 0.3.2, was running.
Link: https://github.com/iamseth/oracledb_exporter/releases/tag/0.3.2

from oracledb_exporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.