Executing Device-Connection Debug Scripts
You execute the device-connection debug scripts to view information about device-connection issues related to Junos Space nodes and devices connected to these nodes. Device-connection scripts are stored at the following location: /var/log/space-debug/debug-utilities/deviceConnection. When you execute these scripts, the output is stored as .txt files at the same location. You can also specify a custom path to store the output. The following sections list the steps to execute the scripts to collect information about device-connection issues.
Executing the Script to Collect Device-Connection Information
You execute the getDeviceInfo.sh
script to
collect device-connection information of a device.
To execute the script to collect device-connection information:
- Log in to the CLI of the Junos Space node.
- Enter the administrator username and password at the Junos
Space login prompt and press Enter.
The default username is admin and the default password is abc123.
The Junos Space Settings Menu is displayed.
- Enter 6 (if you are using a
hardware appliance) or 7 (if you are using
a virtual appliance) at the Junos Space Settings Menu prompt to run
shell commands.
You are prompted to enter your password.
The following is a sample output from a virtual appliance:
admin@10.206.41.183's password: Last login: Mon Aug 17 06:17:58 2015 from 10.206.41.42 Welcome to the Junos Space network settings utility. Initializing, please wait Junos Space Settings Menu 1> Change Password 2> Change Network Settings 3> Change Time Options 4> Retrieve Logs 5> Security 6> Expand VM Drive Size 7> (Debug) run shell A> Apply changes Q> Quit R> Redraw Menu Choice [1-7,AQR]: 7
- Type the administrator password and press Enter.
The shell prompt appears.
- Type
cd /var/log/space-debug/debug-utilities/deviceConnection
at the shell prompt and press Enter. - (Optional) To view the list of debug scripts, type
ls
and press Enter.The list of device-connection debug scripts is displayed.
- Type
./getDeviceInfo.sh<device-IP address>
and press Enter—for example, ./getDeviceInfo.sh 10.206.33.17.The output of this command is saved to the DeviceInfo-<device-IP address>.txt file in the same directory.
The following is a sample output:
------------------------------------------------------------ Time of execution: Wed Jul 15 05:45:26 UTC 2015 ------------------------------------------------------------ Device Id: 131153 Device Ip: 10.206.33.17 Node id: 10.206.41.57 Connection state: Connected Connection changed at: 07/14/2015 17:35:04 EditFlag : false EditChannel num:0 SSH ctrl channel num: 4 Max channels allowed: 32 Number of channels opened: 4 ------------------------------------------------------- Channel details: Channel Id: 1 Seq num: 11 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 2 Seq num: 14 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 3 Seq num: 22 Channel state: CHANNEL_STATE_OPEN Channel type: Syslog ------------------------------------------------------- Channel Id: 4 Seq num: 24 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf -------------------------------------------------------
- (Optional) To save node connection information at a custom
output location, type
./getDeviceInfo.sh<device-IP address> <output-file-path>
and press Enter.
You can use the information from the .txt file to debug device-connection issues.
Executing the Script to Collect Device Debug Information
You execute the DeviceDebugInfoCollector.sh
script to collect information about the connections and processes
on a device.
To execute the script to collect device debug information:
- Log in to the CLI of the Junos Space node.
- Enter the administrator username and password at the Junos
Space login prompt and press Enter.
The default username is admin and the default password is abc123.
The Junos Space Settings Menu is displayed.
- Enter 6 (if you are using a
hardware appliance) or 7 (if you are using
a virtual appliance) at the Junos Space Settings Menu prompt to run
shell commands.
You are prompted to enter your password.
- Type the administrator password and press Enter.
The shell prompt appears.
- Type
cd /var/log/space-debug/debug-utilities/deviceConnection
at the shell prompt and press Enter. - (Optional) To view the list of debug scripts, type
ls
.The list of device-connection debug scripts is displayed.
- Type
./DeviceDebugInfoCollector.sh<device-IP address><device-username><node-VIP address>
and press Enter—for example,./DeviceDebugInfoCollector.sh 10.206.32.107 user1 10.206.41.57
.. - Enter the device password.
The output from this command is saved to the DeviceDebugInfo-<device-IP address>.txt file in the same directory.
The following is a sample output:
Time of execution: Wed Jul 15 07:43:43 UTC 2015 ======================================================================================================== List of MGD processes on the device : (Command Executed - ps auxwww | sed -n "1p; /sed -n/d; /mgd/p;") ======================================================================================================== USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND user1 1841 0.0 0.0 41132 236 ?? S Fri12AM 0:10.15 /usr/sbin/mgd -N user1 2310 0.0 0.0 41180 220 ?? S Fri12AM 0:06.62 mgd: (mgd) (user1) (mgd) user1 2367 0.0 0.0 41180 220 ?? S Fri12AM 0:06.67 mgd: (mgd) (user1) (mgd) user1 2424 0.0 0.0 41188 220 ?? S Fri12AM 0:06.54 mgd: (mgd) (keybased) (mgd) user1 4243 0.0 0.1 41180 520 ?? S 12:27AM 0:02.90 mgd: (mgd) (user1) (mgd) user1 7662 0.0 0.1 41180 520 ?? S 2:29AM 0:02.84 mgd: (mgd) (user1) (mgd) user1 8595 0.0 0.2 41192 1664 ?? Is 4:09AM 0:00.07 mgd: (mgd) (user1)/dev/ttyp2 (mgd) user1 9065 0.0 0.0 41192 136 ?? Is 4:39AM 0:00.05 mgd: (mgd) (user1)/dev/ttyp1 (mgd) user1 10295 0.0 0.1 41180 520 ?? S 6:12AM 0:02.67 mgd: (mgd) (user1) (mgd) user1 11557 0.0 0.1 41180 520 ?? S 8:03AM 0:02.66 mgd: (mgd) (user1) (mgd) user1 15817 0.0 0.1 41180 520 ?? S 3:26PM 0:02.34 mgd: (mgd) (user1) (mgd) user1 18495 0.0 0.1 41180 520 ?? S 8:16PM 0:02.13 mgd: (mgd) (user1) (mgd) user1 18549 0.0 0.1 41180 520 ?? S 8:20PM 0:02.13 mgd: (mgd) (user1) (mgd) user1 18907 0.0 0.1 41180 520 ?? S 8:22PM 0:02.14 mgd: (mgd) (user1) (mgd) user1 19574 0.0 3.3 41180 25220 ?? S 8:38PM 0:02.11 mgd: (mgd) (user1) (mgd) user1 20290 0.0 0.6 41172 4876 ?? Is 9:46PM 0:00.10 mgd: (mgd) (user1)/dev/ttyp0 (mgd) user1 20794 0.0 3.3 41180 25228 ?? S 9:52PM 0:02.06 mgd: (mgd) (user1) (mgd) user1 21861 0.0 0.0 41180 220 ?? S Fri09PM 0:05.93 mgd: (mgd) (user1) (mgd) user1 50416 0.0 0.1 41180 520 ?? S Sun08AM 0:04.53 mgd: (mgd) (user1) (mgd) user1 63963 0.0 0.1 41180 520 ?? S Sun08PM 0:04.06 mgd: (mgd) (user1) (mgd) user1 84282 0.0 0.1 41180 520 ?? S Mon10AM 0:03.55 mgd: (mgd) (user1) (mgd) ================================================================================================================= List of active sshd processes on the device : (Command Executed - ps auxwww | sed -n "1p; /sed -n/d; /sshd/p;") ================================================================================================================= USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND user1 20972 1.7 0.4 7684 2916 ?? Ss 10:11PM 0:00.15 sshd: user1@notty (sshd) user1 1944 0.0 0.1 7784 692 ?? Ss Fri12AM 1:00.95 sshd: user1@notty (sshd) user1 2354 0.0 0.1 7816 700 ?? Ss Fri12AM 1:00.21 sshd: user1@notty (sshd) user1 2378 0.0 0.1 7820 700 ?? Ss Fri12AM 1:00.39 sshd: keybased@notty (sshd) user1 3907 0.0 0.1 7784 772 ?? Ss 12:27AM 0:10.47 sshd: user1@notty (sshd) user1 5334 0.0 0.0 7676 320 ?? Is 1:25AM 0:00.30 sshd: user1@ttyp1 (sshd) user1 5361 0.0 0.1 7676 476 ?? Is 1:26AM 0:00.25 sshd: user1@ttyp2 (sshd) user1 7649 0.0 0.1 7784 776 ?? Ss 2:29AM 0:07.62 sshd: user1@notty (sshd) user1 10284 0.0 0.1 7784 468 ?? Ss 6:11AM 0:02.11 sshd: user1@notty (sshd) user1 11544 0.0 0.1 7784 776 ?? Ss 8:03AM 0:04.69 sshd: user1@notty (sshd) user1 15806 0.0 0.1 7784 788 ?? Ss 3:26PM 0:03.38 sshd: user1@notty (sshd) user1 18484 0.0 0.1 7784 792 ?? Ss 8:16PM 0:02.99 sshd: user1@notty (sshd) user1 18538 0.0 0.1 7784 776 ?? Ss 8:20PM 0:03.47 sshd: user1@notty (sshd) user1 18896 0.0 0.1 7796 784 ?? Ss 8:22PM 0:02.89 sshd: user1@notty (sshd) user1 19561 0.0 0.4 7784 2924 ?? Ss 8:38PM 0:02.41 sshd: user1@notty (sshd) user1 20272 0.0 0.4 7684 2900 ?? Is 9:46PM 0:00.26 sshd: user1@ttyp0 (sshd) user1 20783 0.0 0.4 7796 2932 ?? Ss 9:52PM 0:00.52 sshd: user1@notty (sshd) user1 21820 0.0 0.1 7800 696 ?? S Fri09PM 0:47.90 sshd: user1@notty (sshd) user1 50401 0.0 0.1 7784 776 ?? Ss Sun08AM 0:36.25 sshd: user1@notty (sshd) user1 63919 0.0 0.1 7796 784 ?? Ss Sun08PM 0:34.21 sshd: user1@notty (sshd) user1 84233 0.0 0.1 7784 776 ?? Ss Mon10AM 0:20.37 sshd: user1@notty (sshd) ============================================================================================================================== List of open SSH connections to 10.206.41.57 from the device : (Command Executed - netstat -tln | egrep "Pro|\.7804"; netstat -tln | grep "\.22"). Please note that of the listed connections, one is opened by this debug script to collect the debug information from the device ============================================================================================================================== Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp4 0 0 10.206.32.107.22 10.206.41.57.43098 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.206.41.57.33080 ESTABLISHED ================================================================================================================= List of open SSH connections on the device : (Command Executed - netstat -tln | egrep "Pro|\.7804"; netstat -tln grep "\.22") ================================================================================================================= Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp4 0 0 10.206.32.107.58052 10.206.41.46.7804 SYN_SENT tcp4 0 0 10.206.32.107.53398 10.206.41.192.7804 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.206.41.57.43098 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.206.41.62.60026 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.206.155.85.62406 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.206.41.143.39926 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.207.70.104.36730 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.206.41.171.52993 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.206.41.33.45765 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.206.41.211.50000 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.206.41.57.33080 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.206.41.156.49032 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.206.40.4.38068 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.206.41.240.61583 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.206.41.240.61569 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.206.41.149.60804 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.206.41.235.59358 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.206.41.231.34530 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.206.41.221.48186 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.205.56.82.41163 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.161.11.161.42174 ESTABLISHED tcp4 0 0 10.206.32.107.22 10.206.41.71.47831 ESTABLISHED
- (Optional) To save device debug connection information
at a custom output location, type
./DeviceDebugInfoCollector.sh<device-IP address> <device-username> <node-VIP address> <output-file-path>
and press Enter..
You can use the information from the .txt file to debug issues related to the connections and processes on the device.
Executing the Script to Unlock the Device Configuration
You execute the cleanupEditChannel.sh
script
to unlock the device configuration.
To execute the script to unlock the device configuration:
- Log in to the CLI of the Junos Space node.
- Enter the administrator username and password at the Junos
Space login prompt and press Enter.
The default username is admin and the default password is abc123.
The Junos Space Settings Menu is displayed.
- Enter 6 (if you are using a
hardware appliance) or 7 (if you are using
a virtual appliance) at the Junos Space Settings Menu prompt to run
shell commands.
You are prompted to enter your password.
- Type the administrator password and press Enter.
The shell prompt appears.
- Type
cd /var/log/space-debug/debug-utilities/deviceConnection
at the shell prompt and press Enter. - (Optional) To view the list of debug scripts, type
ls
and press Enter.The list of device-connection debug scripts is displayed.
- Type
./cleanupEditChannel.sh <device-IP address>false
and press Enter—for example,./cleanupEditChannel.sh 10.206.33.17 false
.You can modify the configuration on the device from the Junos Space user interface.
Executing the Script to Collect Node-Connection Information
You execute the getAllDeviceInfo.sh
script
to collect information about devices connected to a Junos Space node.
You can also execute the script to collect information about devices
connected to all the nodes in your Junos Space setup.
To execute the script to collect node-connection information:
- Log in to the CLI of the Junos Space node.
- Enter the administrator username and password at the Junos
Space login prompt and press Enter.
The default username is admin and the default password is abc123.
The Junos Space Settings Menu is displayed.
- Enter 6 (if you are using a
hardware appliance) or 7 (if you are using
a virtual appliance) at the Junos Space Settings Menu prompt to run
shell commands.
You are prompted to enter your password.
- Type the administrator password and press Enter.
The shell prompt appears.
- Type
cd /var/log/space-debug/debug-utilities/deviceConnection
at the shell prompt and press Enter. - (Optional) To view the list of debug scripts, type
ls
and press Enter. - Type
./getAllDeviceInfo.sh <node-VIP address>
and press Enter—for example,./getAllDeviceInfo.sh 10.206.41.57
.The output from this command is saved to the DeviceInfoOutput.txt file in the same directory.
The following is a sample output:
------------------------------------------------------------ Time of execution: Wed Jul 15 05:35:21 UTC 2015 ------------------------------------------------------------ Device Id: 131129 Device Ip: 10.206.32.107 Node id: 10.206.41.57 Connection state: Connected Connection changed at: 07/14/2015 17:35:04 EditFlag : false EditChannel num:0 SSH ctrl channel num: 6 Max channels allowed: 32 Number of channels opened: 6 ------------------------------------------------------- Channel details: Channel Id: 1 Seq num: 10 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 2 Seq num: 16 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 3 Seq num: 21 Channel state: CHANNEL_STATE_OPEN Channel type: Syslog ------------------------------------------------------- Channel Id: 4 Seq num: 23 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 5 Seq num: 110 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 6 Seq num: 112 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- ======================================================= Device Id: 131153 Device Ip: 10.206.33.17 Node id: 10.206.41.57 Connection state: Connected Connection changed at: 07/14/2015 17:35:04 EditFlag : false EditChannel num:0 SSH ctrl channel num: 4 Max channels allowed: 32 Number of channels opened: 4 ------------------------------------------------------- Channel details: Channel Id: 1 Seq num: 11 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 2 Seq num: 14 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 3 Seq num: 22 Channel state: CHANNEL_STATE_OPEN Channel type: Syslog ------------------------------------------------------- Channel Id: 4 Seq num: 24 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- ======================================================= Device Id: 131233 Device Ip: 127.0.0.1 Node id: 10.206.41.57 Connection state: Connected Connection changed at: 07/14/2015 17:35:17 EditFlag : false EditChannel num:0 SSH ctrl channel num: 13 Max channels allowed: 32 Number of channels opened: 7 ------------------------------------------------------- Channel details: Channel Id: 1 Seq num: 26 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 2 Seq num: 27 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 3 Seq num: 28 Channel state: CHANNEL_STATE_OPEN Channel type: Syslog ------------------------------------------------------- Channel Id: 4 Seq num: 102 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 5 Seq num: 103 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 6 Seq num: 113 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 7 Seq num: 114 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- ======================================================= Device Id: 131149 Device Ip: 10.206.40.1 Node id: 10.206.41.57 Connection state: Connected Connection changed at: 07/14/2015 17:35:03 EditFlag : false EditChannel num:0 SSH ctrl channel num: 5 Max channels allowed: 32 Number of channels opened: 5 ------------------------------------------------------- Channel details: Channel Id: 1 Seq num: 9 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 2 Seq num: 15 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 3 Seq num: 20 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 4 Seq num: 25 Channel state: CHANNEL_STATE_OPEN Channel type: Syslog ------------------------------------------------------- Channel Id: 5 Seq num: 29 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- ======================================================= Device Id: 131121 Device Ip: 10.206.32.186 Node id: 10.206.41.57 Connection state: Connected Connection changed at: 07/14/2015 17:35:03 EditFlag : false EditChannel num:0 SSH ctrl channel num: 3 Max channels allowed: 32 Number of channels opened: 6 ------------------------------------------------------- Channel details: Channel Id: 1 Seq num: 8 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 2 Seq num: 17 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 3 Seq num: 18 Channel state: CHANNEL_STATE_OPEN Channel type: Syslog ------------------------------------------------------- Channel Id: 4 Seq num: 19 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 5 Seq num: 109 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- Channel Id: 6 Seq num: 111 Channel state: CHANNEL_STATE_UNUSE Channel type: Netconf ------------------------------------------------------- =======================================================
- (Optional) To save node connection information at a custom
output location, type
./getAllDeviceInfo.sh <node-VIP address> <output-file-path>
and press Enter. - (Optional) To view connection information across all nodes,
type
./getAllDeviceInfo.sh ALL-NODES
and press Enter.
You can use the information from the .txt file to debug issues related to devices connected to a single or multiple Junos Space nodes.