Changeset 47 for trunk/measure_scripts
- Timestamp:
- Jul 27, 2014, 9:14:56 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 2 1 config.php 2 .project
-
- Property svn:ignore
-
trunk/measure_scripts/monitor_sample.php
r39 r47 12 12 13 13 $NetworkState = GetNetworkState(); 14 file_get_contents($Config['AddNewValueUrl'].'?MeasureId=3&Value='.MemoryUsage()); 14 file_get_contents($Config['AddNewValueUrl'].'?MeasureId=3&Value='.MemoryUsage()); 15 15 file_get_contents($Config['AddNewValueUrl'].'?MeasureId=4&Value='.CpuUsage()); 16 16 file_get_contents($Config['AddNewValueUrl'].'?MeasureId=5&Value='.WoWPlayersOnline()); … … 20 20 file_get_contents($Config['AddNewValueUrl'].'?MeasureId=10&Value='.WoWGMOnline()); 21 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'])); 22 file_get_contents($Config['AddNewValueUrl'].'?MeasureId=12&Value='.round($NetworkState['eth1']['UpAverage'])); 23 23 file_get_contents($Config['AddNewValueUrl'].'?MeasureId=13&Value='.WoWCharacterCount()); 24 24 file_get_contents($Config['AddNewValueUrl'].'?MeasureId=14&Value='.WoWGuildCount()); … … 31 31 file_put_contents('/tmp/LastNetworkState', serialize($LastNetworkState)); 32 32 file_put_contents('/tmp/LastCpuUsage', serialize($LastCpuUsage)); 33 34 ?> -
trunk/measure_scripts/system.php
r39 r47 5 5 function ErrorHandler($errno,$errmsg,$filename,$linenum,$vars) 6 6 { 7 } 7 } 8 8 9 9 function CheckPortStatus($Ip, $Port, $Timeout = 0.5) … … 24 24 25 25 function Ping($Host = 'nix.cz') 26 { 26 { 27 27 exec('ping '.$Host.' -c 1 -W 1|grep time=', $Row); 28 28 // W - timeout in seconds … … 85 85 { 86 86 global $LastNetworkState; 87 87 88 88 if(!isset($LastNetworkState)) $LastNetworkState = array(); 89 89 $NetworkState = array('Time' => time()); … … 93 93 array_shift($Output); // Skip header 94 94 foreach($Output as $Item) 95 { 95 { 96 96 while(strpos($Item, ' ') !== false) $Item = str_replace(' ', ' ', $Item); // Rrmove multiple spaces 97 97 $Item = explode(':', $Item); … … 164 164 return($UptimeParts[0]); 165 165 } 166 167 168 ?>
Note:
See TracChangeset
for help on using the changeset viewer.