[racktables-users] Re: Cannot import vlan or cdp from a switch

  • From: Denis Ovsienko <infrastation@xxxxxxxxx>
  • To: racktables-users@xxxxxxxxxxxxx
  • Date: Sat, 14 May 2011 18:54:51 +0400

09.05.2011, 21:07, "Julien BRETON" <julienbreton@xxxxxxx>:
> Thanks.
> The problem is that i do not have any idea on how to debug, unfortunately my
> programmer skills are very basics.
>
> I check the /tmp folder, where the session apparently are stored, but all
> the files are empty, which I believe, is not normal.
>
> Any tracks on how to start the debug ?

These is a patch file attached, which makes the shell script reading the 
password file generate debug messages. I suggest changing the "line" and 
"enable" passwords on the switch in question to something less valueable for 
the time of debugging.

Once the file is patched and you have tried to pull, for instance, LLDP status 
from the switch and see the password error, look into the debug file to see 
what exactly was read from the password file and what the .

-- 
    Denis Ovsienko
Index: ios12.connector
===================================================================
--- ios12.connector     (revision 4506)
+++ ios12.connector     (working copy)
@@ -11,27 +11,34 @@
        [ $# = 1 ] || exit 2
        local skip=yes cval found=no MYDIR=`dirname $0`
        while read line; do
+               echo "line is: $line" >> /tmp/racktables-debug.log
                if [ "$skip" = "yes" -a "$line" = "# S-T-A-R-T" ]; then
                        skip=no
+                       echo 'skip=no' >> /tmp/racktables-debug.log
                        continue
                fi
                if [ "$skip" = "no" -a "$line" = "# S-T-O-P" ]; then
                        skip=yes
+                       echo 'skip=yes' >> /tmp/racktables-debug.log
                        continue
                fi
                [ "$skip" = "yes" ] && continue
                # ignore comments
                [ -z "${line###*}" ] && continue
 
+               echo 'not a comment' >> /tmp/racktables-debug.log
                # First endpoint string/regexp match is sufficient for us.
                cval=`echo $line | cut -s -d' ' -f1`
                if [ -z "${1##$cval}" ]; then
                        found=yes
+                       echo 'found=yes' >> /tmp/racktables-debug.log
                        username=`echo $line | cut -s -d' ' -f5`
+                       echo "username=$username" >> /tmp/racktables-debug.log
                        [ "$username" != "-" ] && echo $username > $SESSION
                        # access password
                        echo $line | cut -s -d' ' -f6 >> $SESSION
                        enable_password=`echo $line | cut -s -d' ' -f7`
+                       echo "enable_password=$enable_password" >> 
/tmp/racktables-debug.log
                        [ "$enable_password" != "-" ] && {
                                echo en >> $SESSION
                                echo $enable_password >> $SESSION
@@ -40,6 +47,7 @@
                fi
        done < "$MYDIR/switch.secrets.php"
        [ "$found" = "yes" ] && return
+       echo 'password not found' >> /tmp/racktables-debug.log
        exit 3
 }
 

Other related posts: