# Db2 – Can scripting be done on DB2 Connect instance

db2db2-10.5scripting

I need to get the number of connections passing through connect server for 1 week.

• Can we write a script to get the details?

• Can we only pull the data manually?

• Is there any way to script it?

I am not authorized to use cron on the server.

As you mentioned cron, I'm assuming your Db2-Connect runs on some flavour of Unix/Linux. For those environments scripting in ksh or bash is ideal for Db2 products because they are very script friendly.

Check also if such work would be redundant, as some sites have host based (z/os or i-series) methods for monitoring activity from remote Db2-connect servers.

The script can attach to the instance and use list dcs applications show detail (or variations of that command) appending the output to a log file that you parse later, and detach.
There's also variations of get snapshot for all dcs applications or get snapshot for all dcs databases depending on your requirements.