0

I am developing a console application to manage firewall devices from a unix server. The console application is based on npyscreen library of python. One of the options I need to provide to the users is login to the device CLI from the TUI thats developed using npyscreen. For this I need to toggle between the TUI and the device CLI once the login has happened to the device from the unix server.

Can anyone (having experience with npyscreen) help me on how this can be done in npyscreen?

The flow here is like :

  1. Select option to login to the device (in TUI)
  2. The TUI executes backend script to login to the device
  3. TUI allows user to see the device console may be by toggling from TUI to the CLI mode
  4. The user does his things on the device in the console mode
  5. User exits the device CLI and is landed back to the TUI again.

Any help will be appreciated.

Regards Pradeep

Anju
  • 631
  • 2
  • 9
  • 25
  • How does the CLI of the device appears? I mean usually in case of networking devices if you access the device at some port the CLI just pops up asking for the credentials. Maybe you can do the same that in your TUI when the user selects a particular option a script will just try to connect to the firewall device in that particular port which is accepting incoming connections for the management! Please update me if I missed something? – ρss Sep 21 '15 at 07:54
  • Just got an answer to my issue here – Pradeep Tyagi Sep 22 '15 at 03:56
  • The devices are usually unix based having shell prompt just like unix servers or they may have their own toolsets interactive shell. Got the answer on this thread. http://stackoverflow.com/questions/32305936/running-command-line-program-from-npyscreen-select-option There is a method in npyscreen called CallSubShell that be used for this purpose . – Pradeep Tyagi Sep 22 '15 at 03:57

1 Answers1

0

The devices are usually unix based having shell prompt just like unix servers or they may have their own toolsets interactive shell.

Got the answer on this thread.

running command line program from npyscreen select option

There is a method in npyscreen called CallSubShell that be used for this purpose .

Community
  • 1
  • 1