Check for the extension:
$ echo -e "quit\n" | openssl s_client -connect google.com:443 -tlsextdebug 2>&1| grep 'TLS server extension "heartbeat" (id=15), len=1'
TLS server extension "heartbeat" (id=15), len=1
This doesn't tell you that the server uses OpenSSL, or that it is vulnerable, simply that it supports the extension.