pingservers.php
905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php namespace App\Console\Commands;
use Illuminate\Console\Command;
use DB;
use Config;
use App\Models\User;
use App\Models\Accesslog;
use App\Models\CRMCall;
use Schema;
use PDO;
use Illuminate\Database\Schema\Blueprint;
class pingservers extends Command {
/**
* The console command name.
*
* @var string
*/
protected $signature = 'pingservers';
/**
* The console command description.
*
* @var string
*/
protected $description = 'pingservers';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$nowts=time();
//$date=date('F_Y');
echo "\n".date('Y-m-d H:i:s')."\n";
$ip = array('10.3.179.121');
for($i=0;$i<count($ip);$i++){
$mysqli = new mysqli($ip[$i], "root", "yb9738z", "");
if (!($mysqli->ping())) {
echo $ip[$i]." Error::".$mysqli->connect_error."<br>";
}else {
echo $ip[$i]." Connected<br>";
}
$mysqli->close();
}
}
}