Thanks for the explanation Don. I use awk extensively and I'm always glad to
see another method.
Happy Holidays.
Ray Westphal
Enterprise Rent-A-Car
-----Original Message-----
From: owner-nv-l@tkg.com [mailto:owner-nv-l@tkg.com]On Behalf Of Davis,
Donald
Sent: Wednesday, December 12, 2001 2:53 PM
To: 'IBM NetView Discussion'
Subject: RE: [NV-L] re: A Better Mousetrap? - nvdbformat
Ray,
Here is a more complete command that will give you a list of just the
devices with Frame interfaces.
I will try to explain each step in the command:
1. ovobjprint dumps entire object database
2. /Selection Name/ finds every selection name and assigns it to a variable
called NAME
3. /SNMP IfType.*Frame.*/ matches what you are looking for. Only then is the
NAME printed.
4. awk sets Field Separator to ":" and prints just the device name
5. sed gets rid of the leading quote
6. sort unique gets rid of duplicates.
ovobjprint | awk '/Selection Name/{NAME=$4}/SNMP ifType.*Frame.*/{print
NAME}' |
awk 'BEGIN{FS=":"}{print $1}' | sed 's/"//'|sort -u
I like Steve's recommendation better - ovobjprint can be CPU/Netiew
intensive.
Best regards,
Don Davis
-----Original Message-----
From: Westphal, Raymond [mailto:RWestphal@erac.com]
Sent: Wednesday, December 12, 2001 2:19 PM
To: NV List (E-mail)
Subject: [NV-L] re: A Better Mousetrap? - nvdbformat
Stephen and Don,
I really appreciate the suggestions. I've been working on this for a week.
Prior nvUtil solutions have caused serious nvcold and netmon problems.
I'm trying to create a list of marginal or critical frame relay ROUTERS not
interfaces. I use the nvdbformat command with the format file below.
It seems to work fine and it provides the Selection Name I need for the
nvUtil.
Stephen, the SmartSet solution doesn't find any routers with the following:
Don,
The awk solution is very interesting. I'm sure I don't understand all of it.
The output is a listing of all Frame Relay type interfaces. I would then
have
to perform some check to obtain the TopM Node ID. Then perform a unique sort
on
that output. My hub routers have over 150+ sub interfaces. There are also
some
objects labeled such as lan123456789. ????!
Thanks,
Ray.
#############################################
SELECTRULE:isInterface=TRUE
SELECTRULE:SNMP ifType~Frame Relay
SELECTFIELD:1:TopM Node ID:Selection Name
#SELECTFIELD:1:TopM Node ID:IP Hostname
#
SORTBY:1:TopM Node ID:Selection Name
#
#HEADER:Selection Name,isFrameRelay
OUTPUT:${1},TRUE
#############################################
-----Original Message-----
From: owner-nv-l@tkg.com [mailto:owner-nv-l@tkg.com]On Behalf Of Stephen
Hochstetler
Sent: Tuesday, December 11, 2001 3:39 PM
To: IBM NetView Discussion
Subject: Re: [NV-L] A better mousetrap?
Ray,
Are you building a collection of Interface objects or routers? You
first state that you are looking at ifType then setting a field on those
objects, then you are getting the "IP Hostname" from that object.
That appears to not add up to me. How are you switching from interface
object to node objects?
Assuming that all works ok, I would recommend this:
1. Build a SmartSet using your ifType and status field values.... nvcold
then will keep that smartset populated properly. No cron steps needed.
No mass hits against your database, as field values change nvcold will read
it and populate the SmartSet.
2. To get the list, nvUtil -l <name> where <name> is the Smartset
name. One simply command.
Kind regards,
Stephen Hochstetler shochste@us.ibm.com
International Technical Support Organization - Austin
Office - 512-436-8564 FAX - 512-436-8701
ITSO redbooks at http://www.redbooks.ibm.com
_________________________________________________________________________
NV-L List information and Archives: http://www.tkg.com/nv-l
Ray Westphal
NMSA Systems Administrator
Phone: (314) 512-3867
Fax: (314) 512-6002
Pager: (314) 509-0036
mailto:rwestphal@erac.com
_________________________________________________________________________
NV-L List information and Archives: http://www.tkg.com/nv-l
----------------------------------------------------------------------------
--
This electronic mail and any files transmitted with it are confidential and
are intended solely for the use of individual or entity to whom they are
addressed. If you are not the intended recipient or the person responsible
for delivering the electronic mail to the intended recipient, be advised
that you have received this electronic mail in error and that any use,
dissemination, forwarding, printing, or copying of this electronic mail is
strictly prohibited. If you have received this electronic mail in error,
please immediately notify the sender by return mail.
============================================================================
==
_________________________________________________________________________
|