[Xorp-users] Problem

Pavlin Radoslavov pavlin@icir.org
Thu, 16 Jun 2005 13:39:13 -0700


> I tried this out, but T still got nothing...

I tried to play a bit with the script, but it doesn't seem to work
for me either. For example, command "configure" properly switched
xorpsh in configuration mode, but then "show" didn't show the
configuration.

There were some other peculiar behavior. E.g., executing command
"show interfaces" followed by "configure" blocked, so I presume
there is something missing in the Python script (or in the
interaction between xorpsh and Python).

Unfortunately, I am not familiar with Python so I cannot help you.

> I just need a way to redirect the result of this command in a file...that's it.

An alternative solution would be to wait for us to fix xorpsh
so after the fix it will accept commands like:

echo "show igmp group" | xorpsh

Pavlin

> Please, any ideas?
> Thanks 
> 
> -----Message d'origine-----
> De : Pavlin Radoslavov [mailto:pavlin@icir.org] 
> Envoyé : mercredi 15 juin 2005 19:26
> À : zze-BEN SAID Mehdi RD-CORE-ISS
> Cc : xorp-users@xorp.org; Pavlin Radoslavov; atanu@ICSI.Berkeley.EDU
> Objet : Re: [Xorp-users] Problem 
> 
> > Hi everybody,
> > I have a little problem.
> > I'm trying to get information from Xorp using a pexpect python script:
> > 
> > #!/usr/bin/env python
> > import sys
> > import pexpect
> > 
> > child=pexpect.spawn ('xorpsh')
> > child.expect('Xorp> ')
> > child.sendline ('show igmp group')
> > child.expect('Xorp> ')
> > print child.before # I use this to print the result of the show 
> > command
> > child.close()
> > 
> > Everything's works right, but I got nothing displayed!!! And of 
> > course, when I type it manually on the xorpsh CLI, there are so many routes.
> > Is there any solution?
> 
> Does it work for commands like "show igmp interface" that eventually would display much shorter output?
> 
> One possible problem that comes to mind if the output is so long, is that probably it goes through the xorpsh built-in pager.
> To verify that, try to disable the pager by using the following command inside your python script:
> show igmp group | no-more
> 
> Pavlin
> 
> _______________________________________________
> Xorp-users mailing list
> Xorp-users@xorp.org
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-users