2001 - Device connection errors

Overview

When rConfig downloads configurations from devices it calls a script in the core of rConfig called showCmdScript.php. This script is used when scheduled tasks are run. When you create a scheduled task an random 6 digit ID is created and this number is added as a parameter when the above script is called to identify which devices to download from and what commands to run.

There will be times when connecting to devices will fail from rConfig, or when specific types of commands cannot be downloaded. A debug option is built-in to the connection script to assist in troubleshooting the issue. It is advised however that you carry out normal device troubleshooting first. i.e. ping from the rConfig server to the device, trace route, and telnet or SSH connectivity tests direct from the SSH console to test basic connectivity or authentication issues. Most issues should be resolved once these test have been carried out and you can identify an issue. If you are still unable to see whats going on let's get the script to tell us.

Please make sure 'Device Debugging' is enabled on the settiongs page in your rConfig installation before you begin. Turn this off when you are finished.

Alt text

First thing you will need to get is the job/ scheduled task ID. You can get this from the rConfig Scheduled Tasks webpage, by clicking on a task and then click the 'View Scheduled Task' button. You can get the 'Task ID' from here. Another way to get the full command output for a given task is to check CRONTAB on the rConfig console. SSH to the rConfig server, and run the following command. You need to sudo to the apache account as this the account that generates the rConfig CRON tasks when created from the Scheduled Tasks webpage.

[root@rconfig ~]# sudo -u apache crontab -l
#339104 - Download All Firewall Configurations
#339104 - Download Firewall Every Day
0 0 * * * php /home/rconfig/lib/showCmdScript.php 339104
#350278 - Download All Router Configurations
#350278 - Download Routers Every 5 mins
0 0 * * 0 php /home/rconfig/lib/showCmdScript.php 350278
#983248 - Config Comparison 1
#983248 - Config Comparison 1
0 0 1,15 * * php /home/rconfig/lib/compareReportScript.php 983248

You can run the selected task without the debug parameter just by copying and pasting the command including the Task ID back into the console. i.e

[root@rconfig ~]# php /home/rconfig/lib/showCmdScript.php 339104
PHP Warning:  fsockopen(): unable to connect to 192.168.137.25:23 (No route to host) in /home/rconfig/classes/connection.class.php on line 65
Failure: Unable to connect to router1.domain.com - 192.168.137.25 when running taskID 339104 - in  Error:(File: /home/rconfig/lib/showCmdScript.php)

The above errors say that rConfig is unable to telnet to the required device. (The HTTP_HOST error is normal and maybe fixed in later versions [resolved]). Now, lets see a working example of the above where the device is reachable.

[root@rconfig ~]# php /home/rconfig/lib/showCmdScript.php 339104
Success: Connected to router1.domain.com (192.168.137.25) for taskID 339104 - in (File: /home/rconfig/lib/showCmdScript.php)
PHP Notice:  Undefined variable: i in /home/rconfig/lib/showCmdScript.php on line 151
[root@rconfig ~]#

Again the above 'Undefined variable' can safely be ignored [resolved in version 1.2.4]. But, note the success this time. Now we are going to add the 'true' parameter to the script to see the actual output of the telnet session.

This time, with the 'true' keyword we get the actual telnet/SSH session output. i.e. login, commands run, and output returned. This will greatly assist in troubelshooting any issues.

[root@rconfig ~]# php /home/rconfig/lib/showCmdScript.php 339104 true
Success: Connected to router1.domain.com (192.168.137.25) for taskID 339104 - in (File: /home/rconfig/lib/showCmdScript.php)
PHP Notice:  Undefined variable: i in /home/rconfig/lib/showCmdScript.php on line 151 [resolved in version 1.2.4]
sho ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is 192.168.1.2 to network 0.0.0.0

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
C    192.168.137.0/24 is directly connected, FastEthernet1/0
     192.168.1.0/30 is subnetted, 2 subnets
C       192.168.1.0 is directly connected, FastEthernet0/0
C       192.168.1.4 is directly connected, FastEthernet0/1
S*   0.0.0.0/0 [1/0] via 192.168.1.2
R1#show running-config
Building configuration...

Current configuration : 1285 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
!
no ip domain lookup
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
ip sla monitor 10
 type pathEcho protocol ipIcmpEcho 4.4.4.4 source-ipaddr 1.1.1.1
 frequency 10
 samples-of-history-kept 10
ip sla monitor schedule 10 life forever start-time now
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
username cisco privilege 15 password 0 cisco
!
!         
!
track 10 rtr 10
! 
!
!
!
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
 description *** CONN to R2
 ip address 192.168.1.1 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/1
 description *** CONN to R3 ***
 ip address 192.168.1.5 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet1/0
 ip address 192.168.137.25 255.255.255.0
 duplex auto
 speed auto
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 192.168.1.6 name BACKUP_PATH track 10
ip route 0.0.0.0 0.0.0.0 192.168.1.2
!
!
ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
!
!
!
!
!         
!
!
!
line con 0
line aux 0
line vty 0 4
 privilege level 15
 login local
!
!
end

R1#show cdp ne
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
R1#[root@rconfig ~]#