How to create a Script- based 2-State Monitor