<?php

// Toto je ukázkový skript pro aktualizaci dat. Zkopírujte si jej jako monitor.php a upravte podle potřeby.

include('../global.php');
include('system.php');
include('wow.php');

GetNetworkStat();
while(1)
{
  $NetworkStat = GetNetworkState();
  file_get_contents($Config['AddNewValueUrl'].'?MeasureId=3&Value='.MemoryUsage()); 
  file_get_contents($Config['AddNewValueUrl'].'?MeasureId=4&Value='.CpuUsage());
  file_get_contents($Config['AddNewValueUrl'].'?MeasureId=5&Value='.WoWPlayersOnline());
  file_get_contents($Config['AddNewValueUrl'].'?MeasureId=6&Value='.WoWEmulatorRestartCount());
  file_get_contents($Config['AddNewValueUrl'].'?MeasureId=7&Value='.DiskFree());
  file_get_contents($Config['AddNewValueUrl'].'?MeasureId=8&Value='.WoWAccountCount());
  file_get_contents($Config['AddNewValueUrl'].'?MeasureId=10&Value='.WoWGMOnline());
  file_get_contents($Config['AddNewValueUrl'].'?MeasureId=11&Value='.round($NetworkStat['eth1']['down_avg']));
  file_get_contents($Config['AddNewValueUrl'].'?MeasureId=12&Value='.round($NetworkStat['eth1']['up_avg'])); 
  file_get_contents($Config['AddNewValueUrl'].'?MeasureId=13&Value='.WoWCharacterCount());
  file_get_contents($Config['AddNewValueUrl'].'?MeasureId=14&Value='.WoWGuildCount());
  file_get_contents($Config['AddNewValueUrl'].'?MeasureId=15&Value='.WoWEmulatorAvailability());
  file_get_contents($Config['AddNewValueUrl'].'?MeasureId=16&Value='.Ping());
  file_get_contents($Config['AddNewValueUrl'].'?MeasureId=17&Value='.TeamSpeak());
  file_get_contents($Config['AddNewValueUrl'].'?MeasureId=18&Value='.WoWTranslatedQuestsCount());
  file_get_contents($Config['AddNewValueUrl'].'?MeasureId=19&Value='.DiskUtilization());

  sleep(58);  // 60(measure period) - 2(disk utilization)
}
?>
