GithubHelp home page GithubHelp logo

Windows support? about oracledb_exporter HOT 9 CLOSED

iamseth avatar iamseth commented on August 11, 2024 1
Windows support?

from oracledb_exporter.

Comments (9)

pnrmx avatar pnrmx commented on August 11, 2024 1

I tried to build oracledb_exporter for windows, but this fails to build for me due to:

/home/mika/src/gopath/src/github.com/mattn/go-oci8/connector.go:14:10: undefined: OCI8Connector
/home/mika/src/gopath/src/github.com/mattn/go-oci8/connector.go:20:22: undefined: OCI8Connector
/home/mika/src/gopath/src/github.com/mattn/go-oci8/connector.go:21:9: undefined: OCI8Driver
[...]
/home/mika/src/gopath/src/github.com/mattn/go-oci8/connector.go:21:9: too many errors

I'm aware that the problem is lying within https://github.com/mattn/go-oci8, but I'm wondering if there are any plans to provide releases for Windows?

Thanks for providing oracledb_exporter!

How to compile on windows 64 bit:

  • download Oracle Instant Client 64-Bit version
    basic and sdk versions,
  • extract client (in my opinion this C:\oracle\instantclient_18_5) and extract SDK to the same folder (C:\oracle\instantclient_18_5\sdk)
  • set the environment variables
setx CGO_CFLAGS "C:\oracle\instantclient_18_5\sdk\include"
setx CGO_LDFLAGS "-LC:\oracle\instantclient_18_5 -loci"
  • Then install GCC - I prefer MSYS2 64 bit (for example in c:\msys64)
  • Run the MSYS2 MINGW64 terminal and set dependencies packages:
# Update pacman
pacman -Su
# Close terminal and open a new terminal
# Update all other packages
pacman -Su
# Install pkg-config and gcc
pacman -S mingw64/mingw-w64-x86_64-pkg-config mingw64/mingw-w64-x86_64-gcc
  • go to the pkg-config dir c:/msys64/mingw64/lib/pkgconfig/ and create oci8.pc as this example:
prefix=C:\oracle\instantclient_18_5/sdk/
version=18.5
build=client64
libdir=C:\oracle\instantclient_18_5/sdk/lib/msvc
includedir=C:\oracle\instantclient_18_5/sdk/include
glib_genmarshal=glib-genmarshal
gobject_query=gobject-query
glib_mkenums=glib-mkenums
Name: oci8
Description: Oracle database engine
Version: ${version}
Libs: -L${libdir} -loci
Libs.private:
Cflags: -I${includedir}
  • Set %PKG_CONFIG_PATH% as the environment variable:
    setx PKG_CONFIG_PATH "C:\msys64\mingw64\lib\pkgconfig"
  • Ensure, that %PATH% includes path to the msys64 binares, if not set it: setx path "%path%;C:\msys64\mingw64\bin"
  • everything must comiple, including mattn driver for oracle.

from oracledb_exporter.

pnrmx avatar pnrmx commented on August 11, 2024 1

@pnrmx Sorry on stupid question, but what is the next step after the instructions above?

next build ./... in oracledb-exporter dir, or install it.

from oracledb_exporter.

Yannig avatar Yannig commented on August 11, 2024

And what about the Windows Subsystem for Linux (WSL)?

from oracledb_exporter.

Yannig avatar Yannig commented on August 11, 2024

@pnrmx are you ok if I took this instructions and put it directly into the README ?

from oracledb_exporter.

pnrmx avatar pnrmx commented on August 11, 2024

@pnrmx are you ok if I took this instructions and put it directly into the README ?

ok

from oracledb_exporter.

AssafKatz3 avatar AssafKatz3 commented on August 11, 2024

@pnrmx Sorry on stupid question, but what is the next step after the instructions above?

from oracledb_exporter.

krumg-devops avatar krumg-devops commented on August 11, 2024

Hey guys,

I'm trying to setup oracle exporter for prometheus, did all the steps from https://github.com/iamseth/oracledb_exporter
But when i get to the go build ./... i'm getting
go: gopkg.in/alecthomas/[email protected]: Get "https://proxy.golang.org/gopkg.in/alecthomas/kingpin.v2/@v/v2.2.6.mod": dial tcp: lookup proxy.golang.org: no such host

Btw my oracle db machine is on windows has no access to internet so have to do it somehow offline.

Thanks

from oracledb_exporter.

zhongmin2015 avatar zhongmin2015 commented on August 11, 2024

what should i do?

panic: OCIEnvCreate error

goroutine 1 [running]:
github.com/mattn/go-oci8.init.0()
C:/Users/kingdee/go/pkg/mod/github.com/mattn/[email protected]/globals.go:177 +0x518

from oracledb_exporter.

Cedric-2020 avatar Cedric-2020 commented on August 11, 2024

Hello, just an update, i can't compile on windows with that errors :

github.com/iamseth/oracledb_exporter

panic: bad carrier sym for symbol runtime.no_pointers_stackmap (funcdata callRet#1), want go.func.* got ?

goroutine 277 [running]:
cmd/link/internal/ld.writeFuncs(0xc0000b8000, 0xc0076ca000?, {0xc0071e8000, 0x23d2, 0xc0084aeff0?}, 0xc00772bdd8?, {0xc0076ca000, 0x23d2, 0x3e968?}, {0xc004550580, ...}, ...)
c:/go/src/cmd/link/internal/ld/pcln.go:732 +0xd3d
cmd/link/internal/ld.(*pclntab).generateFunctab.func1(0xc0000b8000, 0x3e968?)
c:/go/src/cmd/link/internal/ld/pcln.go:545 +0x16e
cmd/link/internal/ld.writeBlock(0xc0000b8000, 0x1?, 0xc0000ec000, {0xc008e51dd0, 0xc2a, 0xc00772bf68?}, 0x44f3c5?, 0xc005d38000?, {0x8836a0, 0x200, ...})
c:/go/src/cmd/link/internal/ld/data.go:1003 +0x3be
cmd/link/internal/ld.writeBlocks.func1(0x0?, 0x4215a5?, {0xc008e51dd0?, 0xc00772bfd0?, 0x545320?}, 0xc008d43510?, 0xc00772bfb8?, {0x8836a0, 0x200, 0x200})
c:/go/src/cmd/link/internal/ld/data.go:957 +0x76
created by cmd/link/internal/ld.writeBlocks
c:/go/src/cmd/link/internal/ld/data.go:956 +0x57c

Thanks For HELP

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.