wiki:Obsolete/Doc/Monitoring/Lemon

Version 5 (modified by /C=BE/O=BEGRID/OU=VUB/OU=IIHE/CN=Stijn De Weirdt, 17 years ago) (diff)

--

Lemon description

short lemon description + links here

Agent configuration

A basic agent are configured by enabling them in the machine-types/base. Additional monitoring is added in the specific base-types.

To enable the agents, set

variable LEMON_CONFIGURE_AGENT = true;

There are also a number of site specific variables that need to set:

## Name of the lemon server
variable LEMON_SERVER_HOSTNAME = undef;

## Set the email address for receiving the exception notifications
variable LEMON_ALARM_MAIL = undef;

Additional variables (with the default options) can be

## The port to contact the lemon server
variable LEMON_CLIENT_PORT ?= 12409;

## The transport protocol used (UDP or TCP)
variable LEMON_TRANSPORT_PROTOCOL ?= 'UDP';

Extra

More than one lemon server

The default setup assumes a single lemon server (variable LEMON_SERVER_HOSTNAME). In case you want to add multiple servers, you need to add a new one to /system/monitoring/transport (see monitoring/lemon/client/base/config for the example).

Server configuration

The lemon server consits of an information collector and the webinterface (called LRF). Lemon supports 2 main types of information storing (using flatfiles or using Oracle). Currently only Oracle support is provided (but for the people with no access to an Oracle installation, the setup using OracleXE is provided).

Backend configuration

The backend is set using

## use OraMon or flatfile
variable LEMON_BACKEND ?= 'OraMon';

Oracle / OraMon

When using orcale as a backend, some oracle specific parameters need to be set:

## name of database to use
variable ORAMON_ORACLE_DATABASE_NAME ?= 'XE';
## 
variable ORACLE_HOME ?= '/usr/lib/oracle/xe/app/oracle/product/10.2.0/server';

## Local installation using XE or not
## (If true, don't forget the manual post-install steps!)
variable ORACLE_XE_LOCAL_INSTALL ?= true;

## Oracle user (must be created in oracle manually!)
## (this is not necessarily the same unix username that runs lemon services)
variable ORAMON_ORACLE_USER ?= 'lemon';
## Oracle password for this user
variable ORAMON_ORACLE_PASSWD ?= undef;

If you don't use/want a local XE installation, set ORACLE_XE_LOCAL_INSTALL to false and configure the oracle TNS (example for GRIF):

variable CONTENTS_ORACLE_TNS ?= <<EOF;
# tnsnames.ora Network Configuration File:
ccora10gtaf.in2p3.fr =
   (DESCRIPTION =
     (ADDRESS=(PROTOCOL=TCP)(HOST=ccdbcl01.in2p3.fr)(PORT=1521))
     (ADDRESS=(PROTOCOL=TCP)(HOST=ccdbcl02.in2p3.fr)(PORT=1521))
     (LOAD_BALANCE=yes)
     (CONNECT_DATA=
          (SERVER=DEDICATED)(SERVICE_NAME=ccora10gtaf.in2p3.fr)
          (FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC)
          (RETRIES=180)(DELAY=5))
    )
  )
EOF

flatfile

Nothing yet

LRF

The webinterface to lemon uses php and access to the backend. It also needs to know what machines to expect and based on their properties, how to group them. This is (for now) done with a nlist called NODES_PROPS. A basic example is

variable NODES_PROPS  = nlist(
	escape("mon.example.com"),nlist('type','MON','monitoring','yes'),
);

The name of the template that sets this variable is controlled through

variable LEMON_NODES_PROPERTIES_TEMPLATE ?= 'pro_nodes_properties';

The default value (ie the behaviour in case it's not defined) for the 'monitoring' is controlled through

variable LEMON_NODES_PROPERTIES_DEFAULT_MONITORING ?= 'yes';

NODES_PROPS example

An example used at IIHE to generate the monitoring part of NODES_PROPS

template site/lemon_nodes;

## in case of missing monitoring field 
variable LEMON_NODES_PROPERTIES_DEFAULT_MONITORING = 'yes';

## manual list, is respected when autocompleting
variable NODES_PROPS  = nlist(
	escape("egon.iihe.ac.be"),nlist('type','MON'),
);	

## list for order (first match is ok)
variable LEMON_PROPS_REGEXP_TYPE = list('WN','SE_DISK','CE','NFS');
variable LEMON_PROPS_REGEXP_MAP = nlist(
	'MON','XXXXX',
	'WN','node',
	'SE_DISK','behar',
	'CE','gridce',
	'NFS','fileserv',
);


### autocomplete this list based on DB_MACHINE and regexp
variable NODES_PROPS = {
	tmp = NODES_PROPS;
	dbm = DB_MACHINE;
	
	ok = first(dbm, k, v);
	while (ok) {
		if (exists(NODES_PROPS[k])) {
			ok = next(dbm, k, v);
		} else {
			mach = unescape(k);
			mach_to_use = mach;
			if (LEMON_SHORTHOSTNAME) {
				m = matches(mach,'([^\\.]+)(\..*)?');
				mach_to_use = m[1];
			};
			regs_order = LEMON_PROPS_REGEXP_TYPE;
			ok2 = first(regs_order, k2,v2);
			while (ok2) {
				if (exists(LEMON_PROPS_REGEXP_MAP[v2])) {
					reg = LEMON_PROPS_REGEXP_MAP[v2];
					if (match(mach,reg)) {
						tmp = merge(tmp,nlist(escape(mach_to_use),nlist('type',v2)));
						ok2 = false;
					} else {
						ok2 = next(regs_order, k2,v2);
					};
				};
			};
		
			ok = next(dbm, k, v);
		};
	};
	
	return(tmp);
};

Server post-install