Translations of this page:

Osmius

Osmius agent for web http://www.w3.org/Protocols/
Agent name: osm_ag_WEB00001 Agent code: WEB00001
Subject: User Manual for Osmius WEB Agent
Date: 15/02/2010 Revision date: -/-/-

General Information

This agent can monitor several parameters of a web source. It has been tested with real webs. However, we recommend checking its functionality before implanting it in a production environment.

This WEB agent has been developed using functionalities and enhancements of Osmius framework and ACE libraries, so it is necessary to install the ACE libraries for the proper deployment and operation of agente de Osmius para web. See chapter: installation.

As well, Osmius WEB agent uses libcurl library. You have to install the library. See: Prerequisites

This WEB00001 agent provides up to cinco basic events with configuration parameters to allow scaling of a very simple way. Events have been selected by the Research and Development Osmius Team as the most interesting for this first development.

All events are remote, so not intrusive. Monitoring is done through the network connection, by this reason you have to provide some connection information, see, y están basados en consultas a servidores accesibles a través de una red. The agent checks the information returned by the server and prepares a response.

Instancia WEB

As a general rule each Osmius agent can monitor one instance type. If you are not familiar with these concepts check out the glossary. Each instance is individually defined in the configuration file (if you want further information go to agents and instances); depending on agent type is the instance type and depending on instance is the connection info.

CONNECTION_INFO

The connection information or connection_info is data that the agent needs to know to connect to the instance. (See more about the connection_info)

In this WEB agent the connection_info prototype would be:

CONNECTION_INFO= -u URL [-p PORT] [-c ignore] [-s USER:PASSWORD]

Replace the following:

  • URL: URL to monitor. Mandatory.
  • PORT: Communication port to use. Optional.
  • ignore: use this option to ignore server certificates. Optional.
  • USER:PASSWORD: to web basic authentication. Optional

Examples:

CONECTION_INFO = -u osmius.net
CONECTION_INFO = -u https://myhttpserver.com -c ignore
CONECTION_INFO = -u localhost -p 8080 -s user2:pass2

OBSERVATION:

If you don't set any port number, Osmius Agent uses the default port for each protocol.
If you don't set "-c ignore" Osmius Web agent will check server certificate with the most common CAs.

TYPE

The type defines the instance type to be monitored. Every declared instance must be associated with a type as you can see here

In this case:

TYPE= WEB00001

Event summary table for WEB

Here is briefly the capabilities of this agent, further down on this page each event is described in more detail.

EVENT DESCRIPTION c w a tseconds Extra parameters / Remarks
AVAILABL Web Availability 1 0 0 60 [-E minimum_code] [-R minimum_size]
Silent mode ( -s) recommmended
WEBLTIME Time to download in ms 0 1000 3000 300 [-D 0 (total time) ó -D 1 (transfer time)]
Silent mode ( -s) recommmended
WEBSPEED Download speed 1 2048 1024 300 [-U 0 (B/s) ó -U 1 (KB/s)]
Silent mode ( -s) recommmended
WEBDSIZE Download size (default unit: bytes) 1 500 500 300 [-U 0 (B) ó -U 1 (KB)]
Silent mode ( -s) recommmended
WEBSTEXT Search regular expressions. Values: 1= Match; 0= Not found 1 0 0 300 -S “pattern_to_find” [-N “pattern_to_exclude” -K {0|1(case sensitive mode ON)}]
Silent mode ( -s) recommmended

Information Events

Info events retieve general data about instance, usually this data does not change over time. This kind of events have no severity, simply provides instance details.

EVENT DESCRIPTION tseconds Remarks
WEBINFIP IP direction 43200 (12 hours) IP where is the web
WEBINFUR last url visited 43200 (12 hours) Last URL

WEB agent Events

AVAILABL

This AVAILABL event checks if exist connection with the web.
It opens a connection with the server and checks the server code returned, If the code is 200 the the web is available, not available in other case.

Extra parameters:
This event need extra parameters to work:

PARAMETER MEANING Mandatory
-E -E error_code.
minimum number of code allowed.
200 for default.
No.
-R -R bytes_received
This parameter defines the minimum amount of bytes expected in the download.
No.

Return values:

VALUE MEANING
-1 Error
0 NO available
1 AVAILABLE

Recommended parameters:

Comparison type Inverse. The lower value the higher severity (-c 1)
Monitoring interval 1 second – 1 hour –> depends on instance importance
Warning threshold 0
Alert threshold 0

Parameter setting example:

AVAILABL = -t 600 -c 1 -w 0 -a 0 -T "https of the enterprise web"

Remarks: Returns -1 when something were wrong, 1 when server code returned is minor than the code defined for the user (or 200 for default) and 0 other case.
The timeout for this event is 30 seconds.

WEBLTIME

This WEBLTIME event returns the Time to download the web source in ms.

Extra parameters:
This event accepts extra parameters:

PARAMETER MEANING Mandatory
-D -D 0 ó 1.
0 = the total time of the operation.
1 = total transfer time. Since the first byte until the last one.
0 for default→ Total time.
No.

Return values:

VALUE MEANING
-1 Error
X Number of miliseconds

Recommended parameters:

Comparison type Direct. The higher value the higher severity (-c 0)
Monitoring interval 5 seconds – 1 hour –> depends on instance importance
Warning threshold Depends on server capacities, propagation times of the network …
Alert threshold Depends on server capacities, propagation times of the network …

Parameter setting example:

WEBLTIME = -t 300 -c 0 -w 1000 -a 2000 -T "source X: response in ms"
WEBLTIME = -t 300 -c 0 -w 1000 -a 2000 -D 1 -T "source Y: transfer in ms"

Remarks: it is useful to monitor response times perceived by end users.
This value can change over time, we recommend test different values before assign definitive values for warning and alarm thresholds.
The timeout for this event is 30 seconds.
If the operation is not completed or the timeout is exceeded the return value is 29,000 ms.

WEBSPEED

This WEBSPEED event returns the download speed of the web source.

Extra parameters:
This event accept extra parameters:

PARAMETER MEANING Mandatory
-U -U 0 ó 1.
0 = download speed in bytes per second (B/s).
1 download speed in kilobytes per second (KB/s)
0 for default → B/s.
No.

Return values:

VALUE MEANING
-1 Error
X Download speed

Recommended parameters:

Comparison type Inverse. The lower value the higher severity (-c 1)
Monitoring interval 5 seconds – 1 day –> depends on instance importance
Warning threshold X - Depends
Alert threshold Y - Depends

Parameter setting example:

WEBSPEED = -t 300 -c 1 -w 12000 -a 10000 -T "downloading from blabla.net"
WEBSPEED = -t 300 -c 1 -w 12 -a 10 -U 1 -T "KB/s from blabla.net"

Remarks: Remarks: it is useful to monitor response times perceived by end users.
This value can change over time, we recommend test different values before assign definitive values for warning and alarm thresholds.
The timeout for this event is 30 seconds.
If the operation is not completed or the timeout is exceeded the return value is 29,000 ms.

WEBDSIZE

This WEBDSIZE event returns the download size of the web source.

Extra parameters:
This event accepts extra parameters

PARAMETER MEANING Mandatory
-U -U 0 ó 1.
0 = size in bytes (B).
1 = size in kilobytes (KB)
0 for default → B.
No.

Return values:

VALUE MEANING
-1 Error
X Download size

Recommended parameters:

Comparison type Direct or Inverse. The higher/lower value higher/lower severity (-c 0 ó 1)
Monitoring interval 5 seconds – 1 day –> depends on instance importance
Warning threshold X - Depends
Alert threshold Y - Depends

Parameter setting example:

WEBDSIZE = -t 300 -c 1 -w 4096 -a 4096 -T "bytes downloaded"
WEBDSIZE = -t 300 -c 1 -w 4 -a 4 -T "KB downloaded" -U 1

Remarks: If there is not changes in the source this event will be constant, so you can use it to detect web source changes.

WEBSTEXT

This WEBSTEXT event search regular expressions in the data returned by the server.

Extra parameters:
This event need extra parameters to work:

PARAMETER MEANING Mandatory
-S -S “pattern_to_search”.
This parameter defines the regular expression we want to search.
Regular expressions have to be in POSIX syntax. See - POSIX.
Yes.
-N -N “pattern_to_exclude”.
This parameter defines the regular expression we want to exclude of the search. If there are the patter_to_search (-S) and the pattern_to_exclude (-N) in the same line of the text, this match is not returned.
Regular expressions have to be in POSIX syntax. See - POSIX.
No.
-K -K {0|1} This parameter defines case sensitivity.
0 = case sensitivity OFF, two words are different based on differing use of uppercase and lowercase letters.
1 = case sensitivity ON.
1 for default.
No.

Return values:

VALUE MEANING
-1 Error
0 No matches
1 YES matches

Recommended parameters:

Comparison type Direct or Inverse. The higher/lower value higher/lower severity (-c 0 ó 1)
Monitoring interval 300 seconds – 1 day –> depends on instance importance
Warning threshold X - Depends
Alert threshold Y - Depends

Parameter setting example:

WEBSTEXT = -t 300 -c 1 -w 0 -a 0 -S "^Normal" -N "H.*1?" -K 1 -T "normalidad en serv.xxx"

Remarks: Play with the Comparison type to get different results.

Prerequisites of the WEB agent

In order to compile, this agent requires a set of prerequisites, which are generic to compile any Osmius agent, you can see these prerequisites.

With this agent we need libcurl and regex libraries.

LIBCURL

For the Unix-like platform is easy:

For example:

REGEX

For the Unix-like platform is easy.

For windows platform:

You can download GNUwin32 regex from http://gnuwin32.sourceforge.net/packages/regex.htm and

1) Unzip in a folder named regex, for example.
2) Copy regex\include\regex.h in Visual C folder.
3) Copy regex\lib\* in Viual C libraries folder.
4) Make regex\bin\regex2.dll accessible in your PATH environment variable 

Makefiles y compilación del agente de WEB

  • Make Project Creator (MPC) is used by Osmius, so creating Makefiles is a trivial task. If you want to learn more about MPC and Osmius check out the section of Makefiles on Osmius.
  • To WEB agent you can generate Makefile in this way:

Modify .mpc file:

// -*- MPC -*-
// $Id$
project(*Osmius) : aceexe {
  exename = osm_ag_WEB00001
  install = $(OSM_ROOT)/bin
  
  //¿Where is regex?
  //includes += C:\osmius\osmius\ext\regex\include
  //libpaths += C:\osmius\osmius\ext\regex\lib
  libs     += regex
  
  //¿Where is curl?
  //includes += /ruta_a/curl/include
  //libpaths += /ruta_a/curl/lib
  libs   += curl
  
  Source_Files {
   ./../../cm/osm_cfgmanager.cpp
   ./../../cm/osm_message.cpp
   ./../../cm/osm_reactor.cpp
   ./../../ag/osm_ag_insmanager.cpp
   ./../../ag/osm_ag_msgmanager.cpp
   ./../../ag/osm_agent_basic.cpp
   osm_ag_web.cpp
  }
  Header_Files {
   ./../../cm/osm_cfgmanager.h
   ./../../cm/osm_message.h
   ./../../cm/osm_reactor.h
   ./../../ag/osm_ag_insmanager.h
   ./../../ag/osm_ag_msgmanager.h
   ./../../ag/osm_agent_basic.h
   osm_ag_web.h
  }
}

From the agent directory using console or terminal.

To Linux:

$ACE_ROOT/bin/mpc.pl -type make osm_ag_web.mpc

To HP-UX / Solaris:

$ACE_ROOT/bin/mpc.pl -type gnuace osm_ag_web.mpc

To Windows with Visual C 8:

%ACE_ROOT%\bin\mpc.pl -type vc8 osm_ag_web.mpc
  • Now that you have created the Makefile, agent compiling is extremely simple.

To Linux:

make -f Makefile.Osm_Ag_Web_Osmius

To HP-UX:

gmake -f Makefile.Osm_Ag_Web_Osmius

To Windows:

Double click in Osm_Ag_Web.vcproj and the project will be opened in Visual Studio.
Choose Release in the configuration.
Rebuild to compile.

Binaries are automatically installed in the bin directory of OSM_ROOT base directory.

Running the WEB agent

This WEB agent has the same running features of the other Osmius agents. You can check it out int he section Start and Stop Agents.

To run the agent without Osmius web console:

osm_ag_WEB00001[.exe]1) -c osm_ag_WEB00001.ini -m MASTERAG -p 1950 -d [>> osm_ag_web00001.log]2)

Running in standalone mode

Osmius WEB agent, like the others Osmius agents, allows the execution in standalone mode. This option may be particularly useful when developing a new agent or to perform specific agent tests.

Basically you have to add a new value, called SNDCMD, to Osmius agent configuration file agente de Osmius para WEB (osm_ag_WEB00001.ini) as shown here.

Then you must run the agent setting Master Agent communications port to zero, for example:

osm_ag_WEB00001[.exe] -c osm_ag_WEB00001.ini -m 00000000 -p 0 -d

Tests list

Test performed to agent de Osmius para WEB.

Date: 03/06/2011
Test Result Remarks
Creating an instance with all its events in silent mode OK N/A
Creating an instance with all its events with custom text OK N/A
Creating an instance with all its events but no custom text OK N/A
Declaration of 3 instances with all its events to 5 seconds and keep it
running for 48 hours
OK N/A
Declare 2 instances, cause a disconnect and then reconnectOK N/A
Declare 1 instance and test each event OK N/A
Elimination of general parameter and check unbootable OK N/A
Elimination of instance CONN_INFO and check unbootable OK N/A

ANEXO

Sintaxis POSIX

For the osmius Logfile agent to understand regular expressions you must use POSIX to define those REGEX into the -S and -N parameters. Here you can peruse the most important ones:

Symbol Definition Example
| OR Operator osm|ius matches “osm” o “ius”
. one character . matches “1”, “c”, “@”, “P” …
* 0 or more times the preceeding character osm* matches “os”, “osm”, “osmm”, “osmmm” …
? 0 or 1 times the preceeding character osm? matches “os” y “osm”
+ 1 or more times the preceeding character osm+ matches “osm”, “osmm”, “osmmm”, “osmmmm”
x{m,M} x at least m times and maximun M times osm{1,3} matches “osm”, “osmosm”, “osmosmosm”
^ Starting Line position ^osm matches osm at the begining of the line
[] Matches one of the characters
between the brackets
[md]ail matches “tail” and “fail”
[^] Matches with one of the characters NOT
one of the chars between the brackets
[^osm] matches every single character except “o”, “s” o “m”
$ Position at the end of the line osmius$ matches “osmius” at the end of the line

More info in the wikipedia

1) .exe in windows
2) Optional, to store agent messages in a file
 
en/agentes/web00001.txt · Last modified: 2012/12/05 19:24 by osmius
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki