nv-l

RE: Collection Editor

2001-06-15 11:33:23
Subject: RE: Collection Editor
From: Hornbaker Thom M <Thomas.M.Hornbaker AT irs DOT gov>
To: nv-l AT lists.tivoli DOT com
Date: Fri, 15 Jun 2001 11:33:23 -0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
We run NV6.0.1 for NT.  We found the smartsetutil command and played around
with it but we couldn't find much documentation on rule syntax.  Tivoli
Support sent us the man pages for nvUtil which is the equivalent command in
the Unix version.  It's been a lot of help.  As far as wildcarding, I never
found anything in NV's documentation, but I think the following works:

. (period)  Matches any single character.  Example: node.in matches node3int
and nodeXints.

* (asterisk)  Matches zero or more occurrences of the preceding character.
Example:  node* matches nod, node nodeTwo, nodee.

^ (caret)  If it's the first character, then the following string must be
the first part of any matching string.  Example:  ^node matches nodeTwo but
not Twonode.

$ (dollar sign)  If it's the last character, then the preceding string must
be the last part of any matching string.  Example:  node$ matches Twonode
but not nodeTwo.


Also, here are the comments and man pages Tivoli sent us:

There is not a lot of documentation for the smartsetutil.exe utility.  If
you type the name without any operands, you will get a minimal list of
operands.  I couldn't find any help entries for it in the NetView for NT
help topics or index.  On the UNIX version of NetView, the utility is
called nvUtil, and it does the same thing as the NT version.  There is a
man page for nvUtil, which I have cleaned up a bit and included below.  I
hope that helps you.

Here is the nvUtil man page:

nvUtil(1)  (smartsetutil.exe on NetView for NT)

  Purpose

  Enables you to create, modify, delete, and list SmartSets.

  Syntax

       nvUtil option required_parameters [additional_parameters]


  Description

  The /usr/OV/bin/nvUtil command is the command line interface to the Smart-
  Set Facility.

  Parameters

  The following list summarizes the valid values for option.  Parameters not
  within brackets ( [ ] ) are required; parameters within brackets ( [ ] )
  are optional. Note that unlike some UNIX commands, parameters are not pre-
  ceded by a dash.

       L Lists all SmartSets.

       G [printfstring(%s,%d,%s,%s) name, size, description, rule] Gets all
       SmartSets and rules.

       g name Gets the description and rule for the specified SmartSet.

       l name [outstring] Lists members of the specified SmartSet.

       e rule [outstring] Evaluates the specified rule.

       p rule Evaluates the specified rule and prints the field values.

       a name desc rule [force] Adds a new SmartSet with the specified name,
       description, and rule.

       D name [force] Deletes the specified SmartSet.

       X Deletes all SmartSets.

       d name desc Modifies the description of the specified SmartSet.

       r name rule Modifies the rule of the specified SmartSet.

       m name desc rule Modifies the description and rule of the specified
       SmartSet.

       s oid Shows all SmartSets containing the specified OID.


       u name1 name2 [outstring] Joins the two specified SmartSets using the
       logical OR (union) operator.

       c name oid Joins the specified SmartSet and the specified OID
together
       using the logical OR (union) operator.

       i name1 name2 [outstring] Joins the specified SmartSets using the
log-
       ical AND (intersect) operator.

       t name oid Joins the specified SmartSet and OID using the logical AND

       (intersect) operator.

       n SelectionName [outstring] Specifies object field information for
the
       selection name of an object from the object database.

       o oid [outstring] Specifies object field information for the OID of
an
       object from the object database.

       f SelectionName OrderString Specifies object field information for
the
       specified selection name, where OrderString is the letters NETFLG
       corresponding to the first letter of each of the following Fmt
strings
       in the preferred order: nameFmt, enumCapFmt, trueCapFmt, falseCapFmt,
       locateFmt, and generalFmt.

  The following is a description of the required and additional parameters:

       name The name of the SmartSet.

       desc The description of the SmartSet.

       rule The rule for the SmartSet.

       force Force the operation to occur even if dependencies exist. The
       value can be 0 or 1.

       oid The OID of an object from the object database.

       SelectionName The Selection Name of an object from the object data-
       base.

       outstring A string in which substring of the form %<fieldname>% will
       be replaced by the value of the field. Field names which contain
       spaces must be enclosed within quotation marks. For example, %"Selec-
       tion Name"% is replaced by the selection name for every object in the
       specified list of objects. %"OBJECT ID"% will be replaced with the
       object ovwdb OID.

       printfstring(x) A printf-style string where x indicates fixed parame-
       ters. This allows you to control the format of the output of fields
       which support it.

       xFmt A field format specification (nameFmt, enumCapFmt, trueCapFmt,
       falseCapFmt, locateFmt, and generalFmt) of the form:


        tableTag,fieldTag,IDtag,NameTag,DataTag,ElementData


  Where each tag has the form BEGIN%sEND; the BEGIN and END strings are
  printed before and after the actual data in the tag. The ElementData tag
is
  used only for fields which are lists; in this case the DataTag wraps
around
  the entire field, and the ElementData tag wraps around each member of the
  list.

  Examples

  The following command lists the names of all existing SmartSets:


       nvUtil L


  The following command lists the names of all existing SmartSets and
  displays the rules which are used to create them:


       nvUtil G


  The following command evaluates a rule, providing a list of objects in the
  database which satisfy the rule. This is equivalent to the Resolve
function
  of the SmartSet Editor:


       nvUtil e isHub=TRUE


  A note about rule syntax:

  Simple rules, such as isHub=TRUE require no additional punctuation to be
  valid, as long as there are no spaces between the elements of the rule.
  Any of the following is equivalent:


       nvUtil e isHub=TRUE
       nvUtil e 'isHub'=TRUE
       nvUtil e 'isHub'='TRUE'
       nvUtil e isHub=True
       nvUtil e 'isHub'='true'


  Complex rules, and ones with spaces between the elements, must be enclosed
  by parentheses; and when evaluated, the rule must be given in quotation
  marks. For example, to evaluate this rule, which selects all non-IBM
  routers, quotation marks are required:


       nvUtil e "(('isRouter' = True) &amp;&amp; (!('vendor' = 'IBM')))"


  Here is a rule which selects four specific hostnames:


       nvUtil e "((('IP Hostname' = 'alpha.ibm.com') || ('IP Hostname' =
'beta.ibm.com')) || (('IP Hostname' = 'gamma.ibm.com') || ('IP Hostname' =
'delta.ibm.com')))"


  Here is a rule which evaluates the union of two other SmartSets named Net-
  Views (the NetViews SmartSet is created by mgragentd). This rule assumes
  that both of these SmartSets already exist.


       nvUtil e "((IN_COLLECTION NetViews) &amp;&amp; (IN_COLLECTION
IPRouters))"


  Note that the same output could be obtained using:


       nvUtil u NetViews IPRouters


  The following command creates a SmartSet named CriticalRouters. The Smart-
  Set list contains all IBM routers and Cisco Systems routers that have IP
  statuses appearing as critical:


       nvUtil a "CriticalRouters" "All critical routers" "((('vendor' =
'IBM') ||  ('vendor' = 'ciscoSystems')) &amp;&amp; (('isRouter' = True)
&amp;&amp; ('IP Status' = 'Critical')))"


  In general, users who have difficulty with this syntax are encouraged to
  use the SmartSet editor to create sample SmartSets using that tool, and
  then to examine the rules for those SmartSets using nvUtil g (or G).

-----Original Message-----
From: Davis, Donald [mailto:donald.davis AT firstcitizens DOT com]
Sent: Friday, June 15, 2001 9:19 AM
To: 'IBM NetView Discussion'
Subject: RE: [NV-L] Collection Editor


Ray,
Smartset/Collection Editor uses "Regular Expressions".
Your rule should look like this :

(('vendor' = 'Microsoft') && ('IP Hostname' ~ '^CC'))

Note that the comparison operator for IP Hostname is the tilde symbol, not
an equal sign!
You can cut & paste this directly into your editor using text mode instead
of dialog.

Don Davis




-----Original Message-----
From: Raymond Tuggle [mailto:rtuggle AT bcbsga DOT com]
Sent: Thursday, June 14, 2001 9:39 PM
To: nv-l AT tkg DOT com
Subject: [NV-L] Collection Editor


Hello
    I am trying to set up what probably is a simple collection group.  I
would like all nodes that have the following requirements:
    Vendor = microsoft
        and
     IP Hostname begins with "CC"

    If I try setting IP Hostname ~ "CC" or IP Hostname ~ "CC*" then I
get everything that has CC anywhere in the hostname.  I also tried CC+
and +CC neither one of them worked either.
    How do you use wildcards to select only hostnames that begin with
CC?
    Thanks
    Raymond


_________________________________________________________________________
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.

============================================================================
==

_________________________________________________________________________
NV-L List information and Archives: http://www.tkg.com/nv-l

We run NV6.0.1 for NT.  We found the smartsetutil command and played around with it but we couldn't find much documentation on rule syntax.  Tivoli Support sent us the man pages for nvUtil which is the equivalent command in the Unix version.  It's been a lot of help.  As far as wildcarding, I never found anything in NV's documentation, but I think the following works:

. (period)  Matches any single character.  Example: node.in matches node3int and nodeXints.

* (asterisk)  Matches zero or more occurrences of the preceding character.  Example:  node* matches nod, node nodeTwo, nodee.

^ (caret)  If it's the first character, then the following string must be the first part of any matching string.  Example:  ^node matches nodeTwo but not Twonode.

$ (dollar sign)  If it's the last character, then the preceding string must be the last part of any matching string.  Example:  node$ matches Twonode but not nodeTwo.


Also, here are the comments and man pages Tivoli sent us:

There is not a lot of documentation for the smartsetutil.exe utility.  If
you type the name without any operands, you will get a minimal list of
operands.  I couldn't find any help entries for it in the NetView for NT
help topics or index.  On the UNIX version of NetView, the utility is
called nvUtil, and it does the same thing as the NT version.  There is a
man page for nvUtil, which I have cleaned up a bit and included below.  I
hope that helps you.

Here is the nvUtil man page:

nvUtil(1)  (smartsetutil.exe on NetView for NT)

  Purpose

  Enables you to create, modify, delete, and list SmartSets.

  Syntax

       nvUtil option required_parameters [additional_parameters]


  Description

  The /usr/OV/bin/nvUtil command is the command line interface to the Smart-
  Set Facility.

  Parameters

  The following list summarizes the valid values for option.  Parameters not
  within brackets ( [ ] ) are required; parameters within brackets ( [ ] )
  are optional. Note that unlike some UNIX commands, parameters are not pre-
  ceded by a dash.

       L Lists all SmartSets.

       G [printfstring(%s,%d,%s,%s) name, size, description, rule] Gets all
       SmartSets and rules.

       g name Gets the description and rule for the specified SmartSet.

       l name [outstring] Lists members of the specified SmartSet.

       e rule [outstring] Evaluates the specified rule.

       p rule Evaluates the specified rule and prints the field values.

       a name desc rule [force] Adds a new SmartSet with the specified name,
       description, and rule.

       D name [force] Deletes the specified SmartSet.

       X Deletes all SmartSets.

       d name desc Modifies the description of the specified SmartSet.

       r name rule Modifies the rule of the specified SmartSet.

       m name desc rule Modifies the description and rule of the specified
       SmartSet.

       s oid Shows all SmartSets containing the specified OID.


       u name1 name2 [outstring] Joins the two specified SmartSets using the
       logical OR (union) operator.

       c name oid Joins the specified SmartSet and the specified OID together
       using the logical OR (union) operator.

       i name1 name2 [outstring] Joins the specified SmartSets using the log-
       ical AND (intersect) operator.

       t name oid Joins the specified SmartSet and OID using the logical AND

       (intersect) operator.

       n SelectionName [outstring] Specifies object field information for the
       selection name of an object from the object database.

       o oid [outstring] Specifies object field information for the OID of an
       object from the object database.

       f SelectionName OrderString Specifies object field information for the
       specified selection name, where OrderString is the letters NETFLG
       corresponding to the first letter of each of the following Fmt strings
       in the preferred order: nameFmt, enumCapFmt, trueCapFmt, falseCapFmt,
       locateFmt, and generalFmt.

  The following is a description of the required and additional parameters:

       name The name of the SmartSet.

       desc The description of the SmartSet.

       rule The rule for the SmartSet.

       force Force the operation to occur even if dependencies exist. The
       value can be 0 or 1.

       oid The OID of an object from the object database.

       SelectionName The Selection Name of an object from the object data-
       base.

       outstring A string in which substring of the form %<fieldname>% will
       be replaced by the value of the field. Field names which contain
       spaces must be enclosed within quotation marks. For example, %"Selec-
       tion Name"% is replaced by the selection name for every object in the
       specified list of objects. %"OBJECT ID"% will be replaced with the
       object ovwdb OID.

       printfstring(x) A printf-style string where x indicates fixed parame-
       ters. This allows you to control the format of the output of fields
       which support it.

       xFmt A field format specification (nameFmt, enumCapFmt, trueCapFmt,
       falseCapFmt, locateFmt, and generalFmt) of the form:


        tableTag,fieldTag,IDtag,NameTag,DataTag,ElementData


  Where each tag has the form BEGIN%sEND; the BEGIN and END strings are
  printed before and after the actual data in the tag. The ElementData tag is
  used only for fields which are lists; in this case the DataTag wraps around
  the entire field, and the ElementData tag wraps around each member of the
  list.

  Examples

  The following command lists the names of all existing SmartSets:


       nvUtil L


  The following command lists the names of all existing SmartSets and
  displays the rules which are used to create them:


       nvUtil G


  The following command evaluates a rule, providing a list of objects in the
  database which satisfy the rule. This is equivalent to the Resolve function
  of the SmartSet Editor:


       nvUtil e isHub=TRUE


  A note about rule syntax:

  Simple rules, such as isHub=TRUE require no additional punctuation to be
  valid, as long as there are no spaces between the elements of the rule.
  Any of the following is equivalent:


       nvUtil e isHub=TRUE
       nvUtil e 'isHub'=TRUE
       nvUtil e 'isHub'='TRUE'
       nvUtil e isHub=True
       nvUtil e 'isHub'='true'


  Complex rules, and ones with spaces between the elements, must be enclosed
  by parentheses; and when evaluated, the rule must be given in quotation
  marks. For example, to evaluate this rule, which selects all non-IBM
  routers, quotation marks are required:


       nvUtil e "(('isRouter' = True) &amp;&amp; (!('vendor' = 'IBM')))"


  Here is a rule which selects four specific hostnames:


       nvUtil e "((('IP Hostname' = 'alpha.ibm.com') || ('IP Hostname' =
'beta.ibm.com')) || (('IP Hostname' = 'gamma.ibm.com') || ('IP Hostname' =
'delta.ibm.com')))"


  Here is a rule which evaluates the union of two other SmartSets named Net-
  Views (the NetViews SmartSet is created by mgragentd). This rule assumes
  that both of these SmartSets already exist.


       nvUtil e "((IN_COLLECTION NetViews) &amp;&amp; (IN_COLLECTION
IPRouters))"


  Note that the same output could be obtained using:


       nvUtil u NetViews IPRouters


  The following command creates a SmartSet named CriticalRouters. The Smart-
  Set list contains all IBM routers and Cisco Systems routers that have IP
  statuses appearing as critical:


       nvUtil a "CriticalRouters" "All critical routers" "((('vendor' =
'IBM') ||  ('vendor' = 'ciscoSystems')) &amp;&amp; (('isRouter' = True)
&amp;&amp; ('IP Status' = 'Critical')))"


  In general, users who have difficulty with this syntax are encouraged to
  use the SmartSet editor to create sample SmartSets using that tool, and
  then to examine the rules for those SmartSets using nvUtil g (or G).

-----Original Message-----
From: Davis, Donald [mailto:donald.davis AT firstcitizens DOT com]
Sent: Friday, June 15, 2001 9:19 AM
To: 'IBM NetView Discussion'
Subject: RE: [NV-L] Collection Editor


Ray,
Smartset/Collection Editor uses "Regular Expressions".
Your rule should look like this :

(('vendor' = 'Microsoft') && ('IP Hostname' ~ '^CC'))

Note that the comparison operator for IP Hostname is the tilde symbol, not
an equal sign!
You can cut & paste this directly into your editor using text mode instead
of dialog.

Don Davis




-----Original Message-----
From: Raymond Tuggle [mailto:rtuggle AT bcbsga DOT com]
Sent: Thursday, June 14, 2001 9:39 PM
To: nv-l AT tkg DOT com
Subject: [NV-L] Collection Editor


Hello
    I am trying to set up what probably is a simple collection group.  I
would like all nodes that have the following requirements:
    Vendor = microsoft
        and
     IP Hostname begins with "CC"

    If I try setting IP Hostname ~ "CC" or IP Hostname ~ "CC*" then I
get everything that has CC anywhere in the hostname.  I also tried CC+
and +CC neither one of them worked either.
    How do you use wildcards to select only hostnames that begin with
CC?
    Thanks
    Raymond


_________________________________________________________________________
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.

==============================================================================

_________________________________________________________________________
NV-L List information and Archives: http://www.tkg.com/nv-l





<Prev in Thread] Current Thread [Next in Thread>