Sometimes you have devices which do not allow you to disable multi-page support. For example on a Cisco router, the system automatically paginates the output into a screen so you can read it. On Linux most commands do not have pagination built in, you use less or more to handle that.
This page is going to describe features of the phrasebook system used by opConfig to handle all the different vendors and products we support.
The best option is to disable pagination, in Cisco IOS the command would be "term length 0", in linux "unset PAGER". This would be set in the opConfig phrasebook for "enable_paging" and "disable_paging".
Handling Interactive Pagination
Add a macro to the phrasebook
First we need to add a new macro to the phrasebook, in this example I am using the bash PB (/usr/local/omk/conf/phrasebooks/unix/bash/pb) which Linux uses by default. I am adding a test for using the macro to handle paging, so I am adding the following to the existing phrasebook, which will deliberately add a pager to be handled.
The two quotes ‘ are wrapped around a space so '<space>’.
The full phrasebook /usr/local/omk/conf/phrasebooks/unix/bash/pb looks like:
Creating a Command Set to invoke a macro
Now we need a command set which uses that macro, which was a feature recently added, to invoke this the command starts with “_”, so in the command set this would be:
The full command set would look like this, file /usr/local/omk/conf/command_sets.d/pager_test.json:
Run the command set with a macro
Now to run opConfig and use that macro, you could use Virtual Operator in the GUI or the following command:
Voila, opConfig executes the macro which handles the interactive paging.