Hi Andy, list,

try the following (all in one line):

for networkmh in $(show models mth=0x1002e | awk '{print $1}'); do
echo "Container ${networkmh}:"; for childmh in $(show children
rel=Collects mh=${networkmh} | awk '{print $1}'); do show attributes
attr=0x12d7f mh=${childmh} | tail -1 | awk '{print $3}'; done; done

As CLI script it could look like this:

*****************
#!/usr/bin/bash

for networkmh in $(show models mth=0x1002e | awk '{print $1}')
    do
        echo "Container ${networkmh}:"
        for childmh in $(show children rel=Collects mh=${networkmh} |
awk '{print $1}')
            do
                show attributes attr=0x12d7f mh=${childmh} | tail -1 |
awk '{print $3}'
            done
    done
*****************

This (command or script) shows for every container of type "Network"
the primary IP of all its children.

For sure you'll get some "errors" because of different things:

1. show-output contains header which isn't excluded
2. some children may not have any address (think of subcontainers, fanouts, ...)
3. maybe some other reasons not mentioned here

Hope this helps.

Regards,
Marcel


On Mon, Jun 22, 2009 at 11:12 PM, Andrew Stein<[email protected]> wrote:
>
> I have 100's of manual created logical containers. All the children in these
> containers contain device models with IP's associated to them. Does anyone
> know of a CLI command I can use for each container to dump the IP's of all
> the devices on a container by container basis?
>
> Thanks.
>
> Andy Stein
>
> Duke Medicine
> Network and System Management Technologies
> [email protected]
> Office (919) 681-2739
> Mobile (919) 402-7627
>
> --To unsubscribe from spectrum, send email to [email protected] with the
> body: unsubscribe spectrum [email protected]

---
To unsubscribe from spectrum, send email to [email protected] with the body: 
unsubscribe spectrum [email protected]

Reply via email to