Welcome Guest, Not a member yet? Register   Sign In
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




Theme © iAndrew 2016 - Forum software by © MyBB