//
// @(#)$OV_CONF/$LANG/filters
// @(#)HP OpenView NNM Release B.06.01  Apr 09 1999
// @(#)Copyright (c) 1990-1999 Hewlett-Packard Company
// $Revision: /main/PULSAR/4 $  $Date: 1998/07/21 21:46 UTC $
//
// This is the default filter file.  These filters are examples
// which may be useful in your environment.  This file may be modified only
// with an NNM/Full or NNM/250 product license.
// See OVfilterIntro(5) for more information on this file.
//

// NOTE: The behavior of topology filters in a distributed environment
// changed as of DFIX 5027.  This file documents the behavior as of that
// patch level.  This should be considered the correct specification of
// how topology filtering behaves in a distributed environment.

// Sets are a simple way to list string values to test
// against in a filter.  The "IN" operator tests a field value
// for membership in a set defined here.
//
// Sets are only available with an NNM/250 or NNM/Full product license

Sets {

	// These are simple examples of sets.  
	//
        // servers "Set of Servers" { "sv1", "sv2", "sv3" }
        // gateways "Backbone gateways " { "gw1", "gw2", "gw3" }
	//
        // sets can include a filename which contains the entries. 
        // On NT, the set file must be on the partition where NNM is
	// installed.
        // routers "Set of Routers" { /openview/conf/routers.set }
}


//
// Filters and FilterExpressions are used as Topology, Discovery,
// Map or Persistence filters.  Applications which use filters
// (like ipmap(1), ovtopmd(1m), ovtopodump(1), and ovtopofix(1m))
// can take the name of a Filter or a FilterExpression.
//
Filters {

	// The following filters are potentially useful as either Discovery
	// or Topology filters, or components for building Map filters.  
	// 
	// NOTES CONCERNING DISCOVERY FILTERS: 
	// Networks and Segments are not directly testing with Discovery 
	// filters (and so there is no need to include 
	// "isNetwork || isSegment" in these filters).
	// However, it does not hurt to include networks or segments in
	// a discovery filter, so long as you realize that they will not
	// be acted on.
	//
	// Since nodes are only discovered in managed networks, the network
	// must already exist and be managed before the filtering test 
	// will be applied.  New networks connected to discovered nodes will
	// be discovered unmanaged.   For discovery filters, 
	// a node and all its interfaces can be thought of
	// as a single object. If any interface or the node itself passes the
	// filter, the node and all of its interfaces will pass the filter.
	//
	// ovtopofix -f follows the discovery filter semantics and only
	// applies to locally monitored objects.  However, if a network or
	// segment is empty after the processing of the nodes with the -f
	// option, that segment or network will also be removed.
	//
	// ovtopodump(1) also follows the discovery filter semantic, and
	// the filter only applies to nodes/interfaces.
	// 
	// NOTES CONCERNING MAP AND TOPOLOGY FILTERS: 
	// For these filters, all objects are subject to filtering.
	// One must specify the networks and segments to be passed.
	// Furthermore, objects are displayed/included only if all their 
	// parent objects (submaps) pass the map/topology filter.  For example,
	// if no networks would pass the filter ("isNetwork" is not included),
	// then all segments and non-gateways nodes would be filtered out.
	// Like Discovery filters, if any interface or 
	// node passes a Map filter, the node and all of its interfaces 
	// also pass the filter.
	//
	// See the FilterExpressions section for map and topology 
	// filter examples.
	//
	// NOTE: Prior to DFIX 5027 topology filtering behaved similar to
	// discovery filtering.

	Networks "Any network" { isNetwork }
	Segments "Any segment" { isSegment }
	Nodes "Any node" { isNode }

	// The following filters are primarily for example purposes, though
	// they might be useful as discovery filters.  They do not generally
	// make sense as map or topology filters because they do not specify
	// the inclusion of networks and segments.  They also make sense as
	// parts of a filter expression.

	Routers "Any Router" { isRouter }
	IPRouters "Any IP Router" { isIPRouter }
	Bridges "Any bridge" { isBridge }
	Hubs "Any multi-port repeater" { isHub }
	SNMPNode "Any node supporting SNMP" { isNode && isSNMPSupported }

	// The next filter is useful for defining map and topology filters
	// (see the FilterExpresssions section).  It is not
	// particularly useful as a discovery filter 
	// since all networks and segments automatically pass Discovery
	// filters.  Nor is it useful as a standalone
	// map filter, since it doesn't pass any nodes.

        NetsNSegs "All networks & segments" { isNetwork || isSegment }

	// This filter specifies that only objects that support IP should
	// be included.  This filter should be used as a topology filter on
	// any collection station discovering non-IP information (Level 2
	// or IPX only nodes or networks) that is forwarding to a 
	// NNM 4.X management station.  This will not completely remove
	// all non-IP information (e.g. IPX interfaces on a node that also
	// supports IP will come through), but will limit the impact on the
	// management station, and make migration to NNM 5.X easier.

	IPOnlyObjects "Only objects that support IP"
		{ isIP || isSegment }

    // The remaining filters are only available with an
    // NNM/Full or NNM/250 license

	// LocalLAN "Nodes with interfaces on the 15.2.112-119 subnet" 
	//	{ "IP Address" ~ 15.2.112-119.* }
	// NeighborLANs "Node with interfaces on the neighboring LANs on site"
	//	{ "IP Address" ~ 192.1.2-10.* }
	// HPNodes "Hewlett-Packard nodes"
	//	{ isNode && ( vendor == "Hewlett-Packard" ) }
        // UBNodes "Ungermann-Bass Nodes" 
	//	{ isNode && vendor == "Ungermann-Bass" }
	// NonHPNodes "Non-HP nodes"
	//	{ isNode && ( vendor != "Hewlett-Packard" ) }

	// These are example filters using the sets defined above.

	// GatewaysSet "Any designated Gateway node" 
	//	{ "IP Hostname" in gateways }
	// ServersSet "Any designated Server node" 
	//	{ "IP Hostname" in servers }

	// The next filter is useful for defining map and topology filters
	// (see the FilterExpresssions section).  It is not
	// particularly useful as a discovery filter 
	// since all networks and segments automatically pass Discovery
	// filters.  Nor is it useful as a standalone
	// map filter, since it doesn't pass any nodes.
        //
        // The network name below assumes an entry in /etc/networks.
        // If no such entry exists, the actual network name will be 
	// something like "15.2.112".

	// MyNet "The network in which I'm interested"
	//	{ isNetwork && "IP Network Name" == "yellow-lan" }

	// This filter would be an example of a way to pass all objects
	// contained in the subnet 15.2.112.0 with a subnet mask
	// of 255.255.248.0 (so the subnet range is 15.2.112.0 to
	// 15.2.119.255).  Note that the inclusion of "isSegment" is
	// not a concern, because all segments outside of this network
	// would be filtered out because the networks containing them
	// were filtered out.  We must have some specification of segments
	// if we want the segment contents to be included.

	// EngrLan "The 15.2.112 subnet used by engineering"
	//	{ ("IP Address" ~ 15.2.112-119.* ) || isSegment }

	// This filter accomplishes the same thing, but is more restrictive
	// in the specification of segments to only include segments in that
	// engineering network.  This assumes there is an entry in /etc/networks
	// such that the subnet gets the name "engr-LAN", and hence the segments
	// in that network all have a name of form "engr-LAN.<something>"
	// Generally, the above will accomplish what you want, but this
	// may be necessary in some situations if you want specific segments.
	// In particular, it works well if you want to use this to EXCLUDE
	// the objects in this network.  See the example in the Filter
	// expressions below.

	// EngrLan2 "The 15.2.112 subnet used by engineering"
	//	{ ( "IP Address" ~ 15.2.112-119.* ) ||
	//	  ( "IP Segment Name" ~ "engr-LAN.*" ) }

	// The following are some sample DHCPFilters.
	// They can be specified by using the Network Polling Configuration
	// dialog application, xnmpolling, on the Status Polling page.

	// DHCPSubnet "Addresses in subnet 15.70.177 are DHCP allocated"
	//      { "IP Address" ~ 15.70.177.* }

        // DHCPNode  "A particular address is DHCP allocated"
	//      { "IP Address" ~ 15.70.177.9 }

        // DHCPRange "IP Addresses from 15.70.177.5 through 15.70.177.10"
	//      { "IP Address" ~ 15.70.177.5-10 }

}

// FilterExpressions are simply combinations of filters defined in the
// same filter file (above).  FilterExpressions make it simple to
// combine filters without reproducing the expressions of each
// filter again

FilterExpressions {

	// One can turn the filters defined above into viable map or
	// topology filters by simply adding "|| NetsNSegs".  (Doing so
	// does not invalidate the filters as discovery
	// filters.  It just adds a superfluous test.)

	NetInfrastructure "Any network connecting device and what they connect"
		{ Routers || Bridges || Hubs || NetsNSegs }
	NetBackbone "Networks and gateways/routers"
		{ Routers || Networks }

    // The remaining filter expressions are only available with an
    // NNM/Full or NNM/250 license

	// The following combines the two set filters 
	// defined above into one FilterExpression.
	// It works unmodified as a discovery filter.
	// To work as a map filter, network and segment filtering
	// must be added (see below).

	// VitalNodes "All Gateways and Servers" 
	//	{ GatewaysSet || ServersSet }

	// One can turn the filters defined above into viable map or
	// topology filters by simply adding "|| NetsNSegs".  (Doing so
	// does not invalidate the filters as discovery
	// filters.  It just adds a superfluous test.)

	// VitalNodesMap "All nets & segs, but only gateway and server nodes" 
	//	{ GatewaysSet || ServersSet || NetsNSegs}
	// LocalLANView "All nets & segs, but only local nodes"
	//	{ LocalLAN || NetsNSegs }

	// Using the filters defined above that include only a specific 
	// network, we can also exclude the specific network like this
	// Note the use of the more specific form to exclude only the segments
	// in the engineering lan.  This could have been specified directly
	// as a negation in the filter part, but this form works well if you
	// have several networks to manipulate in this manner.

	// EverythingButEngr "Everything but the engineering LAN"
	//	{ !EngrLan2 }

	// Of course the above filter expressions, when used as
	// map filters, pass all networks and segments.  You
	// may wish to see only a particular network.  The following map
	// filters accomplish this.  Note that though segments
	// and nodes from other networks will pass the filters, IP Map 
	// will ignore them because their parent networks will not pass.
	// NOTE:  These filters will not work as Discovery
	// filters because all network and segments automatically pass
	// Discovery and Topology filters.

	// MyNetMap "Only the network of interest and all its constituent parts"
	//	{ MyNet || Segments || Nodes}
	// MyVitalNodesMap "Gateways, servers and segments in net of interest" 
	//	{ MyNet || Segments ||  GatewaysSet || ServersSet }

        // This is a map persistence filter which ensures that
        // all Ungermann-Bass are kept in memory and up to date.
        // Note that this will also keep any containing submaps in memory.

        // PersFilter "Objects to keep in map memory"
	//	{ UBNodes }
}
