1. Go to this page and download the library: Download detain/cisco_parser library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Detain\CiscoParser\CiscoLoader;
$device = new CiscoLoader('switch1.example.net', 'admin', 's3cret');
// Implicit connect on first exec() because $autoconnect is true by default.
$status = $device->show_int_status();
foreach ($status as $port) {
echo "{$port['interface']}\t{$port['status']}\t{$port['vlan']}\n";
}
// Other helpers
$device->show_log(); // // saves running-config to startup-config
$device->disconnect();
sh
php bin/cisco_parser.php /path/to/show-running-config.txt
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.