Skip to content

Instantly share code, notes, and snippets.

@douglasresende
Created September 11, 2012 02:31
Show Gist options
  • Save douglasresende/3695511 to your computer and use it in GitHub Desktop.
Save douglasresende/3695511 to your computer and use it in GitHub Desktop.
rede.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Testando Servidores</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Douglas Resende Camargo">
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="well" style="max-width: 400px; margin: 0 auto 10px;">
<pre style="text-align: center">T E S T A N D O S E R V I D O R E S</pre>
<?php
$lista = array('Servidor 01' => '127.0.0.1',
'Servidor 02' => '127.0.0.1',
'Servidor 03' => '127.0.0.1',
'Servidor 04' => 'globoasdasdasd.com',
'Servidor 05' => 'globo.com');
foreach ($lista as $key => $value) {
$str=exec("ping -c 1 ".$value);
if(strlen($str)>1){
print '<button type="button" class="btn btn-large btn-block btn-success">'.$key.' - '.$value.'</button>';
}else{
print '<button type="button" class="btn btn-large btn-block btn-danger">'.$key.' - '.$value.'</button>';
}
}
?>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment