1 | <?php
|
---|
2 |
|
---|
3 | // Toto je ukázkový skript pro aktualizaci dat. Zkopírujte si jej jako monitor.php a upravte podle potřeby.
|
---|
4 | // Skript spouštět přes crona každou minutu
|
---|
5 |
|
---|
6 | include('../global.php');
|
---|
7 | include('system.php');
|
---|
8 | include('wow.php');
|
---|
9 |
|
---|
10 | $LastNetworkState = unserializa(file_get_contents('/tmp/LastNetworkState'));
|
---|
11 | $LastCpuUsage = unserializa(file_get_contents('/tmp/LastCpuUsage'));
|
---|
12 |
|
---|
13 | $NetworkState = GetNetworkState();
|
---|
14 | file_get_contents($Config['AddNewValueUrl'].'?MeasureId=3&Value='.MemoryUsage());
|
---|
15 | file_get_contents($Config['AddNewValueUrl'].'?MeasureId=4&Value='.CpuUsage());
|
---|
16 | file_get_contents($Config['AddNewValueUrl'].'?MeasureId=5&Value='.WoWPlayersOnline());
|
---|
17 | file_get_contents($Config['AddNewValueUrl'].'?MeasureId=6&Value='.WoWEmulatorRestartCount());
|
---|
18 | file_get_contents($Config['AddNewValueUrl'].'?MeasureId=7&Value='.DiskFree());
|
---|
19 | file_get_contents($Config['AddNewValueUrl'].'?MeasureId=8&Value='.WoWAccountCount());
|
---|
20 | file_get_contents($Config['AddNewValueUrl'].'?MeasureId=10&Value='.WoWGMOnline());
|
---|
21 | file_get_contents($Config['AddNewValueUrl'].'?MeasureId=11&Value='.round($NetworkState['eth1']['DownAverage']));
|
---|
22 | file_get_contents($Config['AddNewValueUrl'].'?MeasureId=12&Value='.round($NetworkState['eth1']['UpAverage']));
|
---|
23 | file_get_contents($Config['AddNewValueUrl'].'?MeasureId=13&Value='.WoWCharacterCount());
|
---|
24 | file_get_contents($Config['AddNewValueUrl'].'?MeasureId=14&Value='.WoWGuildCount());
|
---|
25 | file_get_contents($Config['AddNewValueUrl'].'?MeasureId=15&Value='.WoWEmulatorAvailability());
|
---|
26 | file_get_contents($Config['AddNewValueUrl'].'?MeasureId=16&Value='.Ping());
|
---|
27 | file_get_contents($Config['AddNewValueUrl'].'?MeasureId=17&Value='.TeamSpeak());
|
---|
28 | file_get_contents($Config['AddNewValueUrl'].'?MeasureId=18&Value='.WoWTranslatedQuestsCount());
|
---|
29 | file_get_contents($Config['AddNewValueUrl'].'?MeasureId=19&Value='.DiskUtilization());
|
---|
30 |
|
---|
31 | file_put_contents('/tmp/LastNetworkState', serialize($LastNetworkState));
|
---|
32 | file_put_contents('/tmp/LastCpuUsage', serialize($LastCpuUsage));
|
---|