Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitoring DB2 with 2 or more Databases #7

Open
ahuachacona opened this issue Apr 29, 2021 · 4 comments
Open

Monitoring DB2 with 2 or more Databases #7

ahuachacona opened this issue Apr 29, 2021 · 4 comments

Comments

@ahuachacona
Copy link

Hi man, my name is Axel Huachacona.
First of all, thank you very much for your work.

Now, if you will allow me, I need some help.

Right now I need to check the status of my DB2 server but inside I have at least 6 different schemas that I use. With just one schema it works perfect but, apparently, the exporter only allows monitoring a single schema (like the SAMPLE schema in your example) but I need to know if it is possible to monitor more than one at the same time without having to raise more than one instance of the exporter.

Is there any possible way to do this?

Thank you again for your work!

I'll leave my environment specifications:

  • SO: Windows 10
  • DB2: 10.5.3 for Windows x64
  • GOlang: 1.10.8
  • db2_exporter: master branch
@glinuz
Copy link
Owner

glinuz commented Apr 30, 2021

I need some time to analyze it. No longer working on it。

@ahuachacona
Copy link
Author

ahuachacona commented Apr 30, 2021

Hi my friend, I was able to make funcional it by using this method for Windows.

  1. Adding ENV variables to W2.
    Something like this:

     Name:	CGO_CFLAGS
     Value:	-IC:\PROGRA~1\IBM\SQLLIB\INCLUDE
     
     Name:	CGO_LDFLAGS
     Value:	-LC:\PROGRA~1\IBM\SQLLIB\LIB
     
     Name:	IBM_DB_DIR
     Value:	C:\PROGRA~1\IBM\SQLLIB
     
     Name:	LD_LIBRARY_PATH
     Value:	C:\PROGRA~1\IBM\SQLLIB\LIB
    
  2. DB2 Update.

     db2 update monitor switches using bufferpool on
     db2 update dbm cfg using DFT_MON_BUFPOOL on
    
  3. Download master branch on a zip, extract and inside the folder, run the following to build from source.

     go get github.com/glinuz/db2_exporter
     go build github.com/glinuz/db2_exporter
    
     This create an .exe file called 'db2_exporter.exe'.
    
  4. RUN from command line.

     db2_exporter.exe -log.level debug -dsn "DATABASE=DBNAME;HOSTNAME=localhost;PORT=50000;PROTOCOL=TCPIP;UID=DB2ADMIN;PWD=PASSW0RD!;"
    

Following this steps, I was able to collect data from my DB2 Server on a Windows machine. Hope this help to somebody else.

Bye and thank you man!

@glinuz
Copy link
Owner

glinuz commented May 5, 2021

First, db2_exporter monitor database by query sysibmadm schema,it can get all stats,include all schema in this database.(DB2 struct Instance-->database-->schema).
You only need to customize SQL in metrics.toml file.

If you want to monitor more than one database in on DB2 instance,sorry. db2_exporter base on the ODBC,it is not support more than one database.But you can run multi db2_exporter process with different -dsn -port,in one server.

Thank you ,the method for Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@glinuz @ahuachacona and others