Re: [NV-L] CLI to determine whether or not IP address known ???
2007-04-12 12:38:16
I use a script that does this:
#!/bin/ksh
#set -x
ADDR=$1
if [ -z "$ADDR" ]
then echo "syntax is $0 ipaddress"
exit
fi
ADADDR=$ADDR"AD"
RESULT=`/usr/OV/bin/nvUtil e '("IP
Address" = '$ADDR') || ("IP Address" = '$ADADDR')'`
echo $ADDR $RESULT
If it is not found, it just returns
the address you entered. If it is found, it includes the Selection Name
of the interface object. That is, of course, the Selection Name of the
parent node and the ifDescr or address for the interface, separated by
a colon.
My script has, I am told, a really stupid
name, so you should make up a better one.
I use another version that takes a list
of addresses or names and returns this information, and for speed, it uses
checks the output of a fresh ovtopodump instead of doing the nvUtil for
each one.
#!/bin/ksh
#set -x
FILE=$1
if [ -z "$FILE" ]
then echo "syntax is $0 filename"
echo "
where filename is a file that lists addresses."
exit
fi
echo "# Getting fresh ovtopodump
to search against."
TOPO=/tmp/topo.out
ovtopodump > $TOPO
echo "# Addr, Name if input item
: node its on, status, address : input record"
while read -r RECORD
do
ITEM=`echo $RECORD | cut
-f1 -d"," | cut -f1 -d" "`
if [ -z "$ITEM"
]
then continue
fi
HOSTDATA=`/usr/OV/bin/nvgethost
$ITEM `
# It returned something
if [ -z "$HOSTDATA"
]
then
# item is a name that does not resolve, use as is
RESULT=`grep
"$ITEM " $TOPO | tail -1 | awk '{print $2,$3,$4}'`
if [ -z
"$RESULT" ]
then RESULT="MISSING"
fi
echo "$ITEM
unresolved : $RESULT : $RECORD"
else
NAME=`echo
$HOSTDATA | cut -f1 -d" "`
ADDR=`echo
$HOSTDATA | cut -f3 -d" "`
if [ "$NAME"
= "$ADDR" ]
then HOSTDATA="unresolved"
# an address that does not resolve (useless information)
fi
RESULT=`grep
"$ADDR " $TOPO | tail -1 | awk '{print $2,$3,$4}'`
if [ -z
"$RESULT" ]
then RESULT="MISSING"
fi
echo "$ADDR
$NAME : $RESULT : $RECORD"
fi
done < $FILE
Cordially,
Leslie A. Clark
IT Services Specialist, Network Mgmt
Information Technology Services Americas
IBM Global Services
(248) 552-4968 Voicemail, Fax, Pager
James Shanks/Raleigh/IBM@IBMUS
Sent by: nv-l-bounces AT lists.ca.ibm DOT com
04/12/2007 12:11 PM
Please respond to
Tivoli NetView Discussions <nv-l AT lists.ca.ibm DOT com> |
|
To
| Tivoli NetView Discussions <nv-l AT lists.ca.ibm DOT com>
|
cc
|
|
Subject
| Re: [NV-L] CLI to determine whether
or not IP address known ??? |
|
NetView has no such tool. Perhaps someone else has already
written one and will respond.
ovobjprint takes selection names as an argument, because it is ov-object-print
and the objects in the database are known by their selection names. IP
addresses are part of the TopM Interface list, which is an object property.
We have no tools to search objects by properties.
Dumping the database seems easy enough to me, and you could write a script
to search it with your IP addresses. Or you could use nvdbformat to write
a report which lists just the interface list for each selection name if
that would help. You could also dump the topology database with ovtopodump
-lrv and search that if you would prefer.
But to search without dumping would require that you write your own application
using the OVwDb API routines, such as OVwDbGetFieldVlaue, discussed in
the Windows Programmer's Guide.
James Shanks
Level 3 Support for Tivoli NetView for UNIX and Windows
Network Availability Management
Network Management - Development
Tivoli Software, IBM Corp
Michael
D Schleif <mds AT helices DOT org>
Michael D Schleif <mds AT helices DOT org>
Sent by: nv-l-bounces AT lists.ca.ibm DOT com
04/12/2007 11:12 AM
Please respond to
Tivoli NetView Discussions <nv-l AT lists.ca.ibm DOT com> |
|
|
M$ Windows Server 2003; SP1
NV v7.1.4; FP04
Given a list of IP addresses, is there a CLI to determine whether or not
each address is already know to Netview, and already in the object
database?
ovobjprint appears to accept ONLY Selection Names.
Yes, I can dump the entire object DB, and query against the dump; but,
I
would rather query by each individual address.
What do you think?
--
Best Regards,
mds
mds resource
877.596.8237
-
Dare to fix things before they break . . .
-
Our capacity for understanding is inversely proportional to how much
we think we know. The more I know, the more I know I don't know .
. .
--
(See attached file: signature.asc)_______________________________________________
NV-L mailing list
NV-L AT lists.ca.ibm DOT com
Unsubscribe:NV-L-leave AT lists.ca.ibm DOT com
http://lists.ca.ibm.com/mailman/listinfo/nv-l
(Browser access limited to internal IBM'ers only)
_______________________________________________
NV-L mailing list
NV-L AT lists.ca.ibm DOT com
Unsubscribe:NV-L-leave AT lists.ca.ibm DOT com
http://lists.ca.ibm.com/mailman/listinfo/nv-l (Browser access limited to
internal IBM'ers only)
signature.asc
Description: Binary data
_______________________________________________
NV-L mailing list
NV-L AT lists.ca.ibm DOT com
Unsubscribe:NV-L-leave AT lists.ca.ibm DOT com
http://lists.ca.ibm.com/mailman/listinfo/nv-l (Browser access limited to
internal IBM'ers only)
|
|
|