Juniper / py-junos-eznc

Python library for Junos automation
https://www.juniper.net/documentation/en_US/junos-pyez/information-products/pathway-pages/junos-pyez-developer-guide.html
Apache License 2.0
671 stars 344 forks source link

Data channel recv buffer issue with StartShell.wait_for() #869

Closed mmellin closed 5 years ago

mmellin commented 6 years ago

Issue

When running multiple commands through the run() method of StartShell(), data is not always fully received from the buffer prior to returning got. This means that the output of the 2nd command in the list may be truncated or invalid if the commands are run in succession. I've tried a sleep time within my own code between commands, but it does not solve it.

Example code:

Commands:
  - {Command: 'cprod -A <fpc> -c "show jnh 0 pool"'}
  - {Command: 'cli -c "show version | display xml | no-more"'}
with StartShell(dev, timeout=30) as ss:
    for command in commands:
         _ret = ss.run(command['Command'])
         <write _ret to file>

Sample current bad witnessed behavior

mmellin-mbp:outputs mmellin$ unzip outputs_20180822_1753.zip
Archive:  outputs_20180822_1753.zip
  inflating: mx240_fpc0_show_jnh_0_pool_1534960400.txt
  inflating: mx240_fpc1_show_jnh_0_pool_1534960400.txt
  inflating: mx240_show_version_1534960400.txt
mmellin-mbp:outputs mmellin$ cat mx240_fpc0_show_jnh_0_pool_1534960400.txt
cprod -A fpc0 -c "show jnh 0 pool"

PFE 0 JNH Partition is using Cassis-Alloc.
PFE 0 JNH Partition OK check is enabled, requests 3442779
                Name     MemType            Total         Used       (%)    Free       (%)

            Next Hop     EDMEM               4194240       1454163  34%      2740077  66%

            Firewall     EDMEM               2097152         41611   1%      2055541  99%

            Counters     EDMEM               4194304       2251682  53%      1942622  47%

                LMEM     LMEM                    128           128 100%            0   0%

                HASH     EDMEM               7044608       7044608 100%            0   0%
                         OMEM               33202208      33202208 100%            0   0%

              ENCAPS     EDMEM               4259840       4259840 100%            0   0%

          UEID_SPACE     EDMEM               1048576           130 < 1%      1048446 >99%

   UEID_SHARED_SPACE     EDMEM                 65536             3 < 1%        65533 >99%
mmellin-mbp:outputs mmellin$ cat mx240_fpc1_show_jnh_0_pool_1534960400.txt
echo $?

0
%
mmellin-mbp:outputs mmellin$ cat mx240_show_version_1534960400.txt
%

Log output during Issue

2018/08/22 11:03:23 __main__ 109 - INFO: Begin running collection script
2018/08/22 11:03:23 __main__ 111 - INFO: Opening `data.yml` file
2018/08/22 11:03:23 __main__ 129 - INFO: Looping through devices
2018/08/22 11:03:23 __main__ 131 - INFO: ----------------------------------------
2018/08/22 11:03:23 __main__ 132 - INFO: Begin collection from device: mx240
2018/08/22 11:03:23 __main__ 155 - INFO: Attempting connection to mx240
2018/08/22 11:03:23 ncclient.transport.ssh 1687 - INFO: Connected (version 2.0, client OpenSSH_6.6.1)
2018/08/22 11:03:23 ncclient.transport.ssh 1687 - INFO: Auth banner: b'\n--------------------------------------------\n| This is box is for dev and testing   |\n|   WARNING:  UNAUTHORIZED USE OR TAMPERING |\n|  IS PROHIBITED. ALL            |\n|  TRANSACTIONS ARE MONITORED.            |\n--------------------------------------------\n'
2018/08/22 11:03:23 ncclient.transport.ssh 1687 - INFO: Authentication (publickey) failed.
2018/08/22 11:03:23 ncclient.transport.ssh 1687 - INFO: Authentication (password) successful!
2018/08/22 11:03:23 ncclient.transport.session 111 - INFO: initialized: session-id=83020 | server_capabilities=<dict_keyiterator object at 0x103b28cc8>
2018/08/22 11:03:23 __main__ 157 - INFO: Opened SSH connection to mx240
2018/08/22 11:03:23 __main__ 169 - INFO: Opening Shell on device mx240
2018/08/22 11:03:23 paramiko.transport 1687 - INFO: Connected (version 2.0, client OpenSSH_6.6.1)
2018/08/22 11:03:24 paramiko.transport 1687 - INFO: Auth banner: b'\n--------------------------------------------\n| This is box is for dev and testing   |\n|    WARNING:  UNAUTHORIZED USE OR TAMPERING |\n|  IS PROHIBITED.  ALL            |\n|  TRANSACTIONS ARE MONITORED.              |\n--------------------------------------------\n'
2018/08/22 11:03:24 paramiko.transport 1687 - INFO: Authentication (publickey) failed.
2018/08/22 11:03:24 paramiko.transport 1687 - INFO: Authentication (password) successful!
sleep None
recv data: b'Last login: Wed Aug 22 11:00:00 2018 from 192.168.1.1\r\r\n'
sleep None
recv data: b'--- JUNOS 15.1R5-S3.4 Kernel 64-bit  JNPR-10.3-20160927.337663_build\r\n'
sleep None
recv data: b'myuser@mx240> '
send data: start shell
send data newline:
sleep None
recv data: b'st'
sleep None
recv data: b'art'
sleep None
recv data: b' s'
sleep None
recv data: b'hell'
sleep None
recv data: b' '
sleep None
recv data: b'\r\n'
sleep None
recv data: b'% '
2018/08/22 11:03:24 __main__ 173 - INFO: opening took 0.8582031726837158 secs
2018/08/22 11:03:24 __main__ 174 - INFO: Connection opened
send data: cprod -A fpc0 -c "show jnh 0 pool"
send data newline:
sleep 0
recv data: b'cpr'
sleep 0
recv data: b'od -A fpc0 -c "show jnh 0 pool"'
sleep 0
recv data: b'\r\r\n'
sleep 0
recv data: b'\r\nPFE 0 JNH Partition is using Cassis-Alloc.\r\nPFE 0 JNH Partition OK check is enabled, requests 3442779\r\n                Name     MemType            Total         Used       (%)    Free       (%)\r\n'
sleep 0
recv data: b'\r\n            Next Hop     EDMEM               4194240       1454163  34%      2740077  66%\r\n\r\n            Firewall     EDMEM               2097152         41611   1%      2055541  99%\r\n\r\n            Counters     EDMEM               4194304       2251682  53%      1942622  47%\r\n\r\n                LMEM     LMEM                    128           128 100%            0   0%\r\n\r\n                HASH     EDMEM               7044608       7044608 100%            0   0%\r\n                         OMEM               33202208      33202208 100%            0   0%\r\n\r\n              ENCAPS     EDMEM               4259840       4259840 100%            0   0%\r\n\r\n          UEID_SPACE     EDMEM               1048576           130 < 1%      1048446 >99%\r\n\r\n   UEID_SHARED_SPACE     EDMEM                 65536             3 < 1%        65533 >99%\r\n'
send data: echo $?
send data newline:
sleep 0
recv data: b'% '    <<<<<<< HERE ISSUE IS FIRST SEEN - THIS IS THE LAST PART OF THE EXPECTED OUTPUT FROM ABOVE RECV CALL
2018/08/22 11:03:24 __main__ 179 - INFO: (False, 'cprod -A fpc0 -c "show jnh 0 pool"\r\r\n\r\nPFE 0 JNH Partition is using Cassis-Alloc.\r\nPFE 0 JNH Partition OK check is enabled, requests 3442779\r\n                Name     MemType            Total         Used       (%)    Free       (%)\r\n\r\n            Next Hop     EDMEM               4194240       1454163  34%      2740077  66%\r\n\r\n            Firewall     EDMEM               2097152         41611   1%      2055541  99%\r\n\r\n            Counters     EDMEM               4194304       2251682  53%      1942622  47%\r\n\r\n                LMEM     LMEM                    128           128 100%            0   0%\r\n\r\n                HASH     EDMEM               7044608       7044608 100%            0   0%\r\n                         OMEM               33202208      33202208 100%            0   0%\r\n\r\n              ENCAPS     EDMEM               4259840       4259840 100%            0   0%\r\n\r\n          UEID_SPACE     EDMEM               1048576           130 < 1%      1048446 >99%\r\n\r\n   UEID_SHARED_SPACE     EDMEM                 65536             3 < 1%        65533 >99%\r\n')
cprod -A fpc0 -c "show jnh 0 pool"

PFE 0 JNH Partition is using Cassis-Alloc.
PFE 0 JNH Partition OK check is enabled, requests 3442779
                Name     MemType            Total         Used       (%)    Free       (%)

            Next Hop     EDMEM               4194240       1454163  34%      2740077  66%

            Firewall     EDMEM               2097152         41611   1%      2055541  99%

            Counters     EDMEM               4194304       2251682  53%      1942622  47%

                LMEM     LMEM                    128           128 100%            0   0%

                HASH     EDMEM               7044608       7044608 100%            0   0%
                         OMEM               33202208      33202208 100%            0   0%

              ENCAPS     EDMEM               4259840       4259840 100%            0   0%

          UEID_SPACE     EDMEM               1048576           130 < 1%      1048446 >99%

   UEID_SHARED_SPACE     EDMEM                 65536             3 < 1%        65533 >99%
send data: cprod -A fpc1 -c "show jnh 0 pool"
send data newline:
sleep 0
recv data: b'ech'
sleep 0
recv data: b'o $?'
sleep 0
recv data: b'\r\r\n'
sleep 0
recv data: b'0\r\n'
sleep 0
recv data: b'% '
send data: echo $?
send data newline:
sleep 0
recv data: b'cprod -A fpc1 -c "show jnh 0 pool"\r\r\n'
sleep 0
recv data: b'\r\nPFE 0 JNH Partition is using Cassis-Alloc.\r\nPFE 0 JNH Partition OK check is enabled, requests 5083143\r\n                Name     MemType            Total         Used       (%)    Free       (%)\r\n'
sleep 0
recv data: b'\r\n            Next Hop     EDMEM               5242816       1455923  27%      3786893  73%\r\n\r\n            Firewall     EDMEM               2097152         41611   1%      2055541  99%\r\n\r\n            Counters     EDMEM               4194304       2251770  53%      1942534  47%\r\n\r\n                LMEM     LMEM                    128           128 100%            0   0%\r\n\r\n                HASH     EDMEM               7044608       7044608 100%            0   0%\r\n                         OMEM               33202208      33202208 100%            0   0%\r\n\r\n              ENCAPS     EDMEM               4259840       4259840 100%            0   0%\r\n\r\n          UEID_SPACE     EDMEM               1048576           129 < 1%      1048447 >99%\r\n\r\n   UEID_SHARED_SPACE     EDMEM                 65536             2 < 1%        65534 >99%\r\n'
2018/08/22 11:03:25 __main__ 179 - INFO: (True, 'echo $?\r\r\n0\r\n% ')
echo $?

0
% 
send data: cli -c "show version | display xml | no-more"
send data newline:
sleep 0
recv data: b'% '
send data: echo $?
send data newline:
sleep 0
recv data: b'ech'
sleep 0
recv data: b'o $?\r\r\n'
sleep 0
recv data: b'0\r\n'
sleep 0
recv data: b'% '
2018/08/22 11:03:25 __main__ 179 - INFO: (True, '% ')
% 
2018/08/22 11:03:25 ncclient.operations.rpc 313 - INFO: Requesting 'CloseSession'
2018/08/22 11:03:25 __main__ 230 - INFO: Creating a Zip archive of outputs...
2018/08/22 11:03:25 __main__ 233 - INFO: Done

Process finished with exit code 0

Workaround

The only way I worked through this was to add a small sleep time within the StartShell() wait_for() method after trying to retrieve data from the channel. This few millisecond sleep was all it seemed to need to solve the problem. The sleep time I added was 0.05 or 50ms.

        while timeout > datetime.datetime.now():
            rd, wr, err = select([chan], [], [], _SELECT_WAIT)
            if rd:
                data = chan.recv(_RECVSZ)
                if self.sleep:                       # <<<<<
                    time.sleep(self.sleep)       # <<<<<

Sample new user code:

            with StartShell(dev, timeout=30) as ss:
                for command in commands:
                    _ret = ss.run(command['Command'], sleep=0.05)
                   <write _ret to file>

Workaround output now as expected


mmellin-mbp:outputs mmellin$ unzip outputs_20180822_1800.zip
Archive:  outputs_20180822_1800.zip
  inflating: mx240_fpc0_show_jnh_0_pool_1534960800.txt
  inflating: mx240_fpc1_show_jnh_0_pool_1534960801.txt
  inflating: mx240_show_version_1534960801.txt
mmellin-mbp:outputs mmellin$ cat mx240_fpc0_show_jnh_0_pool_1534960800.txt
cprod -A fpc0 -c "show jnh 0 pool"

PFE 0 JNH Partition is using Cassis-Alloc.
PFE 0 JNH Partition OK check is enabled, requests 3442779
                Name     MemType            Total         Used       (%)    Free       (%)

            Next Hop     EDMEM               4194240       1454163  34%      2740077  66%

            Firewall     EDMEM               2097152         41611   1%      2055541  99%

            Counters     EDMEM               4194304       2251682  53%      1942622  47%

                LMEM     LMEM                    128           128 100%            0   0%

                HASH     EDMEM               7044608       7044608 100%            0   0%
                         OMEM               33202208      33202208 100%            0   0%

              ENCAPS     EDMEM               4259840       4259840 100%            0   0%

          UEID_SPACE     EDMEM               1048576           130 < 1%      1048446 >99%

   UEID_SHARED_SPACE     EDMEM                 65536             3 < 1%        65533 >99%
%
mmellin-mbp:outputs mmellin$ cat mx240_fpc1_show_jnh_0_pool_1534960801.txt
cprod -A fpc1 -c "show jnh 0 pool"

PFE 0 JNH Partition is using Cassis-Alloc.
PFE 0 JNH Partition OK check is enabled, requests 5083143
                Name     MemType            Total         Used       (%)    Free       (%)

            Next Hop     EDMEM               5242816       1455923  27%      3786893  73%

            Firewall     EDMEM               2097152         41611   1%      2055541  99%

            Counters     EDMEM               4194304       2251770  53%      1942534  47%

                LMEM     LMEM                    128           128 100%            0   0%

                HASH     EDMEM               7044608       7044608 100%            0   0%
                         OMEM               33202208      33202208 100%            0   0%

              ENCAPS     EDMEM               4259840       4259840 100%            0   0%

          UEID_SPACE     EDMEM               1048576           129 < 1%      1048447 >99%

   UEID_SHARED_SPACE     EDMEM                 65536             2 < 1%        65534 >99%
%
mmellin-mbp:outputs mmellin$ cat mx240_show_version_1534960801.txt
cli -c "show version | display xml | no-more"

<rpc-reply xmlns:junos="http://xml.juniper.net/junos/15.1R5/junos">
    <software-information>
        <host-name>MX240</host-name>
        <product-model>mx240</product-model>
        <product-name>mx240</product-name>
        <junos-version>15.1R5-S3.4</junos-version>
        <package-information>
            <name>os-kernel</name>
            <comment>JUNOS OS Kernel 64-bit  [20160927.337663_builder_stable_10]</comment>
        </package-information>
        <package-information>
            <name>os-libs</name>
            <comment>JUNOS OS libs [20160927.337663_builder_stable_10]</comment>
        </package-information>
        <package-information>
            <name>os-runtime</name>
            <comment>JUNOS OS runtime [20160927.337663_builder_stable_10]</comment>
        </package-information>
        <package-information>
            <name>zoneinfo</name>
            <comment>JUNOS OS time zone information [20160927.337663_builder_stable_10]</comment>
        </package-information>
        <package-information>
            <name>os-libs-compat32</name>
            <comment>JUNOS OS libs compat32 [20160927.337663_builder_stable_10]</comment>
        </package-information>
        <package-information>
            <name>os-compat32</name>
            <comment>JUNOS OS 32-bit compatibility [20160927.337663_builder_stable_10]</comment>
        </package-information>
        <package-information>
            <name>py-base</name>
            <comment>JUNOS py base [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>os-crypto</name>
            <comment>JUNOS OS crypto [20160927.337663_builder_stable_10]</comment>
        </package-information>
        <package-information>
            <name>netstack</name>
            <comment>JUNOS network stack and utilities [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>junos-libs-compat32</name>
            <comment>JUNOS libs compat32 [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>junos-runtime</name>
            <comment>JUNOS runtime [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>junos-platform</name>
            <comment>JUNOS platform support [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>junos-modules</name>
            <comment>JUNOS modules [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>junos-libs</name>
            <comment>JUNOS libs [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>junos-dp-crypto-support-platform</name>
            <comment>JUNOS mtx Data Plane Crypto Support [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>junos-daemons</name>
            <comment>JUNOS daemons [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-voice</name>
            <comment>JUNOS Voice Services Container package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-ssl</name>
            <comment>JUNOS Services SSL [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-sfw</name>
            <comment>JUNOS Services Stateful Firewall [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-rpm</name>
            <comment>JUNOS Services RPM [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-ptsp</name>
            <comment>JUNOS Services PTSP Container package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-nat</name>
            <comment>JUNOS Services NAT [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-mss</name>
            <comment>JUNOS Services Mobile Subscriber Service Container package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-mobile</name>
            <comment>JUNOS Services MobileNext Software package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-llpdf</name>
            <comment>JUNOS Services LL-PDF Container package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-jflow</name>
            <comment>JUNOS Services Jflow Container package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-ipsec</name>
            <comment>JUNOS Services IPSec [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-idp</name>
            <comment>JUNOS IDP Services [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-hcm</name>
            <comment>JUNOS Services HTTP Content Management package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-crypto-base</name>
            <comment>JUNOS Services Crypto [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-cpcd</name>
            <comment>JUNOS Services Captive Portal and Content Delivery Container package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-cos</name>
            <comment>JUNOS Services COS [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-bgf</name>
            <comment>JUNOS Border Gateway Function package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-appid</name>
            <comment>JUNOS AppId Services [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-alg</name>
            <comment>JUNOS Services Application Level Gateways [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-aacl</name>
            <comment>JUNOS Services AACL Container package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jpfe-platform</name>
            <comment>JUNOS Packet Forwarding Engine Support (MX/EX92XX Common) [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jpfe-common</name>
            <comment>JUNOS Packet Forwarding Engine Support (M/T Common) [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jdocs</name>
            <comment>JUNOS Online Documentation [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>fips-mode</name>
            <comment>JUNOS FIPS mode utilities [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
    </software-information>
    <cli>
        <banner></banner>
    </cli>
</rpc-reply>
%

Log output from good output with workaround

2018/08/22 11:07:44 __main__ 109 - INFO: Begin running collection script
2018/08/22 11:07:44 __main__ 111 - INFO: Opening `data.yml` file
2018/08/22 11:07:44 __main__ 129 - INFO: Looping through devices
2018/08/22 11:07:44 __main__ 131 - INFO: ----------------------------------------
2018/08/22 11:07:44 __main__ 132 - INFO: Begin collection from device: mx240
2018/08/22 11:07:45 __main__ 155 - INFO: Attempting connection to mx240
2018/08/22 11:07:45 ncclient.transport.ssh 1687 - INFO: Connected (version 2.0, client OpenSSH_6.6.1)
2018/08/22 11:07:45 ncclient.transport.ssh 1687 - INFO: Auth banner: b'\n--------------------------------------------\n| This is box is for dev and testing  |\n|  WARNING:  UNAUTHORIZED USE OR TAMPERING |\n|  IS PROHIBITED. ALL            |\n|  TRANSACTIONS ARE MONITORED.            |\n--------------------------------------------\n'
2018/08/22 11:07:45 ncclient.transport.ssh 1687 - INFO: Authentication (publickey) failed.
2018/08/22 11:07:45 ncclient.transport.ssh 1687 - INFO: Authentication (password) successful!
2018/08/22 11:07:45 ncclient.transport.session 111 - INFO: initialized: session-id=83037 | server_capabilities=<dict_keyiterator object at 0x10d28af48>
2018/08/22 11:07:45 __main__ 157 - INFO: Opened SSH connection to mx240
2018/08/22 11:07:45 __main__ 169 - INFO: Opening Shell on device mx240
2018/08/22 11:07:45 paramiko.transport 1687 - INFO: Connected (version 2.0, client OpenSSH_6.6.1)
2018/08/22 11:07:46 paramiko.transport 1687 - INFO: Auth banner: b'\n--------------------------------------------\n| This is box is for dev and testing   |\n|    WARNING:  UNAUTHORIZED USE OR TAMPERING |\n|  IS PROHIBITED.  ALL            |\n|  TRANSACTIONS ARE MONITORED.            |\n--------------------------------------------\n'
2018/08/22 11:07:46 paramiko.transport 1687 - INFO: Authentication (publickey) failed.
2018/08/22 11:07:46 paramiko.transport 1687 - INFO: Authentication (password) successful!
sleep None
recv data: b'Last login: Wed Aug 22 11:03:24 2018 from 192.168.1.1\r\r\n'
sleep None
recv data: b'--- JUNOS 15.1R5-S3.4 Kernel 64-bit  JNPR-10.3-20160927.337663_build\r\n'
sleep None
recv data: b'myuser@mx240> '
send data: start shell
send data newline:
sleep None
recv data: b's'
sleep None
recv data: b'tart'
sleep None
recv data: b' s'
sleep None
recv data: b'hell'
sleep None
recv data: b' '
sleep None
recv data: b'\r\n'
sleep None
recv data: b'% '
2018/08/22 11:07:46 __main__ 173 - INFO: opening took 0.653170108795166 secs
2018/08/22 11:07:46 __main__ 174 - INFO: Connection opened
send data: cprod -A fpc0 -c "show jnh 0 pool"
send data newline:
sleep 0.05
recv data: b'cpr'
sleep 0.05
recv data: b'od -A fpc0 -c "show jnh 0 pool"\r\r\n\r\nPFE 0 JNH Partition is using Cassis-Alloc.\r\nPFE 0 JNH Partition OK check is enabled, requests 3442779\r\n                Name     MemType            Total         Used       (%)    Free       (%)\r\n\r\n            Next Hop     EDMEM               4194240       1454163  34%      2740077  66%\r\n\r\n            Firewall     EDMEM               2097152         41611   1%      2055541  99%\r\n\r\n            Counters     EDMEM               4194304       2251682  53%      1942622  47%\r\n\r\n                LMEM     LMEM                    128           128 100%            0   0%\r\n\r\n                HASH     EDMEM               7044608       7044608 100%            0   0%\r\n                         OMEM               33202208      33202208 100%            0   0%\r\n\r\n              ENCAPS     EDMEM               4259840       4259840 100%            0   0%\r\n\r\n          UEID_SPACE     EDMEM               1048576           130 < 1%      1048446 >99%\r\n\r\n   UEID_SHARED_SPACE     EDMEM                 65'
sleep 0.05
recv data: b'536             3 < 1%        65533 >99%\r\n% '    <<<<< RECV DATA INCLUDES END OF LINE CMD PROMPT
send data: echo $?
send data newline:
sleep 0.05
recv data: b'ec'
sleep 0.05
recv data: b'ho $?\r\r\n0\r\n% '
2018/08/22 11:07:46 __main__ 179 - INFO: (True, 'cprod -A fpc0 -c "show jnh 0 pool"\r\r\n\r\nPFE 0 JNH Partition is using Cassis-Alloc.\r\nPFE 0 JNH Partition OK check is enabled, requests 3442779\r\n                Name     MemType            Total         Used       (%)    Free       (%)\r\n\r\n            Next Hop     EDMEM               4194240       1454163  34%      2740077  66%\r\n\r\n            Firewall     EDMEM               2097152         41611   1%      2055541  99%\r\n\r\n            Counters     EDMEM               4194304       2251682  53%      1942622  47%\r\n\r\n                LMEM     LMEM                    128           128 100%            0   0%\r\n\r\n                HASH     EDMEM               7044608       7044608 100%            0   0%\r\n                         OMEM               33202208      33202208 100%            0   0%\r\n\r\n              ENCAPS     EDMEM               4259840       4259840 100%            0   0%\r\n\r\n          UEID_SPACE     EDMEM               1048576           130 < 1%      1048446 >99%\r\n\r\n   UEID_SHARED_SPACE     EDMEM                 65536             3 < 1%        65533 >99%\r\n% ')
cprod -A fpc0 -c "show jnh 0 pool"

PFE 0 JNH Partition is using Cassis-Alloc.
PFE 0 JNH Partition OK check is enabled, requests 3442779
                Name     MemType            Total         Used       (%)    Free       (%)

            Next Hop     EDMEM               4194240       1454163  34%      2740077  66%

            Firewall     EDMEM               2097152         41611   1%      2055541  99%

            Counters     EDMEM               4194304       2251682  53%      1942622  47%

                LMEM     LMEM                    128           128 100%            0   0%

                HASH     EDMEM               7044608       7044608 100%            0   0%
                         OMEM               33202208      33202208 100%            0   0%

              ENCAPS     EDMEM               4259840       4259840 100%            0   0%

          UEID_SPACE     EDMEM               1048576           130 < 1%      1048446 >99%

   UEID_SHARED_SPACE     EDMEM                 65536             3 < 1%        65533 >99%
% 
send data: cprod -A fpc1 -c "show jnh 0 pool"
send data newline:
sleep 0.05
recv data: b'cp'
sleep 0.05
recv data: b'rod -A fpc1 -c "show jnh 0 pool"\r\r\n\r\nPFE 0 JNH Partition is using Cassis-Alloc.\r\nPFE 0 JNH Partition OK check is enabled, requests 5083143\r\n                Name     MemType            Total         Used       (%)    Free       (%)\r\n\r\n            Next Hop     EDMEM               5242816       1455923  27%      3786893  73%\r\n\r\n            Firewall     EDMEM               2097152         41611   1%      2055541  99%\r\n\r\n            Counters     EDMEM               4194304       2251770  53%      1942534  47%\r\n\r\n                LMEM     LMEM                    128           128 100%            0   0%\r\n\r\n                HASH     EDMEM               7044608       7044608 100%            0   0%\r\n                         OMEM               33202208      33202208 100%            0   0%\r\n\r\n              ENCAPS     EDMEM               4259840       4259840 100%            0   0%\r\n\r\n          UEID_SPACE     EDMEM               1048576           129 < 1%      1048447 >99%\r\n\r\n   UEID_SHARED_SPACE     EDMEM                 6'
sleep 0.05
recv data: b'5536             2 < 1%        65534 >99%\r\n% '   <<<<< RECV DATA AGAIN INCLUDES END OF LINE CMD PROMPT
send data: echo $?
send data newline:
sleep 0.05
recv data: b'ec'
sleep 0.05
recv data: b'ho $?\r\r\n0\r\n% '
2018/08/22 11:07:47 __main__ 179 - INFO: (True, 'cprod -A fpc1 -c "show jnh 0 pool"\r\r\n\r\nPFE 0 JNH Partition is using Cassis-Alloc.\r\nPFE 0 JNH Partition OK check is enabled, requests 5083143\r\n                Name     MemType            Total         Used       (%)    Free       (%)\r\n\r\n            Next Hop     EDMEM               5242816       1455923  27%      3786893  73%\r\n\r\n            Firewall     EDMEM               2097152         41611   1%      2055541  99%\r\n\r\n            Counters     EDMEM               4194304       2251770  53%      1942534  47%\r\n\r\n                LMEM     LMEM                    128           128 100%            0   0%\r\n\r\n                HASH     EDMEM               7044608       7044608 100%            0   0%\r\n                         OMEM               33202208      33202208 100%            0   0%\r\n\r\n              ENCAPS     EDMEM               4259840       4259840 100%            0   0%\r\n\r\n          UEID_SPACE     EDMEM               1048576           129 < 1%      1048447 >99%\r\n\r\n   UEID_SHARED_SPACE     EDMEM                 65536             2 < 1%        65534 >99%\r\n% ')
cprod -A fpc1 -c "show jnh 0 pool"

PFE 0 JNH Partition is using Cassis-Alloc.
PFE 0 JNH Partition OK check is enabled, requests 5083143
                Name     MemType            Total         Used       (%)    Free       (%)

            Next Hop     EDMEM               5242816       1455923  27%      3786893  73%

            Firewall     EDMEM               2097152         41611   1%      2055541  99%

            Counters     EDMEM               4194304       2251770  53%      1942534  47%

                LMEM     LMEM                    128           128 100%            0   0%

                HASH     EDMEM               7044608       7044608 100%            0   0%
                         OMEM               33202208      33202208 100%            0   0%

              ENCAPS     EDMEM               4259840       4259840 100%            0   0%

          UEID_SPACE     EDMEM               1048576           129 < 1%      1048447 >99%

   UEID_SHARED_SPACE     EDMEM                 65536             2 < 1%        65534 >99%
% 
send data: cli -c "show version | display xml | no-more"
send data newline:
sleep 0.05
recv data: b'cli'
sleep 0.05
recv data: b' -c "show version | display xml | no-more"\r\r\n'
sleep 0.05
recv data: b'<rpc-reply xmlns:junos="http://xml.juniper.net/junos/15.1R5/junos">\r\n    <software-information>\r\n        <host-name>mx240</host-name>\r\n        <product-model>mx240</product-model>\r\n        <product-name>mx240</product-name>\r\n        <junos-version>15.1R5-S3.4</junos-version>\r\n        <package-information>\r\n            <name>os-kernel</name>\r\n            <comment>JUNOS OS Kernel 64-bit  [20160927.337663_builder_stable_10]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>os-libs</name>\r\n            <comment>JUNOS OS libs [20160927.337663_builder_stable_10]</comment>\r\n        </package-information>\r\n'
sleep 0.05
recv data: b'        <package-information>\r\n            <name>os-runtime</name>\r\n            <comment>JUNOS OS runtime [20160927.337663_builder_stable_10]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>zoneinfo</name>\r\n            <comment>JUNOS OS time zone information [20160927.337663_builder_stable_10]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>os-libs-compat32</name>\r\n            <comment>JUNOS OS libs compat32 [20160927.337663_builder_stable_10]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>os-compat32</name>\r\n            <comment>JUNOS OS 32-bit compatibility [20160927.337663_builder_stable_10]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>py-base</name>\r\n            <comment>JUNOS py base [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>os-crypto</n'
sleep 0.05
recv data: b'ame>\r\n            <comment>JUNOS OS crypto [20160927.337663_builder_stable_10]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>netstack</name>\r\n            <comment>JUNOS network stack and utilities [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>junos-libs-compat32</name>\r\n            <comment>JUNOS libs compat32 [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>junos-runtime</name>\r\n            <comment>JUNOS runtime [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>junos-platform</name>\r\n            <comment>JUNOS platform support [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>junos-modules</name>\r\n            <comment>JUNOS mod'
sleep 0.05
recv data: b'ules [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>junos-libs</name>\r\n            <comment>JUNOS libs [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>junos-dp-crypto-support-platform</name>\r\n            <comment>JUNOS mtx Data Plane Crypto Support [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>junos-daemons</name>\r\n            <comment>JUNOS daemons [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-voice</name>\r\n            <comment>JUNOS Voice Services Container package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-ssl</name>\r\n            <comment>JUNOS Services S'
sleep 0.05
recv data: b'SL [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-sfw</name>\r\n            <comment>JUNOS Services Stateful Firewall [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-rpm</name>\r\n            <comment>JUNOS Services RPM [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-ptsp</name>\r\n            <comment>JUNOS Services PTSP Container package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-nat</name>\r\n            <comment>JUNOS Services NAT [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-mss</name>\r\n            <comment>JUNOS Services Mobile Subs'
sleep 0.05
recv data: b'criber Service Container package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-mobile</name>\r\n            <comment>JUNOS Services MobileNext Software package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-llpdf</name>\r\n            <comment>JUNOS Services LL-PDF Container package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-jflow</name>\r\n            <comment>JUNOS Services Jflow Container package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-ipsec</name>\r\n            <comment>JUNOS Services IPSec [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <na'
sleep 0.05
recv data: b'me>jservices-idp</name>\r\n            <comment>JUNOS IDP Services [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-hcm</name>\r\n            <comment>JUNOS Services HTTP Content Management package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-crypto-base</name>\r\n            <comment>JUNOS Services Crypto [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-cpcd</name>\r\n            <comment>JUNOS Services Captive Portal and Content Delivery Container package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-cos</name>\r\n            <comment>JUNOS Services COS [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n'
sleep 0.05
recv data: b'        <package-information>\r\n            <name>jservices-bgf</name>\r\n            <comment>JUNOS Border Gateway Function package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-appid</name>\r\n            <comment>JUNOS AppId Services [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-alg</name>\r\n            <comment>JUNOS Services Application Level Gateways [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-aacl</name>\r\n            <comment>JUNOS Services AACL Container package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jpfe-platform</name>\r\n            <comment>JUNOS Packet Forwarding Engine Support (MX/EX92XX Common) [20170406.144034_builder'
sleep 0.05
recv data: b'_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jpfe-common</name>\r\n            <comment>JUNOS Packet Forwarding Engine Support (M/T Common) [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jdocs</name>\r\n            <comment>JUNOS Online Documentation [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>fips-mode</name>\r\n            <comment>JUNOS FIPS mode utilities [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n    </software-information>\r\n    <cli>\r\n        <banner></banner>\r\n    </cli>\r\n</rpc-reply>\r\n% '
send data: echo $?
send data newline:
sleep 0.05
recv data: b'ec'
sleep 0.05
recv data: b'ho $?\r\r\n0\r\n% '
2018/08/22 11:07:48 __main__ 179 - INFO: (True, 'cli -c "show version | display xml | no-more"\r\r\n<rpc-reply xmlns:junos="http://xml.juniper.net/junos/15.1R5/junos">\r\n    <software-information>\r\n        <host-name>mx240</host-name>\r\n        <product-model>mx240</product-model>\r\n        <product-name>mx240</product-name>\r\n        <junos-version>15.1R5-S3.4</junos-version>\r\n        <package-information>\r\n            <name>os-kernel</name>\r\n            <comment>JUNOS OS Kernel 64-bit  [20160927.337663_builder_stable_10]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>os-libs</name>\r\n            <comment>JUNOS OS libs [20160927.337663_builder_stable_10]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>os-runtime</name>\r\n            <comment>JUNOS OS runtime [20160927.337663_builder_stable_10]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>zoneinfo</name>\r\n            <comment>JUNOS OS time zone information [20160927.337663_builder_stable_10]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>os-libs-compat32</name>\r\n            <comment>JUNOS OS libs compat32 [20160927.337663_builder_stable_10]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>os-compat32</name>\r\n            <comment>JUNOS OS 32-bit compatibility [20160927.337663_builder_stable_10]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>py-base</name>\r\n            <comment>JUNOS py base [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>os-crypto</name>\r\n            <comment>JUNOS OS crypto [20160927.337663_builder_stable_10]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>netstack</name>\r\n            <comment>JUNOS network stack and utilities [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>junos-libs-compat32</name>\r\n            <comment>JUNOS libs compat32 [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>junos-runtime</name>\r\n            <comment>JUNOS runtime [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>junos-platform</name>\r\n            <comment>JUNOS platform support [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>junos-modules</name>\r\n            <comment>JUNOS modules [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>junos-libs</name>\r\n            <comment>JUNOS libs [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>junos-dp-crypto-support-platform</name>\r\n            <comment>JUNOS mtx Data Plane Crypto Support [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>junos-daemons</name>\r\n            <comment>JUNOS daemons [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-voice</name>\r\n            <comment>JUNOS Voice Services Container package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-ssl</name>\r\n            <comment>JUNOS Services SSL [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-sfw</name>\r\n            <comment>JUNOS Services Stateful Firewall [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-rpm</name>\r\n            <comment>JUNOS Services RPM [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-ptsp</name>\r\n            <comment>JUNOS Services PTSP Container package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-nat</name>\r\n            <comment>JUNOS Services NAT [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-mss</name>\r\n            <comment>JUNOS Services Mobile Subscriber Service Container package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-mobile</name>\r\n            <comment>JUNOS Services MobileNext Software package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-llpdf</name>\r\n            <comment>JUNOS Services LL-PDF Container package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-jflow</name>\r\n            <comment>JUNOS Services Jflow Container package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-ipsec</name>\r\n            <comment>JUNOS Services IPSec [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-idp</name>\r\n            <comment>JUNOS IDP Services [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-hcm</name>\r\n            <comment>JUNOS Services HTTP Content Management package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-crypto-base</name>\r\n            <comment>JUNOS Services Crypto [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-cpcd</name>\r\n            <comment>JUNOS Services Captive Portal and Content Delivery Container package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-cos</name>\r\n            <comment>JUNOS Services COS [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-bgf</name>\r\n            <comment>JUNOS Border Gateway Function package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-appid</name>\r\n            <comment>JUNOS AppId Services [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-alg</name>\r\n            <comment>JUNOS Services Application Level Gateways [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jservices-aacl</name>\r\n            <comment>JUNOS Services AACL Container package [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jpfe-platform</name>\r\n            <comment>JUNOS Packet Forwarding Engine Support (MX/EX92XX Common) [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jpfe-common</name>\r\n            <comment>JUNOS Packet Forwarding Engine Support (M/T Common) [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>jdocs</name>\r\n            <comment>JUNOS Online Documentation [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n        <package-information>\r\n            <name>fips-mode</name>\r\n            <comment>JUNOS FIPS mode utilities [20170406.144034_builder_junos_151_r5_s3]</comment>\r\n        </package-information>\r\n    </software-information>\r\n    <cli>\r\n        <banner></banner>\r\n    </cli>\r\n</rpc-reply>\r\n% ')
cli -c "show version | display xml | no-more"

<rpc-reply xmlns:junos="http://xml.juniper.net/junos/15.1R5/junos">
    <software-information>
        <host-name>mx240</host-name>
        <product-model>mx240</product-model>
        <product-name>mx240</product-name>
        <junos-version>15.1R5-S3.4</junos-version>
        <package-information>
            <name>os-kernel</name>
            <comment>JUNOS OS Kernel 64-bit  [20160927.337663_builder_stable_10]</comment>
        </package-information>
        <package-information>
            <name>os-libs</name>
            <comment>JUNOS OS libs [20160927.337663_builder_stable_10]</comment>
        </package-information>
        <package-information>
            <name>os-runtime</name>
            <comment>JUNOS OS runtime [20160927.337663_builder_stable_10]</comment>
        </package-information>
        <package-information>
            <name>zoneinfo</name>
            <comment>JUNOS OS time zone information [20160927.337663_builder_stable_10]</comment>
        </package-information>
        <package-information>
            <name>os-libs-compat32</name>
            <comment>JUNOS OS libs compat32 [20160927.337663_builder_stable_10]</comment>
        </package-information>
        <package-information>
            <name>os-compat32</name>
            <comment>JUNOS OS 32-bit compatibility [20160927.337663_builder_stable_10]</comment>
        </package-information>
        <package-information>
            <name>py-base</name>
            <comment>JUNOS py base [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>os-crypto</name>
            <comment>JUNOS OS crypto [20160927.337663_builder_stable_10]</comment>
        </package-information>
        <package-information>
            <name>netstack</name>
            <comment>JUNOS network stack and utilities [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>junos-libs-compat32</name>
            <comment>JUNOS libs compat32 [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>junos-runtime</name>
            <comment>JUNOS runtime [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>junos-platform</name>
            <comment>JUNOS platform support [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>junos-modules</name>
            <comment>JUNOS modules [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>junos-libs</name>
            <comment>JUNOS libs [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>junos-dp-crypto-support-platform</name>
            <comment>JUNOS mtx Data Plane Crypto Support [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>junos-daemons</name>
            <comment>JUNOS daemons [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-voice</name>
            <comment>JUNOS Voice Services Container package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-ssl</name>
            <comment>JUNOS Services SSL [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-sfw</name>
            <comment>JUNOS Services Stateful Firewall [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-rpm</name>
            <comment>JUNOS Services RPM [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-ptsp</name>
            <comment>JUNOS Services PTSP Container package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-nat</name>
            <comment>JUNOS Services NAT [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-mss</name>
            <comment>JUNOS Services Mobile Subscriber Service Container package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-mobile</name>
            <comment>JUNOS Services MobileNext Software package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-llpdf</name>
            <comment>JUNOS Services LL-PDF Container package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-jflow</name>
            <comment>JUNOS Services Jflow Container package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-ipsec</name>
            <comment>JUNOS Services IPSec [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-idp</name>
            <comment>JUNOS IDP Services [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-hcm</name>
            <comment>JUNOS Services HTTP Content Management package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-crypto-base</name>
            <comment>JUNOS Services Crypto [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-cpcd</name>
            <comment>JUNOS Services Captive Portal and Content Delivery Container package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-cos</name>
            <comment>JUNOS Services COS [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-bgf</name>
            <comment>JUNOS Border Gateway Function package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-appid</name>
            <comment>JUNOS AppId Services [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-alg</name>
            <comment>JUNOS Services Application Level Gateways [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jservices-aacl</name>
            <comment>JUNOS Services AACL Container package [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jpfe-platform</name>
            <comment>JUNOS Packet Forwarding Engine Support (MX/EX92XX Common) [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jpfe-common</name>
            <comment>JUNOS Packet Forwarding Engine Support (M/T Common) [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>jdocs</name>
            <comment>JUNOS Online Documentation [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
        <package-information>
            <name>fips-mode</name>
            <comment>JUNOS FIPS mode utilities [20170406.144034_builder_junos_151_r5_s3]</comment>
        </package-information>
    </software-information>
    <cli>
        <banner></banner>
    </cli>
</rpc-reply>
% 
2018/08/22 11:07:48 ncclient.operations.rpc 313 - INFO: Requesting 'CloseSession'
2018/08/22 11:07:48 __main__ 230 - INFO: Creating a Zip archive of outputs...
2018/08/22 11:07:48 __main__ 233 - INFO: Done

Process finished with exit code 0
vnitinv commented 5 years ago

@mmellin For vty command please use dev.rpc.request_pfe_execute(target=\<fpc>, command="show jnh 0 pool")