Splunk Enterprise

How to ping a host on the internet from a UF?


I want to ping some host on the Internet from every UF in my network to quickly find out about its availability/unavailability. The simplest way would be to write a script, but no matter how much I tried to write a bat, nothing came of it. Perhaps someone has already solved this issue and can share the script, or else help to write it correctly. No matter what format the output of the script will be, the main thing is that this output can be used to determine the availability of the host. Here's what I tried:





ping -n 1 www.google.com
@echo off
ping -n 1 www.google.com | find "TTL=" > nul
if errorlevel 0 echo Ping successful





Both scripts inject the system into recursion and do not output any ping results.

I am a noob in bat scripts, please, help me...

Labels (2)
0 Karma
.conf21 Now Fully Virtual!
Register for FREE Today!

We've made .conf21 totally virtual and totally FREE! Our completely online experience will run from 10/19 through 10/20 with some additional events, too!