IBM iSeries DB2 Check

**CMK version: 2.1.0p21
**OS version: Debian 5.10.197

**Error message:
Error while connecting to database: [IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: “TCP/IP”. Communication API being used: “SOCKETS”. Location where the error was detected: “<>”. Communication function detecting the error: “connect”. Protocol specific error code(s): “111”, “", "”. SQLSTATE=08001 SQLCODE=-30081

Hello,
since i am finally migrating from Checkmk Version 1.6.0p27 to 2.1.0p21 i have a problem to monitor the db2 database on our ibmi systems.
In our old Checkmk Version (1.6.0p27) which i took over from an old colleague there was a plugin named check_db2oni.
This plugin was for doing some db2 sql querys.

In the new version there is a check named check_sql (Check SQL Database)
Theoretically i can query sql against db2 with this but if i do this with our ibmi db2 i get the following message:
Error while connecting to database: [IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "<<HOST IP>>". Communication function detecting the error: "connect". Protocol specific error code(s): "111", "*", "*". SQLSTATE=08001 SQLCODE=-30081

IBM says:
The root cause is outside of Db2, which might be in the client/server network stack or network device that is situated between them.

But it’s the same ip network as the old checkmk system and there are no destrictions between ibmi and checkmk. :confused:

The Check Command is:
check_mk_active-sql!–pwstore=5@11@iseries ‘–hostname=<>’ ‘–dbms=db2’ ‘–name=$HOSTNAME$’ ‘–user=<>’ ‘–password=<>’ ‘–port=25000’ ‘SELECT DEC (100 - DEC(TOTAL_CAPACITY_AVAILABLE, 19, 2) / DEC(TOTAL_CAPACITY, 19, 2) * 100, 19, 2) AS AVAILABLE_SPACE, ‘"’"’“'”‘"’“'”‘"’<>‘"’“'”‘"’“'”‘"’“’ AS DESCRIPTION, CONCAT(DEC (100 - DEC(TOTAL_CAPACITY_AVAILABLE, 19, 2) / DEC(TOTAL_CAPACITY, 19, 2) * 100, 19, 2),'”‘"’“'”‘"’“'”‘"’\;85\;90’“'”‘"’“'”‘"’“'”‘) AS PERFDATA FROM qsys2.asp_info WHERE ASP_NUMBER=1\n’

Is anyone out there who is able to query db2 on ibmi with checkmk?
unfortunatly i’m stuck. :confused:

Hi did you find a solution? we updated to 2.3. and we really need this kind of checks. :confused:
Is there any other way to do something similar regarding db2 statement query’s?

In general, I think DB2 for IBM i monitoring should work with the “check_sql”.
From the manual page of this, I read:
" For this to work, additional python libraries must be installed (depending on the type of database one of psycopg2 , pymysql , pymssql , oracledb , ibm_db , ibm_db_dbi and sqlanydb ).

When reading the python page for ibm_db_dbi on PyPi, I see this:
" License requirements for connecting to databases

Python ibm_db driver can connect to Db2 on Linux Unix and Windows without any additional license/s, however, connecting to databases on Db2 for z/OS or Db2 for i(AS400) Servers require either client side or server side license/s. The client side license would need to be copied under license folder of your cidriver installation directory and for activating server side license, you would need to purchase Db2 Connect Unlimited for System z® and Db2 Connect Unlimited Edition for System i®."

Not sure if any of this helps?