Thanks. Ciao. Roberto
Original Message:
Sent: Fri April 04, 2025 11:37 AM
From: Jan Nelken
Subject: Db2 for Linux 11.5 and Datadog
Roberto,
I was looking for more information about Datadog agent - I couldn't find on Datadog site anything about Db2 as a supported monitored database - am I looking for a wrong Datadog site?
https://docs.datadoghq.com/database_monitoring/
------------------------------
Jan Nelken
Support engineer
Persistent Systems Ltd
Cracow
+48 783 109 863
Original Message:
Sent: Fri April 04, 2025 09:11 AM
From: Roberto Stradella
Subject: Db2 for Linux 11.5 and Datadog
Hello,
thanks for the answers you provide me. We are currently doing problem determination, we have found that it is not a problem related to reboot only but occurs also when we restart an instance. If datadog service is up and running and we perform db2stop + db2start the db2start shows the following message:
FUNCTION: DB2 UDB, common communication, sqlcctcpconnmgr, probe:46
MESSAGE : ADM7007E The SVCENAME DBM configuration parameter, "50012", is configured with a port or a service name. When it is configured with a service name, the TCP/IP services files is used to map the service name to a port number. The port specified in this field is being used by another process. Resolve this problem by either deleting the process using the port or use another port.
This is what we have seen on our system:
Db2 instance (db2sysc) and datadog service is up and running:
ss -tanp | grep 50010
ESTAB 0 0 172.29.112.12:50010 172.29.112.10:39024 users:(("db2sysc",pid=2354,fd=1614))
Db2 instance (db2sysc) has been stopped:
ss -tanp | grep 50010
TIME-WAIT 0 0 [::1]:50010 [::1]:50010
Db2 instance (db2sysc) has been restarted
ADM7007E The SVCENAME DBM configuration parameter, "50012", is configured with a port or a service name. When it is configured with a service name, the TCP/IP services files is used to map the service name to a port number. The port specified in this field is being used by another process. Resolve this problem by either deleting the process using the port or use another port.
ss -tanp | grep 50010
TIME-WAIT 0 0 [::1]:50010 [::1]:50010
Datadog seems that one time it binds the listener port never release it.
Thanks. Ciao. Roberto
------------------------------
Roberto Stradella
Original Message:
Sent: Fri April 04, 2025 07:57 AM
From: Jan Nelken
Subject: Db2 for Linux 11.5 and Datadog
Mark,
I think that Datadog intercepts the port Db2 is listening on - using sort of MiM (Man in the middle) approach - so it listens on Db2 port, intercepts and analyses requests and passes it to Db2 when approved. One way to verify it is to check what port Db2 listens to after successful Datadog and Db2 startup.
------------------------------
Jan Nelken
Support engineer
Persistent Systems Ltd
Cracow
+48 783 109 863
Original Message:
Sent: Fri April 04, 2025 07:52 AM
From: Mark Barinstein
Subject: Db2 for Linux 11.5 and Datadog
Hello.
ADM7007E means that something listens DB2 port when it tries to do the same on its startup.
Is there any chance, that this Datadog service tries to start listening DB2 port instead of connecting to it?
You may try to check it, for example, with a startup script like below.
#!/bin/bash
PORT=${1?"Port must be specified"}
SEC=${2?"Max seconds to run must be specified"}
start=${SECONDS}
while [ $((SECONDS-start)) -lt ${SEC} ]; do
str=$(netstat -nlp | grep ":${PORT} ") && echo "$(date +'%F-%H.%M.%S'): ${str}"
done
You may put its call into some unit file starting before the db2fmcd.service like this:
ExecStart=sh -c "/path/to/script/check_port.sh 25000 180 > /tmp/db2port_usage.log"
Note, that db2fmcd doesn't immediately start any DB2 instance.
db2fmcd is a daemon which just checks if some DB2 instance (you may have a number of them in the system) must be started, and it may really start your DB2 instance after some hardly predicted delay.
------------------------------
Mark Barinstein
Original Message:
Sent: Tue April 01, 2025 10:34 AM
From: Roberto Stradella
Subject: Db2 for Linux 11.5 and Datadog
Hello,
we are using Datadog to monitor our Db2 for Linux 11.5 fp 9 database server. Datadog and Db2 are managed as a Linux service to start and stop them. We have noticed that when the server reboots Db2 gets error ADM7007E on the listener tcp/ip port and nobody is able to connect to the database via listener, using netstat we see the listener port in TIME_WAIT instead LISTENING. We have found that if Datadog starts immediately after Db2 it binds the Db2 listener and put it in TIME_WAIT status; as workaround we have delayed 60 seconds the Datadog service startup (added ExecStartPre=/bin/sleep 60 in Datadog service) so Db2 has enough time to complete its startup procedure and put the listener port in LISTENING.
Has anyone already experienced the behaviour described above ? if yes, how fixed it ?
Thanks in advance. Ciao. Roberto
------------------------------
Roberto Stradella
------------------------------