+------------------------------------------------------------------------------+
| NAGIOS LOOKING GLASS - FILTER HOW-TO                                         |
|------------------------------------------------------------------------------|
| Author:           Andy Shellam <andy.shellam@mailnetwork.co.uk>              |
| Last Updated:     3rd June 2007                                              |
+------------------------------------------------------------------------------+

NLG now includes 3 types of filters: host-specific, status-specific, and both.

1. HOST-SPECIFIC

   These are the new filter type in NLG 1.0.6, and allow the administrator of 
   the installation to list a set of hosts, regardless of their status, into a
   filter.
   
   This means you can separate certain hosts from the main view.
   
   To define a host-specific filter, in server/sync-files/s3_filter.inc.php:
   
	$HostFilter[x] = new S3_NetworkFilter();
	$HostFilter[x]->Create("Filter name");
	$HostFilter[x]->SetType("host");
	$HostFilter[x]->AddHost("Host name");
	
   where x= the total number of filters - 1, starting at 0
   e.g. The 2nd filter in the list - x=1
   Replace "Host name" with the name of the host, as defined in Nagios.
   Repeat the AddHost() line for every host you want to add to the filter.

2. STATUS-SPECIFIC

   These are the current filter types available in NLG 1.0 and above, and allow
   the administrator of the installation to list a set of hosts, based on their
   current status.
   
   To define a status-specific filter, in server/sync-files/s3_filter.inc.php:
   
	$HostFilter[x] = new S3_NetworkFilter();
	$HostFilter[x]->Create("Filter name");
	$HostFilter[x]->SetType("host");
	$HostFilter[x]->AddStatus(y);
	
   where x= the total number of filters - 1, starting at 0
   e.g. The 2nd filter in the list - x=1
   y= the status to add, as defined in the list below:
   
     0 = up
     1 = down
     2 = network errors
     3 = degraded metrics (1 or more services are not OK)

   Repeat the AddStatus() line for every status you want to add to the filter.

3. BOTH

   These are a new type of filter available in NLG 1.0.6, and are a mixture of
   the above 2 filter types.  For the filter to apply, both hostname and status
   conditions must match (i.e. an AND rule is applied to each host.)
   
   To define a status-specific filter, in server/sync-files/s3_filter.inc.php:
   
	$HostFilter[x] = new S3_NetworkFilter();
	$HostFilter[x]->Create("Filter name");
	$HostFilter[x]->SetType("both");
	$HostFilter[x]->AddHost("Host name");
	$HostFilter[x]->AddStatus(y);
	
   where x= the total number of filters - 1, starting at 0
   e.g. The 2nd filter in the list - x=1
   Replace "Host name" with the name of the host, as defined in Nagios.
   y= the status to add, as defined in the list below:
   
     0 = up
     1 = down
     2 = network errors
     3 = degraded metrics (1 or more services are not OK)

   Repeat the AddStatus() and/or AddHost() line for every host/status you want 
   to add to the filter.
   
   e.g. Imagine you want a filter that says "Routers - Up", and Router-1 and
   Router-2 are the host definitions in Nagios:
   
	$HostFilter[x] = new S3_NetworkFilter();
	$HostFilter[x]->Create("Routers - Up");
	$HostFilter[x]->SetType("both");
	$HostFilter[x]->AddHost("Router-1");
	$HostFilter[x]->AddHost("Router-2");
	$HostFilter[x]->AddStatus(0);
	
    When NLG applies the filter, it will only apply the filter to Router-1 and
    Router-2 if their status is also 0 (up.)
    Because any other hosts are not called Router-1 or Router-2, the filter will
    not include them.  Similarly, it will not apply the filter to other hosts 
    with status 0 because they're not called "Router-1" or "Router-2".