How to Custom monitoring

Hi,

I have tried running the script in the terminal, it works as intended.
I have created a new topic.

Thanks