and another set of parameters defined by the programmer called extra Instances are the elements we want to monitor. Osmius agents need to gather some information to performs these monitoring tasks.
Instance declaration is how to define an instance in the configuration files.
<descriptor>: it is an alphanumeric string that identifies the instance. Its lenght can change between 3 and 16. Descriptor must be unique and can not be repeated to identify any other instance in the configuration file of the agent.
Connection_Info: is the minimum inforamtion that must be supplied to connect to the instance.
CONNECTION_INFO= <agent specific>
Connection_info may be empty when agents is monitoring local instances (same machine), or have data as username and password, when the agents need to access to provate instances, as IP address and port, when agents need to connect a network place …
It reports the insttance type that we want to monitor.
TYPE= <agent specific>
Each Osmius event has several configuration parameters called standard, and another set of parameters defined by the programmer called extra. Standard parameters can be used in all Osmius events and are the following:
Syntax: -t n, where n is the number of seconds that will define the monitoring interval; every n seconds event will be called. This parameter is mandatory.
Syntax: -c 0 or -c 1; 0 means the higher value the higher instance severity and 1 means the inverse, the lower value the higher instance severity. Not mandatory.
Syntax: ”-w N”, where N is the value of warning threshold. Not mandatory.
Syntax: ”-a M”, where M is the value of alarm threshold. Not mandatory.
When we put -s silent mode is activated. If not declared the silent mode is off.
When silent mode is on, events will be sent only when a severity level change happens, if silent mode is off every event will be sent always, no exception. In order to activate it we must assign a value other than 0. The value of s indicates the number of severity changes that must ocurr to send the event.
This is specially useful as a buffer system to avoid false positives.
Syntax: -T “string”, where string can be replaced by what we want to use as custom text.Not mandatory.
Monitoring the number of processes in an HP-UX every 5 minutes in silent mode, custom text and increasing severity: HPNUMPRC = -s -t 300 -c 0 -w 100 -a 300 -T "HP-UX processes from Data Center 2" Monitoring HP-UX uptime every 5 minutes: HPUPTIME = -t 300 -c 1 -w 180 -a 60
Every Osmius event is associated with one of the following severity levels:
0 – Information 1 – Warning 2 – Alarm 99 – Error
in order to compile agent you need at least the following:
Not yet defined.
You can download it from: http://download.dre.vanderbilt.edu/
Once downloaded, unzip and read the build instructions: ACE_INSTALL or ACE-INSTALL.html files
Here you can find more information about ACE: http://www.cs.wustl.edu/~schmidt/ACE.html
ACE Forum: http://groups.google.com/group/comp.soft-sys.ace
Check the section of manual installation for further details.
MPC is distributed with ACE, and allow us to generate makefiles for different platforms and compilers using really simple configuration files. “Script once… and build many”.
More MPC information at: http://www.ociweb.com/products/mpc
We will need some Osmius central engine source files for compiling any agent. In particular cm and ag folders.
You can dowload the source code at: http://sourceforge.net/projects/osmius
We must download and unpack the agent, then we must define an environment variable OSM_ROOT, pointing to our Osmius base directory.
We will find a MPC file for each agent, it is called osm_ag_XXXXXXXX.mpc and it is located in each agent directory (OSM_ROOT\agents\ag_xxxxxxxxxx), review and see how easy it is. It basically contains the dependent file names for this agent. From one agent to another (if no additional libraries are required) the only change is the name of its own .h and .cpp.
To generate a Makefile for our platform and compiler is simple. It could be something like:
From the agent directory
$ACE_ROOT/bin/mpc.pl -type make osm_ag_xxxxxxxx.mpc
From Windows console for Visual C 8:
ACE_ROOT\bin\mpc.pl -type vc8 osm_ag_xxxxxxxx.mpc
$ACE_ROOT/bin/mpc.pl -type gnuace osm_ag_xxxxxxxx.mpc
Now we can compile it using the resulting Makefile of MPC.
make -f Makefile.Osm_Ag_xxxxxxxx_Osmius
gmake -f GNU.makefile.Osm_Ag_xxxxxxxx_Osmius
Double click over Osm_Ag_xxxxxxxx_Osmius.vcproj and the project will be opened with Visual Studio. In Solution configurations you must select Release. Click on Rebuild to compile.
=> -c: path to configuration file (osm_ag_XXXXXXXX.ini). Mandatory. => -p: Master Agent communication port. Mandatory. => -m: Master Agent identifier that is associated with the agentIdentificador del Agente Maestro al que está asociado el agente, coded with 8 alphanumeric characters. Mandatory. => -d: Debug mode. Print more information, useful for debugging. Optional. => -h: Display help. Optional.
A typical example:
osm_ag_XXXXXXXX[.exe] -c osm_ag_XXXXXXXX.ini -m YYYYYYYY -p 1950 -d >> osm_ag_xxxxxxx.log
Oftenly, Osmius agents will be executed by the Master Agent, so you don't have to worry about starting, unless you want to run them in Standalone mode.
You can stop Osmius agents as follows:
=> Ctrl + C if process is not in background => On Linux and similar systems: kill -SIGINT of process => On Windows you will have to use Task Manager to stop it.
You can run Osmius agents independently, with no connection with a Master Agent. In this way you don't have to run Osmius central server or database.
Howewer, if you choose this method you won't have all the features that Osmius console offers, such as data analysis. The results of events are not stored in the Osmius central server historical database. This method can be very useful for tests.
If you want to use standalone mode you must change the agent configuration file (.ini), you must add a new value called SNDCMD in the overall agent configuration, pointing to a script, which will be executed whenever the Osmius agent retrieves an event.
SNDCMD = C:\osmius\osmius\bin\osm_send_cmd.bat (Windows) or SNDCMD = /home/osmius/osmius/bin/osm_send_cmd.sh (Unix-like)
Then when you go to run the agent set to zero the Master agent port parameter (-p 0)
osm_ag_XXXXXXXX[.exe] -c osm_ag_XXXXXXXX.ini -m 00000000 -p 0 -d