Translations of this page:

Osmius

Osmius agent for VMware via SSH vmware_logo.jpg
Agent name: osm_ag_VMWARE01 Agent code: VMWARE01
Content: VMware virtual machines via SSH Osmius agent user manual
Date: 11/01/2010 Revision date:

General Information

This agent can monitor various parameters of VMware virtual machines via SSH. It has been tested in different environments. However, we recommend checking its functionality before implanting it in a production environment.

VMware via SSH 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 Linux via SSH Osmius agent. See chapter: installation.

In addition, we have used LIBSSH2 library to develop this agent, if you are planning compile this agent by yourself, you have to install it before. Take a look to prerequisites section.

VMWARE01 agent provides up to 3 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 connection information. Events are based on remote command execution through ssh session. You need ssh service available on monitoring target machine and you also must know login credentials.

NOTE:
This agent uses the vmware-cmd command to do monitoring tasks.
The first appearance of this command is documented in version 2.1 of VMware.

VMware via SSH Instance

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

For VMware via SSH Osmius agent the connection_info prototype would be:

CONNECTION_INFO= -h HOST -u USER -p PASSWORD -m VM_NAME

Replace the following:

  • HOST: IP address or host name of VMware target system. Mandatory.
  • USER: SSH access granted username. Mandatory.
  • PASSWORD: password for user specified above. Mandatory.
  • VM_NAME: Virtual machine name to monitor. Mandatory

Examples:

CONECTION_INFO = -h osmius.net -u username -p pass -m vm1
CONECTION_INFO = -h 123.123.123.123 -u useralpha -p passalpha -m webserver

OBSERVATION: For security reason only 22 port is allowed.

TYPE

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

For VMware via SSH:

TYPE= VMWARE01

Event summary table for Linux via SSH

Here's 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
VMSTATUS Virtual machine status
- 0: Unknown or wrong state
- 1: Off
- 2: Suspended
- 3: On and running
1 2 2 60 Silent mode ( -s) recommmended
VMHEARTB Virtual machine heartbeat 1 0 0 60 Silent mode ( -s) recommmended
VMUPTIME Time measured in seconds since last (re)boot 1 600 300 300 Silent mode ( -s) recommmended

VMware via SSH agent events

VMSTATUS

VMSTATUS event returns actual virtual machine state.

Return values:

VALUE MEANING
-1 Error
0 Unknown and/or wrong state
1 Off
2 Suspended
3 On and running

Recommended parameters:

Comparison type Inverse. The lower value the higher severity (-c 1)
Monitoring interval 60 seconds – 1 hour –> depens on instance importance
Warning threshold 2
Alert threshold 2

Parameter setting example:

VMSTATUS = -t 300 -c 1 -w 2 -a 2 -T "VM status"

Comment: This event uses “vmware-cmd” command. Be careful with changes and feed back us. Anyway this is free software so you can make the appropriate changes to suit your needs.

VMHEARTB

VMHEARTB event returns difference between virtual machine heartbeats.

Return values:

VALUE MEANING
-1 Error
X Heartbeats increment

Recommended parameters:

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

Parameter setting example:

VMHEARTB = -t 300 -c 1 -w 0 -a 0 -T "heartbeats increment"

Comment: This event uses “vmware-cmd” command. Be careful with changes and feed back us. Anyway this is free software so you can make the appropriate changes to suit your needs.

VMUPTIME

VMUPTIME returns virtual machine uptime in seconds.

Return values:

VALUE MEANING
-1 Error
X Uptime in seconds

Recommended parameters:

Comparison type Inverse. The lower value the higher severity (-c 1)
Monitoring interval 60 seconds – 1 hour –> depens on instance importance
Warning threshold 600 - depends on monitoring interval
Alert threshold 300 - depends on monitoring interval

Parameter setting example:

VMUPTIME = -t 300 -c 1 -w 600 -a 300 -T "Uptime in seconds"

Comment: This event uses “vmware-cmd” command. Be careful with changes and feed back us. Anyway this is free software so you can make the appropriate changes to suit your needs.

VMware via SSH agent prerequisites

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

LIBSSH2 libraries are needed for the platform where you want to compile the agent. It is also necessary access through SSH to the target system.

LIBSSH2

For Unix-like platforms is easy to find and install this packet.

We have done it manually and the steps are the following:

  • Download code from http://www.libssh2.org/
  • Configure: “configure –with-openssl”
  • Compile: “make”
  • Check: “make check”
  • Install: “make install”
  • Move “libssh_config.h” file to the directory with akk libssh2 includes, by default /usr/local/include/libssh2

Windows sytems, shortly be written instructions to guide the compilation.

SSH

Also you need to access the system via SSH to monitoring. \ \ Make sure you have valid credentials to access via SSH.

VMWARE-CMD

Verify the existence of the executable “vmware-cmd” and add the path to PATH environmental variable.

VMware via SSH agent makefiles and compilation

  • 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.
  • In the particular case of VMware via SSH Osmius agent you can easily generate Makefile as follows:

Modify osm_ag_vmware.mpc file to set libraries and includes paths:

// -*- MPC -*-
// $Id$
project(*Osmius) : aceexe, ace_openssl {
  exename = osm_ag_VMWARE01
  install = $(OSM_ROOT)/bin
  libout  = $(OSM_ROOT)/lib
  after  += ACE_SSL_lib
  libs   += ACE_SSL

  includes +=/usr/local/include/

  libpaths += /usr/local/lib/
  libs   += ssh2

  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_libssh2_exec.c
   osm_ag_vmware.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_libssh2_exec.h
   osm_ag_vmware.h
  }
}

From the agent directory using console or terminal.

$ACE_ROOT/bin/mpc.pl -type make osm_ag_vmware.mpc
  • Now that you have created the Makefile, agent compiling is extremely simple.
make -f Makefile.Osm_Ag_Vmware_Osmius

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

Run VMware via SSH agent

VMware via SSH 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 VMware via SSH agent without Osmius web console:

osm_ag_VMWARE01 -c osm_ag_VMWARE01.ini -m MASTERAG -p 1950 -d [>> osm_ag_vmware.log]1)

Running in standalone mode

Linux via SSH Osmius 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 VMware via SSH Osmius agent configuration file (osm_ag_VMWARE01.ini) as shown here.

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

osm_ag_VMWARE01 -c osm_ag_VMWARE01.ini -m 00000000 -p 0 -d

Tests list

Performed test for VMware via SSH Osmius agent.

Date: 18/12/2009
Test Results Comment
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
- 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 PORTCM erased
Elimination of instance CONN_INFO and check unbootable OK N/A
1) Opcional, para guardar un fichero con los mensajes que pueda devolver el agente
 
en/agentes/vmware01.txt · Last modified: 2012/12/05 19:26 by osmius
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki