Ping result in automation

Can I use the ping result in automation? If so how?

Sorry for my english

Yes, via this… but you would have to check if the OS allows ping too .
Command Line - Home Assistant (home-assistant.io)