Any VPS users here?

DOes anyone have a code to make the server Email you when 'x' memory is free / used on the system?