added support for basic monitor function as part of agent.invoke should refactor later the repeated start/waitpid within the invoke routine