Some knowledge of your environment is necessary... It may be a silly exercise to even have to programmatically scan for this. It's like checking servers to see if a power button is present...
MAKE SURE THE SERVER IS AN HP!!
HP ProLiant 300, 500, 700-series servers from 2003 going forward have had ILO embedded onto the motherboard. Most 100-series HP servers have basic ILO facilities, too. If you're dealing with a modern server from HP, it likely has ILO capabilities...
Of course, that doesn't mean that ILO has been configured or even plugged in; a problem I see in many environments I walk into. So that's a different challenge.
For you, check the server model number; e.g. "DL380 G6" and cross-reference it with a Google of "DL380 G6 quickspecs". You'll get ALL of the specification information you need there.