• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
butuh bantuan

#1
hallo slaam kenal Big Grin  member bru dr jember. Mau tnya2 nih gan , ane kan kerja d slah stu perusahaan swasta di kota ane, nah d prshaan ane ad server (merk di sensor Big Grin ) naah prmslahan ane kira2 kalo buat script php (utamnya CI) semacam aplikasi gitu untk mengecek server itu mati / hidup gitu bisa kagak yaa ??
maksih Rolleyes Angel
Reply

#2
Coba pakai fasilitas ping server...


Check this script:

<?php
function ping($host) {
exec(sprintf('ping -c 1 -W 5 %s', escapeshellarg($host)), $res, $rval);
return $rval === 0;
}

$hosts_to_ping = array('10.140.206.123', '127.0.0.1');
?>

<ul>
<?php foreach ($hosts_to_ping as $host): ?>
<li>
<?php echo $host; ?>
<?php $up = ping($host); ?>
(<img src="<?php echo $up ? 'on' : 'off'; ?>"
alt="<?php echo $up ? 'up' : 'down'; ?>">)
</li>
<?php endforeach; ?>
</ul>

source: http://www.dynamicdrive.com/forums/showt...g-with-PHP
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.