Why this TCP Listening Ports not display in check_MK?

Can you please also post what the output of your bash script is? The python part looks ok at first glance.

#!/bin/bash

echo “<<<my_tcp_listener>>>”

netstat -tlpen sed 1,2d grep –w “1522\ 1523\ 1524\ 1526\ 1528\ 1529\ 1530\ 1531\ 1534”

If this is really your script then you are missing pipes between the commands netstat, sed and grep.
But even then your sed looks strange, you might want to try awk instead. And instead of netstat you could try the new default ss.