80 lines
2.1 KiB
PHP
80 lines
2.1 KiB
PHP
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<!-- root@conlxsyslog03:/scripts/rancid/routes-db/all_routes.php -->
|
|
|
|
<meta name='viewport' content='width=device-width,initial-scale=1'/>
|
|
<link rel='stylesheet' type='text/css' href='jquery.dataTables.min.css'>
|
|
|
|
<script type='text/javascript' language='javascript' src='jquery-3.5.1.js'></script>
|
|
<script type='text/javascript' language='javascript' src='jquery.dataTables.min.js'></script>
|
|
<script type='text/javascript' class='init'>
|
|
$(document).ready(function () {
|
|
$('#example').DataTable( {
|
|
'pageLength': 20,
|
|
} );
|
|
|
|
});
|
|
</script>
|
|
|
|
<style>
|
|
|
|
.par {
|
|
background-color:#00ff00;
|
|
color:#666666;
|
|
}
|
|
.unpar {
|
|
background-color:#ff0000;
|
|
color:#666666;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
$ ssh rancid@conlxsyslog03<br>
|
|
$ cd /scripts/rancid/routes-db<br>
|
|
$ export SSHUSER=<br>
|
|
$ export SSHPASS=<br>
|
|
$ perl routes.pl<br>
|
|
|
|
<TABLE BORDER='1' id='example' class='display compact' width='100%'>
|
|
<thead>
|
|
<TR>
|
|
<TH>Host</TH>
|
|
<TH>Protokoll</TH>
|
|
<TH>Netzwerk</TH>
|
|
<TH>Maske</TH>
|
|
<TH>Gateway</TH>
|
|
<TH>Schnittstelle</TH>
|
|
<TH>VRF</TH>
|
|
</TR>
|
|
</thead>
|
|
|
|
|
|
<?php
|
|
$host = "10.99.0.199";
|
|
$database = "routes";
|
|
$username = "conetadm";
|
|
$password = "Conet12#";
|
|
|
|
$connection=mysqli_connect($host,$username,$password,$database);
|
|
if (!$connection) {
|
|
echo "Error: Unable to connect to MySQL.<br>";
|
|
echo "<br>Debugging errno: " . mysqli_connect_errno();
|
|
echo "<br>Debugging error: " . mysqli_connect_error();
|
|
exit;
|
|
}
|
|
$sql="select hostname, protocol, destination, netmask, gateway, interface, VRF from `all`";
|
|
if ($result_set = mysqli_query($connection,$sql)) {
|
|
while($row = $result_set->fetch_array(MYSQLI_ASSOC)) {
|
|
echo "<tr><td>" . $row['hostname'] . "</td><td>" . $row['protocol'] . "</td><td>" . $row['destination'] . "</td><td>" . $row['netmask'] . "</td><td>" . $row['gateway'] . "</td><td>" . $row['interface'] . "</td><td>" . $row['VRF'] . "</tr>\n";
|
|
}
|
|
$result_set->close();
|
|
}
|
|
?>
|
|
|
|
|
|
</table>
|
|
|
|
</body>
|
|
</html>
|