Relevance to Ping DNS or IP from BigFix console

Hello Team,

I am trying to filter out dead DNS entries on the bigfix console by pinging each server using their DNS name or IP and display the ping output on bigfix console property as if ping is successful YES if not than NO. not sure how to process further with the resolution.

need help with relevance which can resolves my issue.

Thank you,

To the best of my knowledge there is no native way to do this.

You would need to create a fixlet that would run the ping command and output it to a file then use an analysis to read that file.

You could create the action as a policy action if it’s something you need to do more than once.

Example:

wait cmd.exe ping 192.168.0.1 > "c:\temp\ip.out"

then use an analysis to do

if (exists file "c:\temp\ip.out") then (lines of file "c:\temp\ip.out") else nothing

or to match your exact needs

if (exists file "c:\temp\ip.out" whose (not exists line whose (it contains "could not find host") of it) ) then "YES" else "NO"

To clarify - the analysis mentioned above can be part of the same task which does the ping, no need to make a true analysis…

I do something similar for checking connectivity to AV server, was written before builint Powershell action, this is all one task action:

delete __appendfile
 

appendfile Test-NetConnection -computername 10.15.101.160 -port 8190 -informationlevel quiet | out-file "C:\Windows\Temp\avpoke.txt"


delete "C:\Windows\Temp\avpoke.txt"
delete pstest.ps1
copy __appendfile pstest.ps1


waithidden { pathname of file ((it as string) of value "Path" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell" of native registry) } -noprofile -ExecutionPolicy Bypass -file "pstest.ps1"


if {exists lines whose (it as trimmed string as lowercase = "true" ) of files "C:\Windows\Temp\avpoke.txt"}  
   setting "_sophosrelayavailable"="1" on "{parameter "action issue date" of action}" for client
 else
    // if powershell is good - it should set broke = 0 (false)
   setting "_sophosrelayavailable"="0" on "{parameter "action issue date" of action}" for client
 endif
1 Like