| Osmius agent for Red de Sensores de Pachube | |
|
| Agent name: osm_ag_PACHUBE1 | Agent code: PACHUBE1 | |
| Subject: | User manual agente de Osmius para red de sensores Pachube | |
| Date: 12/04/2011 | Revision date: | |
Pachube is an open sensor network where every one can store measurements to and read from their own sensors or from others. Using a Pachube account you can create, update and position data, and use Pachue Keys to manage public or private access to real time or historic information.
With this initiative we provide Osmius with the capability of monitoring a huge amount of distributed and localized sensors, entering this way into “the internet of the things” field. The Osmius and Pachube cooperation allows user to create sensors (such as temperatures, radiation levels, energy consumptions, etc) and read them from Osmius and because of that use thresholds, alarms, notifications and check and define SLA.
Pachube 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 Linux. See chapter: installation.
The PACHUBE1 agent provides up to 10 basic events with configuration parameters to allow scaling of a very simple way.
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 connection info section below.
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.
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)
The connection_info prototype would be:
CONNECTION_INFO= -k PACHUBE_KEY
Replace the following:
Examples:
CONECTION_INFO = -k gi_tHyY73U5hcX_1-1yRJMO4QOfca-XP1K7-7wl0Qb4
OBSERVATION: Take a look to Pachube documentation about master and secondary keys.
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 particular case:
TYPE= PACHUBE1
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 |
|---|---|---|---|---|---|---|
| PSENS001 | Queries the value of a datastream from a specific Pachube feed | 0 | 100 | 200 | 300 | -F “feedID” [-D datastream] [-K pachube_key] This event uses the Pachube REST api There are ten different events for the user to create: from PSENS001 to PSENS010. |
Returns the numeric value from the datastream within the Pachube feed in the event parameters. The text if the event is filled with the location of the feed if any.
Return values:
| VALUE | MEANING |
| N | Datastream Value |
Extra parameters:
| PARAMETER | MEANING | Mandatory |
| -F | -F feedID - Feed Unique Identifier Identificador | Yes |
| -D | -D datastream - Datastream if within the feed we wanto to monitor from. Defaults to “0”. | No |
| -K | -X pachube_key - Pachube key to override the key at the instance level | No |
Recommended parameters:
| Comparison type | Direct or Inverse. Depends on instance importance |
| Monitoring interval | 300 – 1 hour –> depends on instance importance |
| Warning threshold | 100 → depends on the datastream |
| Alert threshold | 200 → depends on the datastream |
Parameter setting example:
PSENS001 = -t 600 -c 0 -w 100 -a 150 -T "Sensor 1 Radiation in Japan" -F 21222
Remarks:
This agent uses CUrl libraries.
In order to compile, this agent requires a set of prerequisites, which are generic to compile any Osmius agent, you can see these prerequisites. This agent also uses libCurl development libraries.
From the agent directory using console or terminal.
$ACE_ROOT/bin/mpc.pl -type gnuace osm_ag_pachube.mpc
make -f GNUmakefile.Osm_Ag_Pachube_Osmius
Binaries are automatically installed in the bin directory of OSM_ROOT base directory.
The Pachube agent have 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 the Osmius web console:
| osm_ag_PACHUBE1 -c osm_ag_PACHUBE1.ini -m MASTERAG -p 1950 -d [>> osm_ag_pachube1.log]1) |
The Osmius Pachube 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 for Pachube (osm_ag_PACHUBE1.ini) as shown here.
Then set the Master Agent communications port to zero, for example:
| osm_ag_PACHUBE1 -c osm_ag_PACHUBE1.ini -m 00000000 -p 0 -d |
Test performed to agent Osmius for Pachube
| Date: | 12/04/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 |
| Declare de 3 instances with all the events to 10 seconds running for 48 hours | OK | N/A |
| Declare 2 instances, cause a disconnect and then reconnect | OK | N/A |
| Declare 1 instance and test each event | OK | N/A |
| Elimination of general parameter and check unbootable | OK | Removed RECONN |
| Elimination of instance CONN_INFO and check unbootable | OK | N/A |