An expression for this is to sleep with one eye open:
From The Free Dictionary:
To stay awake or sleep very lightly so as to remain very wary, cautious, or alert. I won't forget this insult. You'd better start sleeping with one eye open, because I'll get my revenge.
From Oxford Dictionaries:
Sleep very lightly, aware of what is happening around one.
‘the woman was like a cat sleeping with one eye open, watching everything that went on’
‘She must have heard something because according to her father she slept with one eye open at all times.’
‘I have spent my life in an area where you needed to sleep with one eye open to survive.’