Beispiel #1
0
<?php

require_once '../vendor/autoload.php';
$ts = new \Samuelfontebasso\Pe\Troubleshooting();
$output = "RouterPE#ping 172.212.222.122\n            \n            Type escape sequence to abort.\n            Sending 5, 100-byte ICMP Echos to 172.212.222.122, timeout is 2 seconds:\n            .....\n            Success rate is 0 percent (0/5)";
if ($ts->isAvailable($output)) {
    echo 'Unavailable';
} else {
    echo 'Available';
}
echo "\n";
echo "\n";
$output = "RP/0/RSP0/CPU0:RouterPE#sh int desc | i ClientA  \nWed Dec  9 12:07:43.789 BRT_SUMMERTIME\nGi0/0/0/1.101     up          up          ClientA";
$output = "RTPESPO0302#sh int desc | i BREVPN050724\nSe7/2/0.1/2/6/3:0              up             down     DAMOVO - BREVPN050724";
print_r($ts->getInterface($output));
echo "\n";
echo "\n";
$output = "RP/0/RSP0/CPU0:RouterPE#sh run int Gi0/0/0/1.3041\n            Wed Dec  9 12:07:46.497 BRT_SUMMERTIME\n            interface GigabitEthernet0/0/0/1.101\n            description ClientA\n            bandwidth 10000\n            service-policy input LIMIT-10M-DIP-INPUT\n            service-policy output LIMIT-10M-OUTPUT\n            ipv4 address 172.212.222.122 255.255.255.252\n            encapsulation dot1q 101\n            !";
print_r($ts->getConfigInterface($output));
Beispiel #2
0
<?php

require_once '../vendor/autoload.php';
$ts = new \Samuelfontebasso\Pe\Troubleshooting('juniper');
$output = "user@RouterPE> show interfaces descriptions | match ClientA\n\ne1-3/3/0:19.0   up    up   ClientA";
print_r($ts->getInterface($output));
echo "\n\n";
$output = 'user@RouterPE> show configuration | display set | match e1-3/3/0:19

set interfaces e1-3/3/0:19 keepalives

set interfaces e1-3/3/0:19 clocking external

set interfaces e1-3/3/0:19 encapsulation cisco-hdlc

set interfaces e1-3/3/0:19 e1-options framing unframed

set interfaces e1-3/3/0:19 unit 0 description "Client A"

set interfaces e1-3/3/0:19 unit 0 bandwidth 2m

set interfaces e1-3/3/0:19 unit 0 family inet no-redirects

set interfaces e1-3/3/0:19 unit 0 family inet address 200.111.145.193/30

set routing-instances ClientA interface e1-3/3/0:19.0';
print_r($ts->getConfigInterface($output));