Add monitor.c

Add monitor.c