-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathping_all.php
More file actions
50 lines (32 loc) · 830 Bytes
/
Copy pathping_all.php
File metadata and controls
50 lines (32 loc) · 830 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
<?php
include 'vars.php';
$extra = 'index.php';
$conn = mysql_connect($mysql_host, $mysql_user, $mysql_pass);
mysql_query("SET NAMES utf8");
mysql_select_db($mysql_db);
$psql = "select * from olts order by ip";
$pretval = mysql_query( $psql, $conn );
if(! $pretval )
{
die('Could not enter data: ' . mysql_error());
}
while ($row=mysql_fetch_array($pretval)) {
$sql_ip = $row['ip'];
$ro = $row['ro'];
$ip = long2ip($sql_ip);
include 'ping.php';
if ($ping == 0) {
} else {
$sql_req = "UPDATE olts SET last_act=\"$date\" WHERE ip='$sql_ip'";
$retval_ping = mysql_query( $sql_req, $conn );
if(! $retval_ping )
{
die('Could not enter data: ' . mysql_error());
}
$table = str_replace (".", "_", $ip);
include 'get_snmp.php';
}
}
mysql_close($conn);
header("Location: http://$host$uri/$extra?page=olt_list");
?>