Prueba lo dicho. De todos modos te dejo aquí un script VBS que hace ping a máquinas y anota resultados en un LOG.
En caso de PING sin respuesta hace un RENEW para obtener nueva IP y opcionalmente puede enviar aviso por mail.
Copia y pega el código a un archivo y lo llamas PING2.VBS
Echale un ojo a ver si te sirve.
/---------------- INICIO DEL ARCHIVO PING2.VBS ---------------
'***************************************************
' PARAMETROS DE CONFIGURACION
'***************************************************
'
'Indica aquí el archivo que contendrá la lista de IPs a las que hacer PING
'Debe contener solo los destinos (sin descripción) y a razón de uno por fila
'Ejemplo:
' 212.55.8.132
' smtp.euskalnet.net
' 194.224.52.4
Const ServersListFile="c:\servers.txt"
'Indica aquí el archivo LOG para anotar los resultados obtenidos
Const sOutPutLogFile="c:\ping.log"
'Valor respuesta devuevlto por comando PING
'en función del idioma del Sistema Operativo
' English "Reply"
' Español "Respuesta"
Const sReply="Respuesta"
'valores para envío de notificación por email
'Activar (1) o desactivar(0) enviar alerta por email
'en caso de producirse error de PING
Const SendMailAlert=0
'Dirección del emisor de la alerta (puede ser ficticia)
Const sMailSender="origen@midominio.com"
'Dirección del destinatario de la alerta (debe ser una dirección válida)
Const sMailRecipient="destino@midominio.com"
'Valor necesario para correcto funcionamiento. No cambiar
Const ForReading = 1
'***************************************************
' INICIO DEL SCRIPT
'***************************************************
Main
Sub Main
On Error Resume Next
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile(ServersListFile, ForReading)
Do Until objTextFile.AtEndOfStream
strComputer = objTextFile.Readline
Set objShell = CreateObject("WScript.Shell")
strCommand = "%comspec% /c ping -n 3 -w 1000 " & strComputer & " >>" & sOutPutLogFile
Set objExecObject = objShell.Exec(strCommand)
Do While Not objExecObject.StdOut.AtEndOfStream
strText = objExecObject.StdOut.ReadAll()
If Instr(strText, sReply) > 0 Then
'PING OK
Exit Do
Else
'PING ERROR
strCommand2 = "%comspec% /c ipconfig /renew >>" & sOutPutLogFile
Set objExecObject = objShell.Exec(strCommand2)
strText2 = objExecObject.StdOut.ReadAll()
Exit Do
If SendMailAlert=1 Then
'envío de alerta por email
Set objEmail = CreateObject("CDO.Message")
objEmail.From = sMailSender
objEmail.To = sMailRecipient
objEmail.Subject = "Server down"
objEmail.Textbody = strComputer & "Server is no longer accessible over the network."'
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"my-smtp-server"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
End If
End If
Loop
Loop
objTextFile.Close
End Sub
/---------------- FIN DEL ARCHIVO PING2.VBS ---------------