tmshlvck / ulg

Universal Looking Glass
GNU General Public License v3.0
34 stars 16 forks source link

support for IOS-XR based Ciscos #9

Closed kb70 closed 9 years ago

kb70 commented 11 years ago

the current version gives an error when trying to access an IOS-XR based Cisco Router (ASR9k in our case): <type 'exceptions.Exception'>: pexpect session failed: Connection timeout. args = ('pexpect session failed: Connection timeout.',) message = 'pexpect session failed: Connection timeout.'

This is when the website is called initially. If we can be of any help in testing/debugging please get in contact with me.

tmshlvck commented 11 years ago

Hi!

The IOS-XR is not yet supported. I would really like to add support but I was unable to obtain exec access to any IOS-XR router yet. (You know, there are plenty of testing or lab boxes with IOS, but virtually none with IOS-XR. And when somebody has one he uses it in a serious production network so nobody wants to give an access to a stranger.)

If you would be interested in writing and contributing an IOS-XR support to ULG I would be really glad. There are some commented-out debugging code. I suggest you to start with uncommenting line #908 and then you can see the whole SSH sessions in the logfile. Warning: There are passwords in plaintext included. Perhaps you can send me the log so I can have a look at it and I might try to write some supporting code. But it is going to be totally untested and therefore unlikely to work immediately.

Cheers, Tomas

kb70 commented 11 years ago

Hi Tomas,

thanks for your quick response.

Tomas Hlavacek schrieb:

Hi!

The IOS-XR is not yet supported. I would really like to add support but I was unable to obtain exec access to any IOS-XR router yet. (You know, there are plenty of testing or lab boxes with IOS, but virtually none with IOS-XR. And when somebody has one he uses it in a serious production network so nobody wants to give an access to a stranger.)

We have a lab chassis for which I can grant you access if you wish. Right now we are in the process of upgrading our ASR9ks, so the box is used for upgrading the RSPs of the production chassis to keep the downtimes low. I guess this should be done mid of next week and you can then have access to this box if you like.

If you would be interested in writing and contributing an IOS-XR support to ULG I would be really glad. There are some commented-out debugging code. I suggest you to start with uncommenting line #908 and then you can see the whole SSH sessions in the logfile. Warning: There are passwords in plaintext included. Perhaps you can send me the log so I can have a look at it and I might try to write some supporting code. But it is going to be totally untested and therefore unlikely to work immediately.

One thing I figured out myself, is that the STRING_EXPECT_SHELL_PROMPT_REGEXP doesn't match for IOS-XR, I changed that to add / and : to the regex and this now works (STRING_EXPECT_SHELL_PROMPTREGEXP = '\n[a-zA-Z0-9.\/:-]+(>|#)'). Now the login to the box + first cmd works, but I guess the BGP regex than again doesn't match. The output of ulgcisco.log (after the initial login) is: RP/0/RSP0/CPU0:core1#terminal length 0 terminal length 0 Thu Jul 18 08:13:56.648 UTC terminal width 0 show bgp ipv4 unicast summary RP/0/RSP0/CPU0:core1#terminal width 0 Thu Jul 18 08:13:56.817 UTC RP/0/RSP0/CPU0:core1#show bgp ipv4 unicast summary Thu Jul 18 08:13:56.999 UTC BGP router identifier 193.171.23.245, local AS number 1853 BGP generic scan interval 60 secs BGP table state: Active Table ID: 0xe0000000 RD version: 764900 BGP main routing table version 764900 BGP scan interval 60 secs

BGP is operating in STANDALONE mode.

Process RcvTblVer bRIB/RIB LabelVer ImportVer SendTblVer StandbyVer Speaker 764900 764900 764900 764900
764900 764900

Neighbor Spk AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down St/PfxRcd 62.40.124.133 0 20965 4277 402 764900 0 0 02:54:56 13439 81.16.144.12 0 1764 95683 569 764900 0 0 02:53:07 453284 193.171.13.42 0 2607 3274 25654 764853 0 0 02:54:57 9746 193.171.16.245 0 1853 177 52710 764900 0 0 02:55:25 0 193.171.23.241 0 1853 289 54508 764900 0 0 02:55:28 232 193.171.23.242 0 1853 253 54508 764900 0 0 02:55:30 132 193.171.23.246 0 1853 211 54507 764900 0 0 02:55:18 27 193.171.23.250 0 1853 106235 54508 764900 0 0 02:55:20 315110 193.203.0.3 0 2686 181 279 764900 0 0 02:50:04 13 193.203.0.5 0 5403 788 279 764900 0 0 02:50:11 20 193.203.0.10 0 8339 205 279 764900 0 0 02:50:12 43 193.203.0.11 0 8447 500 449 764900 0 0 02:49:41 430 193.203.0.12 0 10282 175 279 764900 0 0 02:50:02 5 193.203.0.13 0 3330 268 279 764900 0 0 02:50:11 51 193.203.0.14 0 3330 267 279 764900 0 0 02:50:03 51 193.203.0.15 0 5403 628 279 764900 0 0 02:50:11 20 193.203.0.16 0 6798 345 279 764900 0 0 02:50:09 6 193.203.0.17 0 8245 370 450 764900 0 0 02:50:03 0 193.203.0.18 0 8339 648 279 764900 0 0 02:49:49 43 193.203.0.19 0 33890 541 619 764900 0 0 02:50:11 2 193.203.0.20 0 28857 175 279 764900 0 0 02:50:02 2 193.203.0.21 0 8447 506 450 764900 0 0 02:50:01 430 193.203.0.23 0 6830 1948 449 764900 0 0 02:49:52 2488 193.203.0.24 0 24864 189 278 764900 0 0 02:49:51 6 193.203.0.26 0 8387 197 279 764900 0 0 02:50:10 17 193.203.0.27 0 16099 189 278 764900 0 0 02:49:57 1 193.203.0.29 0 8445 202 279 764900 0 0 02:50:09 33 193.203.0.33 0 42 177 279 764900 0 0 02:50:05 42 193.203.0.37 0 12895 175 278 764900 0 0 02:49:48 1 193.203.0.38 0 12401 190 279 764900 0 0 02:50:01 2 193.203.0.40 0 3320 6048 449 764900 0 0 02:49:42 20246 193.203.0.43 0 12605 201 279 764900 0 0 02:50:05 35 193.203.0.45 0 8218 1011 450 764900 0 0 02:50:11 1733 193.203.0.47 0 12895 175 279 764900 0 0 02:49:58 1 193.203.0.54 0 12971 301 450 764900 0 0 02:50:08 7 193.203.0.55 0 8220 1215 279 764900 0 0 02:49:48 2025 193.203.0.64 0 6730 449 449 764900 0 0 02:49:53 273 193.203.0.67 0 13064 175 279 764900 0 0 02:50:01 1 193.203.0.68 0 15702 360 450 764900 0 0 02:50:07 0 193.203.0.75 0 15498 176 279 764900 0 0 02:50:02 4 193.203.0.77 0 9119 237 279 764900 0 0 02:50:04 88 193.203.0.79 0 16195 175 279 764900 0 0 02:50:10 1 193.203.0.80 0 20704 361 449 764900 0 0 02:49:54 14 193.203.0.81 0 20751 165 267 764900 0 0 02:36:45 14 193.203.0.84 0 8412 196 279 764900 0 0 02:49:51 27 193.203.0.86 0 12577 200 279 764900 0 0 02:49:52 2 193.203.0.87 0 21360 175 279 764900 0 0 02:50:04 1 193.203.0.88 0 5385 197 279 764900 0 0 02:49:53 13 193.203.0.91 0 13237 794 449 764900 0 0 02:49:41 1226 193.203.0.94 0 13046 175 279 764900 0 0 02:50:00 0 193.203.0.95 0 25575 172 278 764900 0 0 02:49:48 1 193.203.0.96 0 25255 195 279 764900 0 0 02:50:02 18 193.203.0.97 0 286 1816 280 764900 0 0 02:50:12 6232 193.203.0.98 0 24992 191 279 764900 0 0 02:50:09 2 193.203.0.99 0 13030 497 279 764900 0 0 02:49:57 865 193.203.0.101 0 5588 1147 449 764900 0 0 02:49:49 2775 193.203.0.102 0 3209 1551 279 764900 0 0 02:49:34 2789 193.203.0.104 0 24953 393 449 764900 0 0 02:49:54 40 193.203.0.105 0 1257 661 449 764900 0 0 02:49:56 856 193.203.0.106 0 8928 2740 450 764900 0 0 02:50:02 7977 193.203.0.107 0 28889 199 279 764900 0 0 02:50:06 4 193.203.0.110 0 3212 228 279 764900 0 0 02:50:00 78 193.203.0.111 0 13101 688 279 764900 0 0 02:49:41 29 193.203.0.115 0 28760 204 279 764900 0 0 02:50:06 11 193.203.0.116 0 12399 178 279 764900 0 0 02:50:09 7 193.203.0.117 0 8591 399 450 764900 0 0 02:50:06 70 193.203.0.118 0 8674 175 279 764900 0 0 02:50:01 3 193.203.0.122 0 25467 1368 279 764900 0 0 02:49:53 15 193.203.0.123 0 12654 176 112925 764747 0 0 02:49:28 2 193.203.0.124 0 34347 842 617 764900 0 0 02:49:45 8 193.203.0.125 0 39478 175 279 764900 0 0 02:50:07 1 193.203.0.126 0 3856 174 279 764900 0 0 02:50:10 1 193.203.0.130 0 8596 180 279 764900 0 0 02:50:02 8 193.203.0.131 0 21013 213 279 764900 0 0 02:50:05 52 193.203.0.132 0 28857 172 279 764900 0 0 02:50:08 2 193.203.0.133 0 29287 195 279 764900 0 0 02:49:56 2 193.203.0.134 0 39912 438 279 764900 0 0 02:50:10 245 193.203.0.135 0 34594 369 450 764900 0 0 02:50:00 38 193.203.0.136 0 21385 425 450 764900 0 0 02:50:02 205 193.203.0.137 0 33890 536 619 764900 0 0 02:50:12 2 193.203.0.139 0 3303 738 450 764900 0 0 02:50:02 1143 193.203.0.140 0 16265 354 450 764900 0 0 02:49:34 126 193.203.0.141 0 29562 364 450 764900 0 0 02:50:00 46 193.203.0.143 0 12337 383 450 764900 0 0 02:50:01 67 193.203.0.144 0 29056 208 279 764900 0 0 02:50:10 28 193.203.0.145 0 31510 177 278 764900 0 0 02:49:51 4 193.203.0.146 0 15598 207 279 764900 0 0 02:50:10 73 193.203.0.148 0 21213 356 449 764900 0 0 02:49:55 5 193.203.0.149 0 44765 199 279 764900 0 0 02:50:05 1 193.203.0.150 0 9002 3192 449 764900 0 0 02:49:58 11266 193.203.0.151 0 16276 865 279 764900 0 0 02:50:03 69 193.203.0.152 0 8218 1010 450 764900 0 0 02:50:01 1733 193.203.0.153 0 8674 175 279 764900 0 0 02:50:11 3 193.203.0.154 0 33891 445 450 764900 0 0 02:50:00 331 193.203.0.155 0 16099 189 278 764900 0 0 02:49:47 1 193.203.0.156 0 31529 176 279 764900 0 0 02:50:11 2 193.203.0.157 0 35369 195 279 764900 0 0 02:50:11 8 193.203.0.158 0 31543 198 279 764900 0 0 02:50:11 10 193.203.0.159 0 41491 192 279 764900 0 0 02:49:56 2 193.203.0.160 0 6663 713 449 764900 0 0 02:49:25 2256 193.203.0.161 0 24864 189 279 764900 0 0 02:50:01 6 193.203.0.162 0 38955 625 279 764900 0 0 02:50:11 5 193.203.0.163 0 25192 177 279 764900 0 0 02:50:06 4 193.203.0.165 0 8075 360 450 764900 0 0 02:50:12 118 193.203.0.166 0 35366 327 279 764900 0 0 02:50:09 9 193.203.0.168 0 20940 359 449 764900 0 0 02:49:56 9 193.203.0.171 0 34695 225 279 764900 0 0 02:50:08 55 193.203.0.175 0 25011 191 279 764900 0 0 02:49:52 1 193.203.0.177 0 56833 194 279 764900 0 0 02:50:05 12 193.203.0.178 0 43957 188 279 764900 0 0 02:50:03 7 193.203.0.179 0 22822 544 363 764900 0 0 02:49:57 479 193.203.0.180 0 35339 325 279 764900 0 0 02:49:51 18 193.203.0.181 0 197999 971 279 764900 0 0 02:49:51 12 193.203.0.182 0 48362 0 0 0 0 0 00:00:00 Idle (Admin) 193.203.0.183 0 29545 202 279 764900 0 0 02:50:10 5 193.203.0.184 0 15133 357 450 764900 0 0 02:50:02 12 193.203.0.185 0 6939 8297 279 764900 0 0 02:50:08 37151 193.203.0.186 0 42473 192 279 764900 0 0 02:49:51 20 193.203.0.188 0 8400 373 450 764900 0 0 02:50:02 21 193.203.0.189 0 57169 870 279 764900 0 0 02:50:11 67 193.203.0.191 0 43061 237 279 764900 0 0 02:49:45 48 193.203.0.192 0 47692 180 279 764900 0 0 02:50:09 17 193.203.0.193 0 56672 192 279 764900 0 0 02:50:11 6 193.203.0.194 0 32934 352 450 764900 0 0 02:50:01 19 193.203.0.251 0 1121 3063 279 764900 0 0 02:50:04 7526 193.203.0.252 0 1121 2861 279 764900 0 0 02:50:10 7529 193.203.0.253 0 1121 196 279 764900 0 0 02:49:56 0 195.113.179.149 0 2852 4162 25590 764853 0 0 02:55:02 14777 212.191.224.149 0 8501 762 20346 764900 0 0 02:55:04 901

RP/0/RSP0/CPU0:core1#

So you can see there are some (minor) differences between IOS and IOS-XR output of the same command. The raised error is pexpect session failed: Connection timeout

If you can confirm, that this is a regex problem, I'll dig deeper into it.

Thanks again for your help, best regards, Kurt

Cheers, Tomas

— Reply to this email directly or view it on GitHub https://github.com/tmshlvck/ulg/issues/9#issuecomment-21122919.

tmshlvck commented 11 years ago

Hi!

I would be glad if you could give me an access to your testing IOS-XR box. And I suspect that it is going to be more complicated to accommodate ULG for IOS-XR than making few changes in regexps. But I do not know for sure because I haven't seen all the needed outputs from IOS-XR yet.

Could you set up some sort of lab environment for ULG then? I would like to see some established and few active BGP sessions (both ipv4 and 6) and some routes in BGP. Or if it is not possible I can try to debug IOS-XR SSH interaction module on your live box and then obtain text dumps of needed command outputs and create a mockup router module for them.

Perhaps we can switch our discussion about the IOS-XR to e-mails.

Cheers, Tomas

tmshlvck commented 9 years ago

Just closing old issue... Support for IOS-XR is already present.