Junos Automation (Scripting)
Junos Automation (Scripting)

Lame Question Regarding SLAX

11.02.10   |  
‎11-02-2010 06:49 PM

Hi, All, 

 

I posted a similar post in another forum so I apologize if you're reading this twice.  Basically I have a lame SLAX question that I'm sure is pretty easy to answer.  I'm trying to create a custom login script that sets my terminal emulation type and screen length "set cli screen-length 0" and "run set cli terminal vt100" variables.  Basically I've got the following script;

 

version 1.0;
import "../import/junos.xsl";
match / {
        <op-script-results> {
                <output> "Starting Login Script!";
                var $set_vt100 = {
                        <command> 'set cli terminal vt100';
                }
                var $result = jcs:invoke($set_vt100);
                <output> "Ending Login Script!";
        }
}
The script is actually executing fine, but the problem is that it appears to be spawning a separate user login process to execute this command and then quitting.  The settings aren't actually applying for the current login.  Is there any way around this?  I would like to set my CLI options for my terminal upon login. 
Nov  3 01:32:02 10.4.224.20 file[95653]: UI_LOGIN_EVENT: User 'slax-test' login, class 'j-uoc_custom' [95653], ssh-connection '128.135.2.160 54385 10.4.224.20 22', client-mode 'junoscript'
Nov  3 01:32:02 10.4.224.20 file[95653]: UI_CMDLINE_READ_LINE: User 'slax-test', command 'rpc command set cli terminal vt100 '
Nov  3 01:32:02 10.4.224.20 file[95653]: UI_JUNOSCRIPT_CMD: User 'slax-test' used JUNOScript client to run command 'set cli terminal type=vt100'
Nov  3 01:32:02 10.4.224.20 file[95653]: UI_LOGOUT_EVENT: User 'slax-test' logout
Thank-you,
Dan Sullivan

 

5 REPLIES
Highlighted
Junos Automation (Scripting)

Re: Lame Question Regarding SLAX

11.03.10   |  
‎11-03-2010 09:57 AM

I replied in the other forum, but I'll do so here too. It isn't possible for a script (login or normal op script) to modify your current session settings.

Junos Automation (Scripting)

Re: Lame Question Regarding SLAX

11.03.10   |  
‎11-03-2010 10:36 AM

ccali,

 

Thank you for your reply.  Do you (or anybody) know if it's possible to set these types of options upon login or link them to a user class in any way (script or no script)?  I would think that this would be something that many users would like to do.

 

Dan

Junos Automation (Scripting)

Re: Lame Question Regarding SLAX

11.03.10   |  
‎11-03-2010 12:41 PM

It doesn't look like there is a way to do this currently within Junos, unfortunately.

Junos Automation (Scripting)

Re: Lame Question Regarding SLAX

11.03.10   |  
‎11-03-2010 02:19 PM

Ok, thanks for your help.

 

Dan Sullivan

Junos Automation (Scripting)

Re: Lame Question Regarding SLAX

06.06.11   |  
‎06-06-2011 01:31 AM

It is not possible to set screen-length to 0 but it is possible to set max size. Something like this:

 

> stty rows 100000
> export TERM=test
> ssh 192.0.2.1
...
cougar@example> show cli 
...
CLI screen-length set to 34464
CLI screen-width set to 80
CLI terminal is 'test'
--
Cougar