why does my car beep wi I lock it sometimes?

Now and again it beeps whe I lock it, but if I un lock it, it shuts up, then if I lock it again it is silent, and al is well for a couple of days until it happens again.

Anyone know why this might happen?

Thanks
 
this usually means the bonnet is open, otherwise it unlocks itself straight away if another door is open,

obviously you would notice if the bonnet is open, so the sensor sounds like its knackered by the sounds of things, would recommend trying to replace that first, this is located next to the near side headlight on, if i remember correctly its bolted using the same bolt as the light, cant miss it,
 
Now and again it beeps whe I lock it, but if I un lock it, it shuts up, then if I lock it again it is silent, and al is well for a couple of days until it happens again.

Anyone know why this might happen?

Thanks

Mines has done this since day one!! Thought it was down to alarm that has been fitted (aftermarket) i thought if the sensor was knackered it would come up on the car symbol on the clock surround ?