ok, I've been trying to figure this out and googling on different occasions is been fruitless, so I'm hoping someone can point me in the right direction here.

I have a netbook that I like to leave online behind a router that gets a dynamic WAN IP address.

I have already set up the router to give this computer a static port and to forward ports 22 and 5900 so I can ssh and vnc to it (vnc closed and can activated thru ssh).

So, what I want is to set up the built-in mail (aka xmail or mailx) to send me an email if the IP changes (or send me the current WAN IP every 6 hours or something), also it'd be awesome if it would send me the battery state.

Is there a way to do this?