AntiGuide: ErsatzWatchDog4IpCamByStatus



PagePrincipale :: DerniersChangements :: ParametresUtilisateur :: Vous êtes 216.73.216.82 :: Signaler un abus :: le: 20250723 15:22:37
WatchDog4IpCam

rappel:
indépendamment des possibilités l'alertes (AcroMediaIn1AlerteDirecte), il est question ici de surveiller la disponibilité de l'appareil .
cette page décrit une méthode de substitution à un vrai "watchdog" quand l'appareil n'est pas capable d'émettre le "kick" (WatchDog4IpCamByFtp, AcroMediaIn1WatchDog ).

si votre camera n'est capable de communiquer son "status" il y a une alternative exploitant seulement la demande user/pwd: lire: ErsatzWatchDog4IpCam



comparable à maquette: AutomateHeden pour la caméra heden,
tout en un vbscript;
nécessite mailsend
testé avec CameraWifiAcromediaIn1

configuration triviale:

le programme se charge d'ouvrir l'url de "status de la camera:"
pour mémoire:


feuille de route:


watchdog.vbs: (pour Windows)
' 2do
' envoyer fichier erreur wget si il y a 
url="http://81.57.148.97:88"
mailto="antiguide@free.fr"
domain="moi"
Set WshShell = CreateObject("WScript.Shell")
set fso=CreateObject("scripting.filesystemobject")
if wscript.arguments.count=0 then
   arg0=60000
 else
arg0 = 1000*WScript.Arguments(0)
end if

itis=Formatdatetime(Now, 2 ) & "_" & Formatdatetime(Now, 3 )  & ".txt"
itis=replace(itis,"/","")
itis=replace(itis,":","")
status=false
' msgbox itis
set fi=fso.createtextfile(itis)
fi.close
tout="%comspec% /c mailsend1.16.exe -d " & domain & " -smtp smtp.free.fr -t " & mailto & " +cc +bc -f flavigny@free.fr -sub lancement_" & itis & "  -M onelinemsg_from_81.57.148.97:88 1>start_err.txt 2>start_out.txt"
    rep=Wshshell.run (tout,0)

tour=0
while fso.fileexists(itis)

if fso.fileexists("index.html") then
   fso.deletefile ("index.html")
end if 

if fso.fileexists("wget_err.txt") then
   fso.deletefile ("wget_err.txt")
end if 
if fso.fileexists("wget_out.txt") then
   fso.deletefile ("wget_out.txt")
end if 
rep=Wshshell.run ("%comspec% /c ""\Program Files\GnuWin32\bin\wget.exe"" " & url & " 1>wget_err.txt 2>wget_out.txt ",0,true)
' msgbox "rep=" & rep
egal=false
if fso.fileexists("index.html") then

set fm=fso.opentextfile("modele.html")
set fi=fso.opentextfile("index.html")
ifini=false
egal=true
i=0
while not fm.atendofstream and not ifini and egal
  if fi.atendofstream then
     ifini=true
     else
     ci=fi.read(1)
  end if
  cm=fm.read(1)
  i=i+1
  if cm<>ci then 
  ' msgbox "différence a i=" & i & vbcrlf & asc(cm) & "<>" & asc(ci)
      egal=false
  end if
wend

fi.close
fm.close
end if
tour=tour+1

if status<> egal or (tour=1 and not egal) then 
 status=egal
' conserver la capture   
it=Formatdatetime(Now, 2 ) & "_" & Formatdatetime(Now, 3 )  & ".html"
it=replace(it,"/","")
it=replace(it,":","")
' conserver capture différente de modèle
if fso.fileexists("index.html") then fso.movefile "index.html" , it 

' alarme par mail
if status then
   msg="Info Camera " & url & " " & itis & " OK."
else
   msg="ALERTE Camera " & url & " " & itis & " HS."
end if

  rep=Wshshell.run ("%comspec% /c mailsend1.16.exe -d " & domain & " -smtp smtp.free.fr -t " & mailto & " +cc +bc -f flavigny@free.fr -sub """ & msg & """  -M ""changement statut now " & status & """  1>alert_err.txt 2>alert_out.txt",0)
' alarme locale 

 else
' msgbox "tour=" & tour
 if tour=1 then 
tout="%comspec% /c mailsend1.16.exe -d " & domain & " -smtp smtp.free.fr -t " & mailto & " +cc +bc -f flavigny@free.fr -sub lancement_not_equal  -M onelinemsg_from_81.57.148.97:88 1>start_err.txt 2>start_out.txt"
    rep=Wshshell.run (tout,0)
' msgbox "prem " & vbcrlf & tout
  end if
end if

wscript.sleep (arg0)
wend


tou="%comspec% /c mailsend1.16.exe -d " & domain & " -smtp smtp.free.fr -t " & mailto & " +cc +bc -f flavigny@free.fr -sub alerte_fermeture  -M onelinemsg_from_81.57.148.97:88 1>stop_err.txt 2>stop_out.txt"
  rep=Wshshell.run (tou,0)
 ' msgbox "termine mailsent rep=" & rep & " tour= " & tour & vbcrlf & tou



réponses de la camera

C:\Users\adminpo\pano>more "get_status.cgi@user=%user%&pwd=%pwd%"
var id='00B001006CCA';
var sys_ver='4.37.2.43';
var app_ver='4.5.3.46';
var alias='LeLac';
var now=1358169890;
var tz=-3600;
var alarm_status=0;
var ddns_status=22;
var ddns_host='';
var oray_type=0;
var upnp_status=0;
var p2p_status=2;
var p2p_local_port=28773;
var msn_status=0;
var wifi_status=0;

C:\Users\adminpo\pano>

on considèrera: