Pandora 3.0: Documentation ja: Monitorizacion VMware

From Pandora FMS Wiki
Jump to: navigation, search

Pandora FMS ドキュメント一覧に戻る

1 WMware 環境のモニタリング

With Pandora FMS, it is possible to monitor virtualized environments with VMWare through one plugin, which is specifically created to extract information from the VMWare vCenter. Pandora FMS is able to extract both from the ESXi servers and from the virtual systems that are located in them.

Through this plugin, it is possible to get information like: free disk percentage, CPU usage and RAM memory, information about network interfaces, uptime, alert status, and more...

1.1 モニタする WMware アーキテクチャ

With this system, it's possible to monitor architectures as the one that is shown in the following sketch:

Esq arq vmware.png

It is possible to see that in the sketch we can have so many ESXi servers as we need, and also, in ech ESXi server we can have as many virtual machines as we need. Also, it will be necessary to have a vCenter Server server, so it is the one that centralizes all the resources and send the data through datacenters.

1.2 インストールに必要なもの

Before installing the vSphere SDK for Perl, we should install some dependencies. If it would be any problem during the installing of the dependencies previously mentioned, then it will be necessary to check the VMware guide in order to check that the installing process here mentioned is still working.

1.2.1 RedHat

In RedHat, we need to install the LibXML2 and the OpenSSL package to build, that is installed with the following command:

yum install openssl-devel libxml2-dev

1.2.2 SLES

For SLES, we need to have installed the OpenSSL package to build. We can install it with the following command:

yast -i openssl-devel

1.2.3 Debian/Ubuntu

In Debian/Ubuntu the following packages are needed:

libssl-dev perl-doc liburi-perl libxml-libxml-per libcrypt-ssleay-perl perl-doc

That we should install with this order:

sudo apt-get install libssl-dev liburi-perl libxml-libxml-perl libcrypt-ssleay-perl perl-doc

If we have a 64 bits, then we have to install the package additionally, as follows:

sudo apt-get install ia32-libs

1.3 VMware vSphere SDK のインストール

In order to install the SDK, the first thing to do is to download the last version available ( that at this moment is 4.1) from the VMWare:

http://communities.vmware.com/community/developer/downloads

Once that it is downloaded, unzip the package and execute the following command:

sudo perl vmware-install.pl

If it would be any problem while installing, both with the SDK or with the previous dependencies, then it will be necessary to follow the VMWare official documentation.

1.4 VMware Monitoring Plugin を使ったモニタリング

The Environment Monitoring with WMvare is based on two things:

  1. One recon task that is able to extract the ESXi host and the virtual machines that are availables through the VMWare vCenter.
  1. One plugin that gets the information to monitor as modules for each ESXi and virtual machine that has found in the recon task.

With this system we get a remote agent for any ESXi host or virtual machine found. This will allow us to manage them as independent things, not matter the links that are between them in the virtualizing architecture. And also, each agent will have the corresponding modules for its monitoring depending on if it would be ESXi or virtual machine.

  • NOTE: To use VMware plugin and the recon script activate pluginserver and reconserver is required.

1.4.1 プラグインの内部処理

As we have said before, the Pandora FMS WMware plugin extracts the information through the vCenter. In order to avoid an overload in the vCenter database, the plugin creates an intermediate buffer for each agent. This intermediate buffer consists on a file for agent host in the file /tmp that is updated every 300 seconds (5 minutes).This way, only one query will be done to the vCenter when the file will be too old.

  • NOTE: It's very important to consider that the files with name kind xxx_pandora_vmware.txt are used by the plugin to extract data. If these files are deleted the performance of the vCenter database could decrease.

1.5 プラグインの登録

1.5.1 pspz パッケージを使ったプラグインの登録

To register the VMware Monitoring Plugin we will use the authomatic plugin register through pspz packages. To do this, we should click Register plug-in in the submenu of the Manage Servers menu.

Register plugin menu.jpg

After this, we will see the following image, where we should choose the vmware-plugin.pspz file and press the Upload button.

Register plugin screen.jpg

If the operation is successful, then it will show the following screen to verify the operation.

Register plugin ok.jpg

If we press on the Manage plug-ins submenu from the Manage Server menú, we will check that the VMware Monitoring Plugin plugin will be shown in the plugins list.

Manage plugins menu.jpg

In the plugins list it will appear one field as the one that is shown in the following image showing that the VMware Monitoring Plugin is already installed.

Manage plugin screen.jpg

With this, we have registered the plugin that allow us to get info from the VMware architecture.

1.5.2 手動登録

If you want to register the plugin manually you must follow the section called Monitoring with Plugins

The values of the different fields are the following:

  • Name: VMware Monitoring Plugin
  • Plug-in Command: /var/www/pandora/attachment/plugin/vmware-plugin.pl (Path where vmware-plugin.pl file)
  • Plug-in type: Standard
  • Max. timeout: 300
  • IP address option: --server
  • Port option: <empty>
  • User option: --username
  • Password option: --password
  • Description: This plugin gets information of VMware vCenter.

NOTE : In order the VMware plugin extension works right, it's important that the plugin name would be exactly WMWare Monitoring Plugin

1.6 自動検出スクリプトの登録

Now we have to register the Recon Script that does the ESXi host and the virtual machines search. To do this, we have to select the Manage recon script submenu of the Manage Servers menu.

Recon script menu.jpg

Once we see the Manage recon script initial screen in the submenu, we have to press the Add button.

Recon script screen.jpg

After this, we will see the window to fill in the data of the new Recon Script', where we fill the data as in the example following. In the Script fullpath field, it is necessary to specify the interpreter or program with which the script will be executed (for us it will be Perl), and the full path where the script is located. Once the form is filled in, we should press on the Create .

Recon script screen filled.jpg

Once the script is registered, we will see one screen that will inform us of that the operation is working fine and it will show the script registered in the list.

Recon script screen ok.jpg

1.7 自動検出タスクの作成

To automatize the discovery of host and virtual machines of the VMware virtualized architecture to monitor, we should create a Recon Task that will be executed from time to time looking for new host and virtual machines that would be in this architecture. To create a Recon Task we have to press on the Recon Task submenu from the Manage Servers menu

Recon task menu.jpg

After doing this we will see the following image, that shows the Recon Taskgeneral view. In it we press on the Createbutton to create a new task.

Recon task screen.jpg

After pressing the Create button, it will show a form as the one of the following image. In it we should fill in the fields in an suitable way. In the field mode, it's important to select the Custon Script option, so it will allow us to select the script that we already registered in the previous step ( for us the VMware recon script) in the field Recon Script

Recon task screen filled.jpg

The Script field fields are reserved for the parameters of the script that we have registered. Specifically, the script for the VMware discovery needs the following compulsory fields:

  • server: IP of the server where the VMware vCenter is located.
  • username: User to have access to the vCenter.
  • password: Password to have access to the vCenter.
  • datacenter: Name of the datacenter to monitor.
  • pluginname:Name with which was registered the VMware plugin (in the authomatic register it's always the VMware Monitoring Plugin).

If you want to monitor several datacenter, then it will be necessary to create one Recon Task for each of them, specifying the datacenter name in the parameter of the right script.

Finally, we press the Addbutton to create the new Recon Task.

When pressing the button the following screen will be shown. It will inform you that the operation was successfull and the new Recon Task will be shown in the list.

Recon task screen ok.jpg

Now we have a recon task Recon Task that will be executed with the selected interval and that will create the appropriate agents extracting the information from the VMware virtual architecture.

1.8 VMware 仮想アーキテクチャのモニタリング

To see the Recon Task result, we only need to check that an agent has been created for each virtual machine and ESXi host. For doing this we need to go to the Agent Detail submenu from the View Agents menu.

Agent detail menu.jpg

Then it will show the list with all the agents where will be the agentes of the VMWare virtualized system that the recon script has found. In our case we have two ESXi machines and two virtual machines. In the list, the ESX host are with the ESX_ prefix and they are named according with their IPs. For the virtual machines is used the name of the machine writting the VM_ prefix before.

Agent detail screen.jpg

If we press on the name of an agent we will see the Pandora FMS agent view, where we can see parameters such as the agent IP and in its description we see that it is an agent discovered with the Recon Script for VMware virtual architectures.

Agent screen.jpg

If we pay attention to the module list that is created by default for a virtual machine, we can see some ones like: Host Alive, Free Disk, Host Name, Connection State, and more...

Agent module list vm.jpg

If we press on an agent that corresponds with a ESXi host, we will see a module list as in the following image, where we can see modules such as:bootTime, memorySize, uptime...

Agent module list esx.jpg

In the following section we are going to explain the information that reports each module in detail.

1.9 VMware 仮想アーキテクチャエージェントモジュール

1.9.1 仮想マシンエージェントのモジュール

  • Boot Time: Last date where the virtual machine was booted.
  • Connection State: Connection state.
  • Consumed Overhead Memory: Memory consumed by the virtual machine in MB.
  • CPU Allocation: Information about the resources assigned to the virtual machine CPU.
  • Disk Free: Virtual Machine Free Disk Percentage. (It will be one module for each disk that that the virtual machine contains).
  • Guest State: Host operative system operating way
  • Host Info: Information about the VMware host.
  • Host Alive: Module kind Keep Alive that is 1 if the virtual machine is on execution and 0 otherwise.
  • Host Memory Usage: Consumed memory by the virtual machine in MB.
  • Host Name: Name of the Host Operative system.
  • IP Address: System IP address (It will show one per network interface available).
  • MAC Address: System MAC address It will show one per network interface available).
  • Max CPU Usage: Maximum limit of the virtual machine CPU usage.
  • Max Memory Usage: Maximum limit of the virtual machine RAM Memory.
  • Memory Allocation: Limit of the resources for the memory.
  • Memory Overhead: Memory used by the virtual machine above the requirements of the host operative system in Bytes.
  • Overall CPU Demand: Basic statistics on the CPU performance in Mhz
  • Overall CPU Usage: Basic statistics on the CPU usage in Mhz.
  • Power State: Current state of the virtual machine power.
  • Private Memory: Memory in MB that is given to the virtual machine of the non shared memory.
  • Shared Memory: Memory in Mb that is given to the virtual machine of the shared memory.
  • Tools Running Status: Current state of the VMWare Tools execution installed in the host operative system.
  • Triggered Alarm State: State of the VMware alarms.
  • Uptime Seconds: Virtual machine Uptime in seconds.
  • Virtual Image Path:Virtual machine configuration file path(.vmx).

1.9.2 ESXi ホストのエージェントモジュール

  • Boot Time: Last time the host was booted.
  • CPU Info: CPU general information ( it's created one module per each ESXi CPU).
  • Datastore Info: Datastore general info ( it's created one per each datastore that is availabel in the ESXi).
  • Memory Size: Total amount of the host physical memory in Bytes.
  • Overall CPU Usage: Addition of the use of all CPUs in Mhz.
  • Overall Memory Usage: Physical memory used in the host in MB.
  • Power State: State of the host power.
  • SSL Thumbprint: host SSL print.
  • Uptime: Host Uptime in seconds.
  • VNIC Info: Information about the host virtual network interfaces.

1.10 VMware 仮想アーキテクチャ管理と表示

Together with the VMWare plugin, two extensions are distributed VMware Manager and VMware View.VMware View allows to visualize all the VMware architecture components in an easy way. Besides, with WMware Manager you could manage virtual machines, stopping, starting, reseting or canceling the activity from the Pandora FMS console.

1.10.1 VMware Manager および VMware View Extensions のインストール

To install the extensions, you will only have to copy the content of the extensions file that you'll find when unzipping the plugin in the extension file in the Pandora FMS console enterprise section. The commands to execute are the following ones:

cp -R extensions/* <pandora_console_dir>/enterprise/extensions/

From this moment the WMware plugin extensions will be availables.

1.10.2 VMware View Extension の利用

To begin using the WMware architecture visor, click on the WMware View submenu in the View Agents menu.

Vmware view menu.png

The WMware View extension will show a map similar to the one bellow with all the VMware architecture that was discovered with the Recon Task

Vmware view map.png

The map contains the elements of the VMware architecture(virtual machines, ESX,Datastores and Datacenters) with different icons that identify them and also the Pandora FMS agents state that represent each element. Besides it's showed the relationship that exists between the virtual machines, ESX and DataCenter. This way, with a quick view you could see the state of the VMware architecture in a very easy way.

This extension has some options that help to improve the architecture visualization hidding elements, enlarging the letter size and allowing to do zoom to could see the elements closer.

Vmware view map options.png

Using the previous options we could see only the Datacenter and the ESX with a font size 14 and with a zoom of 2x

Vmware view map options example.png

1.10.3 VMware Manager Extension の利用

To use the VMware Manager extension you should go to the operating view of one agent that corresponds with a virtual machine in the VMware architecture. In this view you could see an icon with the WMware symbol the corresponds to the extension.

Vmware manager icon.png

The VMware Manager extension allows to manage virtual machines from the Pandora FMS console. The extension shows the current state of the virtual machine with a color code (green= on, orange=off and grey=stopped), besides, in a combo it shows the available status and allows to change the state of the virtual machine selecting it clicking on the Change Status button.

Vmware manager options.png

With this extension we could stop a virtual machine that is on selecting the Stop status as in the following image

Vmware manager example stop.png

This will cause that the machine will stop and that the view of the VMware Manage extension view change, showing that the machine that now is stopped as now we can see in the following image:

Vmware manager example stopped.png


1.11 自動検出スクリプト設定

By default, the WMware Recon Script adds all the checkings previously explained. To could choose which checkings you want to include and which ones are not availables, the Recon Script can read your configuration of one file. To show to the Recon Script which is your configuration file, you should add the parameter -reconconf <path_file> to the call created in Pandora FMS.

1.11.1 自動検出スクリプト設定ファイル

The configuration file has modifications or restrictions to the Pandora FMS modules that are created by default. So, if one module is not in the configuration file, it will be added with the default values. With the Recon Script configuration file we can fix maximum and minimum values for the Warning and Critical status, or disable the module.

The configuration file structure is separated by kinds of items of the WMware architecture (Datastores, ESXi y Máquinas Virtuales) as follows:

#These lines are comments


#Datastore Modules
Datastore
capacity disabled
freeSpace name = Espacio Libre; desc = % Espacio libre datastore; limits = 70 90 91 100

#ESX Modules
ESX
uptime disabled

#VM Modules
VM
ipAddress disabled
macAddress disabled
maxCpuUsage name = Uso CPU; desc = Desc Uso CPU; limits = 60 70 71 100

Each line of the file corresponds to the available options for one module. As you can see, there are two possible options:

  • <module> disabled: The module will be NOT create
  • <module> name = <nombre>; desc = <description>; limits = <min_warning> <max_warning> <min_critical> <max_critical>: The module will be created with the name and the description given and the tresholds will be also be defined for the maximums and minimums of the Warning and Critical values.

It is very important to consider the structure of the lines of the configuration file and above all, see that the character ; is close to the module name and description. Theser two lines ARE NOT EQUIVALENTS (See the blanks before the character ;):

maxCpuUsage name = Uso CPU; desc = Desc Uso CPU; limits = 60 70 71 100
maxCpuUsage name = Uso CPU    ; desc = Desc Uso CPU      ; limits = 60 70 71 100


The modules are referenced by their short name, a name equivalent easier to write in the command line. The correspondence table between short and expanded names is in the following section.

Lets analyze the configuration file of example:

For the Datastores we have decided that the Capacity module doesn't have any interest for us, and so we choose the disabled option. Also, the Free Space module will be created with these values:


* Name: Free spaceEspacio Libre 
* Description: % free datastore space 
* Min Warning: 70
* Max Warning: 90
* Min Critical: 91
* Max Critical: 100


To monitor the ESXi we have decided to disable the Uptime module because we consider it's not necessary. The rest of the available modules will be shown with the default parameters.


For the virtual machines we have disabled the modules IP Address and MAC Address. Besides, we have defined the parameters for the modules Max CPU Usage. Remember that the modules that aren't disabled will be created with the default values.


NOTE: All the errors related to the configuration file are shown as events in the Pandora FMS console, so in the event screen you can see if some problem has occurred when reading the configuration file.

1.11.2 設定ファイル例

1.11.2.1 全モジュール無効化

#These lines are comments

#Datastore Modules
Datastore
capacity disabled
freeSpace disabled 

#ESX Modules
ESX
bootTime disabled
cpuInfo disabled
memorySize disabled
overallCpuUsage disabled
overallMemoryUsage disabled
powerState disabled
sslThumbprint disabled
uptime disabled
vnicInfo disabled
hostAlive disabled
connectionState disabled
diskRead disabled
diskWrite disabled
diskReadLatency disabled
diskWriteLatency disabled
netReceived disabled
netTransmitted disabled
netPkgRx disabled
netPkgTx disabled
cpuStatus disabled
storageStatus disabled
memStatus disabled
memoryAllocation disabled 

#VM Modules
VM
bootTime disabled
connectionState disabled
consumedOverheadMemory disabled 
cpuAllocation disabled
diskFree disabled
guestState disabled
host disabled
hostAlive disabled
hostMemoryUsage disabled
hostName disabled
ipAddress disabled
macAddress disabled
maxCpuUsage disabled
memoryAllocation disabled
memoryOverhead disabled
overallCpuDemand disabled
overallCpuUsage disabled
powerState disabled
privateMemory disabled
sharedMemory disabled
toolsRunningStatus disabled
triggeredAlarmState disabled
uptimeSeconds disabled
virtualImagePath disabled
uptimeSeconds disabled
diskRead disabled
diskWrite disabled
diskReadLatency disabled
diskWriteLatency disabled
netReceived disabled
netTransmitted disabled
netPkgRx disabled
netPkgTx  disabled

1.11.3 Short name の対応表

1.11.3.1 データストア

Expanded name Short name
Capacity capacity
Free Space freeSpace

1.11.3.2 ESX

Expanded Name Short name
Boot Time bootTime
CPU Info cpuInfo
Memory Size memorySize
Overall CPU Usage overallCpuUsage
Overall Memory Usage overallMemoryUsage
Power State powerState
SSL Thumbprint sslThumbprint
Uptime uptime
VNIC Info vnicInfo
Host Alive hostAlive
Connection State connectionState
Disk Read diskRead
Disk Write diskWrite
Disk Read Latency diskReadLatency
Disk Write Latency diskWriteLatency
Data received netReceived
Data transmitted netTransmitted
Packages Received netPkgRx
Packages Transmitted netPkgTx
CPU Status cpuStatus
Disk Status storageStatus
Mem Status memStatus

1.11.3.3 仮想マシン

Expanded name Short name
Boot Time bootTime
Connection State connectionState
Consumed Overhead Memory consumedOverheadMemory
CPU Allocation cpuAllocation
Disk Free diskFree
Guest State guestState
Host Info host
Host Alive hostAlive
Host Memory Usage hostMemoryUsage
Host Name hostName
IP Address ipAddress
MAC Address macAddress
Max CPU Usage maxCpuUsage
Memory Allocation memoryAllocation
Memory Overhead memoryOverhead
Overall CPU Demand overallCpuDemand
Overall CPU Usage overallCpuUsage
Power State powerState
Private Memory privateMemory
Shared Memory sharedMemory
Tools Running Status toolsRunningStatus
Trigger Alarm State triggeredAlarmState
Uptime Seconds uptimeSeconds
Virtual Image Path virtualImagePath
Uptime Seconds uptimeSeconds
Disk Read diskRead
Disk Write diskWrite
Disk Read Latency diskReadLatency
Disk Write Latency diskWriteLatency
Data received netReceived
Data transmitted netTransmitted
Packages Received netPkgRx
Packages Transmitted netPkgTx