I sometimes use a quick FOR loop on a list of machines to see which respond to pings, as a quick "up or down" status for me.
Some systems will only have IPv6 addresses in our internal DNS and I noticed that those fail to resolve at all with either @PING or @IPADDRESS. I can use the ping and nslookup commands just fine with the hostnames, and I can use @PING with the actual IPv6 address and that works, so it just seems to be the name resolution giving an error if all the DNS server returns are IPv6 and no IPv4.
Is that by design? Or should it in fact work and this is a bug? Or is it just me somehow. :)
For now I'm working around it with a bit of an ugly "if %@exec[ping -n 1 -w 1000 %hostname% > nul] EQ 0 then (echo %hostname% is UP) else (echo %hostname% is DOWN)" since the ping command returns zero if it could ping and 1 if it couldn't. But I do like how the @PING returns the ping time in milliseconds since it helps me know if this is a remote user, local, indicates which building or city they may be in, etc.
I considered using the APING plugin but it doesn't seem to have a function like @PING I could use. Which makes sense, because @PING should work. I guess I could use aping's feature to return the ipv6 address (since @ipaddress fails in this case) and then @PING that instead of the hostname, but... sigh... too much work for something that I really only use as a quick one-liner.
Some systems will only have IPv6 addresses in our internal DNS and I noticed that those fail to resolve at all with either @PING or @IPADDRESS. I can use the ping and nslookup commands just fine with the hostnames, and I can use @PING with the actual IPv6 address and that works, so it just seems to be the name resolution giving an error if all the DNS server returns are IPv6 and no IPv4.
Is that by design? Or should it in fact work and this is a bug? Or is it just me somehow. :)
For now I'm working around it with a bit of an ugly "if %@exec[ping -n 1 -w 1000 %hostname% > nul] EQ 0 then (echo %hostname% is UP) else (echo %hostname% is DOWN)" since the ping command returns zero if it could ping and 1 if it couldn't. But I do like how the @PING returns the ping time in milliseconds since it helps me know if this is a remote user, local, indicates which building or city they may be in, etc.
I considered using the APING plugin but it doesn't seem to have a function like @PING I could use. Which makes sense, because @PING should work. I guess I could use aping's feature to return the ipv6 address (since @ipaddress fails in this case) and then @PING that instead of the hostname, but... sigh... too much work for something that I really only use as a quick one-liner.