Archive

Archive for July, 2009

Rounding up computers.

July 29th, 2009 admin No comments

Today I was given a list of computers that SMS could not contact, most likely the DNS setting was incorrect. So here are the scripts I used to diagnose the problem.

First I wrote a little script that looks for the computer name in our DNS directories, I called it ng, short for named grep, here it is:

#!/bin/bash

#  2007-09-19 Jud Bishop
#  ng short for namedgrep.  Does a case insensitive
#  search for the hostname
#  supplied at the command line.

if [ -z $1 ]
then
        echo " Useage:$0 host "
                exit
fi

        grep -i $1 /var/named/internal/*
        grep -i $1 /var/named/internal/172.25/*
# end script

Next I was given a file with the hostname and error, the file was in this format:

prompt> cat tmp.txt
HOST1

Unable to retrieve computer information for 'jlb18.circus.org'. Access is
denied.

HOSTIII

Unable to retrieve computer information for 'jlbIII.circus.org'. Access is
denied.

HOST4

Unable to retrieve computer information for 'jlb4.circus.org'. The network
path was not found.
/end tmp.txt

So I ran this little on liner on it to edit out just the hostnames, the sed
eliminates blank lines, the grep removes Unable, cheap hack but it works:

promtp> cat tmp.txt |sed  /^$/d |grep -v Unable >ng.in

Now I have a files of hostnames, one per line that I can send into ng.

prompt> cat ng.in
HOST1
HOSTIII
HOST4

Finally I just ran this from the command line:

prompt> for I in `cat ng.txt`; do echo $I; ng $I; done >ng.out

And that was the first 20 minutes of work after reading my email this morning.

Categories: Linux Tags:

Passing CCNP BSCI

July 20th, 2009 jud Comments off

I recently passed the BSCI test on the CCNP track. I have been meaning to write my observations, so here they are. Where I have the Cisco Document ID I will provide it, otherwise I will just provide the document title.

Cisco Press Books:
Official Exam Certification Guide
Fourth Edition, by Stewart and Gough

My thoughts: I read this book from cover to cover and continue to use it as a reference book. The topic coverage is more appropriate for someone who has some hands on experience with most of the protocols. I felt like it hit the meat of each topic but did not cover them as in depth as I wanted. It comes with a CD-Rom and book on PDF which is nice, because I keep a copy on my computer at work for reference.

Authorized Self-Study Guide
Building Scalable Cisco Internetworks (BSCI)
Third Edition, by Teare and Paquet

My thoughts: I read this book from cover to cover but do not use it much in my daily work, it takes too much time to explain a topic. This is the best book if you do not have hands on experience with all of the protocols. For instance at work we use OSPF so I had a good basic understanding of the protocol but I had no experience with BGP, EIGRP or IS-IS. I felt this book brought me up to speed on those topics better than the Certification Guide. It tried to recreate the class scenario in written form and does a good job of doing that with diagrams that would normally be seen in class. There are no pre-chapter questions and the end of chapter questions are open ended. My book did not come with a CD.

CCNP Building Scalabe Internetworks
(BSCI 642-901)
Lab Portfolio by Kotfile, Moorhouse and Wolfson

My thoughts: I am torn. I would not recommend this book if you have a good set of labs already or are extremely familiar with GNS3. Nearly half of the book is taken up with ping output to prove connectivity. I don’t need that in a book, I can see full reachability on my own lab equipment.

I also don’t like the set up of the lab book. Rather than give you a scenario and an assignment, then give the answer separately, the labs are step-by-step. So you cannot fumble around if you follow the the book. I would prefer a diagram with the assignment. Let me turn the page to see the answer or the step-by-step how to complete the lab.

I did at least a couple of labs from each section until I felt comfortable designing my own labs in GNS3. At that point I only looked at this book if I was stuck somewhere.

My web readings from cisco.com:

IPv6:
Doc ID: 25156, Tunneling IPv6 through an IPv4 Network
6Bone Connection Using 6to4 Tunnels for IPv6
Implementing IPv6 Addressing and Basic Connectivity
Interconnecting IPv6 Domains Using Tunnels
Implementing OSPF for IPv6

BGP:
Doc ID: 13762, Load Sharing with BGP in Single and Multihomed Environments.
Doc ID: 26634, BGP Case Studies
Doc ID: 5816, BGP FAQ

OSPF:
Doc ID: 9237, OSPF Frequently Asked Questions
Doc ID: 16563, Configuring and Troubleshooting Frame Relay
Internetworking Technologies Handbook, Chapter 46, OSPF
Network Protocols Configuration Guide, Part 1, Configuring OSPF

EIGRP:
Doc ID: 16406, EIGRP
Doc ID: 13681, EIGRP FAQ
Doc ID: 21324, Troubleshooting EIGRP
Configuring EIGRP
Internetworking Technologies Handbook, Chapter 40, EIGRP

Misc.
Multicast Q&A
Route-Maps for IP Routing Protocol Redistribution Configuration

Categories: Routing Tags:

Jot

July 17th, 2009 admin Comments off

When I first started working on AIX I had come from a BSD background and wanted jot for some scripts I needed to write. This is that script. FreeBSD and Mac OSX have a binary called jot in the default install, AIX and Linux do not. You will see jot come up in many of my scripts because it is so useful in counting forward and backward. The output of this script is purposely designed to be used as input to other scripts. It is a building block upon which many of my other scripts are based.

I realize this is not necessarily about Linux for my first Linux post, but I haven’t decided on having a Code category yet.

Update:
I added a code category and have added this script to it.

#!/bin/bash
#   Copyright Jud Bishop 2003-07-28.
#   Released under the BSD License.
#   This copyright must be left intact.
#   I wanted an easy way to count on my
#   AIX box and there was none.
#   This is my remedy.
#
#
#   ./jot.sh will produce
#   1\n 2\n ...(the newlines just keep going)
#
#   ./jot.sh -e 10 will end at 10 and produce
#   1\n 2\n ... to 10\n
#
#   ./jot.sh -e 10 -b 2 will end at 10 and produce
#   1\n 3\n ... 9\n
#
#   ./jot.sh -s 2 -b 2 -e 10 will start at 2 count by 2 and end at 10.
#   2\n 4\n ... 10\n

OPT=
START=0
END=10
COUNTBY=1
X=0
WORD=
JOIN=FALSE
while getopts s:e:b:w:jr OPT
do
    case $OPT in
        s)  START=$OPTARG
            ;;
        e)  END=$OPTARG
            ;;
        b)  COUNTBY=$OPTARG
            ;;
        w)  WORD=$OPTARG
            ;;
        j)  JOIN=TRUE
            ;;
        r)  REVERSE=TRUE
            ;;
    #   \?) echo
        *)  echo "Usage:"
            echo "      jot -s 2 -b 2 -e 10"
            echo "          -s start"
            echo "          -b count by"
            echo "          -e end"
            exit 1
            ;;
    esac
done
shift `expr $OPTIND - 1`

if [ "$REVERSE" = "TRUE" ]
then
    X=${START}
    while test $X -ge $END
    do
        if [ "$WORD" = "" ]
        then
            echo $X
            X=`expr $X - $COUNTBY`
        elif [ "$JOIN" = "TRUE" ]
        then
            echo $WORD$X
            X=`expr $X - $COUNTBY`
        else
            echo $WORD
            X=`expr $X - $COUNTBY`
        fi
    done
else
    X=${START}
    while test $X -le $END
    do
        if [ "$WORD" = "" ]
            then
            echo $X
            X=`expr $X + $COUNTBY`
        elif [ "$JOIN" = "TRUE" ]
        then
            echo $WORD$X
            X=`expr $X + $COUNTBY`
        else
            echo $WORD
            X=`expr $X + $COUNTBY`
        fi
    done
fi
exit 0
Categories: Code, Linux Tags: