Server Monitoring

PureLoad Logo
PureLoad 5.2
January 2015
http://www.pureload.com
support@pureload.com

Documentation Index

Server Monitoring Overview

PureLoad supports monitoring of servers during a test. Server monitoring is defined by using Monitors, per server hosts to be monitored, by defining what resources (or resource counters) to be used per monitor.

SNMP can be used to monitor SNMP compliant devices and systems. Monitoring of UNIX based servers are based on SSH and agent-less, meaning that no software has to be installed on the servers to be monitored. Monitoring of Windows based servers requires an agent to be installed on the server to be monitored.

Note: Server Monitoring is only available in the Enterprise Edition.

Preparing a Server to be monitored

UNIX based systems

A UNIX based system to be tested must have SSH enabled and support SSH2 with either "password" or "keyboard-interactive" authentication. This is normally supported by default on most UNIX based systems.

You should verify SSH client-to-server connectivity from the command line outside of PureLoad before setting up monitors in PureLoad. For example, the following command line requests a ssh connection using SSH2 to remote host:

% ssh -2 remotehost

This normally will return text information that indicates the version of SSH protocol that is being used. Also, this will attempt to authenticate as the current user. Use the -l username switch to request a login as a different user.

Once you have confirmed SSH connectivity, create and test Monitor settings in PureLoad.

Windows based systems

To test a Windows based server system an agent is required. The agent used is an Open Source product NSClient++.

For details on how to download and install the agent software, see the Installing NSClient++ section below.

The Monitor View

The monitor view is used to control what servers are being monitored (a Collector) and what resources that is monitored per collector. The monitor view is enabled by selecting the appropriate tab in the console:

Monitor View

The tree to the left shows the following type of objects:

The view to the right shows and allows setting of properties for the selected object.

Create and Add a Collector

Add new Collector

To add a new server to be monitored, select the root object and choose the Edit->Create menu option or the new button in the tool bar. A list of collectors are presented in a dialog:

Add Collector Dialog

Select the collector type that best matches the OS of the server you want to monitor. The added collector is now presented in the tree and the properties for the collector is displayed.

SNMP Collector

The setting for the collector is displayed when you select the collector in the tree. The settings varies depending on the type of collector. The following figure shows the SNMP collector configuration.
SNMP settings

The collector properties are:

Enable
If the collector is enabled or not. If not enabled, the monitor will not be executed during test session.
Address
The IP Address or host name of the device or server to be monitored.
Alias
An optional alias text, to be used when presenting results.
Proxy
Optional Worker Manager host name, if access to the server must be done from the worker manager due to network or firewall restrictions.
Port
SNMP port (default is 161)
Timeout
Timeout in milliseconds before retrying. A timeout of zero is interpreted as an infinite timeout.
Retries
How many times the SNMP query will be retried if no response is received.
Read Community
Name of SNMP read community.
SNMP Version
SNMP version to use (version 1 and 2 are supported)

Testing Collector Settings

To test and verify that there is network connectivity and that a collector is working as expected, simply press the test button and trace information will be displayed in the text area:

Test Collector Settings
If everything work as expected, you will see information displayed similar to the above. If access is denied or any other problem is found a dialog will be displayed, describing the error found.

Create and Add Resources to be Monitored

When you have a collector defined, the next step is to add resources to be monitored. Select the collector in the tree to the left and and choose the Edit->Create menu option or the new button in the tool bar. For SNMP collectors, this will bring up the SNMP browser:

SNMP Browser

The SNMP browser is used to query an SNMP host for specific OIDs to be added as monitored resources. Start with either entering an OID or selecting a node in the MIB tree to the left. This OID can then be queried at the SNMP host by pressing the query (SNMP Query button) button. A list of specific OIDs and their actual current values from the SNMP host are then shown in the SNMP Result table. Select one or more OIDs from the result table and press the add (Add Resource Button) button to add them as monitored resources.

The SNMP MIB tree to the left can be used to help locate an OID of interest to browse. PureLoad comes with a number of MIB files pre-installed and more can be added by placing MIB files in the <PURELOAD_HOME>/mibs directory (requires restart of PureLoad).

OID Resource Settings

The settings for a resources is shown when you select the resource in the tree. The following picture shows the settings for an OID resource:

OID Resource Settings
The Enable is used to enable/disable the resource. and the Name setting is used when presenting results. OID is the id of the SNMP object to monitor which was added from the SNMP Browser. The OID can be edited manually as well.

The Compute Rate setting controls if the rate per second should be computed and used instead of the raw value returned by the SNMP host. This is useful for SNMP counters where the absolute value is not of interest but rather the change over time. Example: ifInOctets (received octets on a network interface) is not very useful, but received octets per second is often interesting to monitor.

Testing Resource Settings

To test and verify that the resource is working as expected, simply press the test button and trace information will be displayed in the text area:

OID Resource Test

If everything work as expected, you will see information displayed similar to the above. If results can't be parsed or any other problem is found a dialog will be displayed, describing the error found. Note that the test for OID resources will always show the actual value and not compute any rate.

Linux Collector

The settings for server resources varies depending on the OS of the server to be monitored, but for UNIX based systems the following is typical:

Collector Settings
The collector properties are:

Enable
If the collector is enabled or not. If not enabled, the monitor will not be executed during test session.
Address
The IP Address or host name of the server to be monitored.
Alias
An optional alias text, to be used when presenting results.
Proxy
Optional Worker Manager host name, if access to the server must be done from the worker manager due to network or firewall restrictions.
Port
SSH port
Connect Timeout
SSH connect timeout in milliseconds. A timeout of zero is interpreted as an infinite timeout.
Execution Timeout
Resource execution timeout in milliseconds. A timeout of zero is interpreted as an infinite timeout.
User
User identification to be used for authentication to the server over SSH.
Password
Password to be used for authentication to the server over SSH.

Linux Resources

Select the Linux collector in the tree to the left and and choose the Edit->Create menu option or the new button in the tool bar. A list of available Linux resources are presented in a dialog:

Add Resources

Select the resources you want to add and press OK. The list of available resources is dependent of the server OS for the collector and the version above is for a Linux collector.  For details on the "Unix Command" resource, see the Custom UNIX Resources section below.

For a description of the Windows resources see the section below.

Resource Settings

The settings for a resources is shown when you select the resource in the tree.

Resource Settings
The Enable is used to enable/disable the resource. and the Name setting is used when presenting results. The Test section is described below.

Testing Resource Settings

To test and verify that the resource is working as expected, simply press the test button and trace information will be displayed in the text area:

Resource Test

If everything work as expected, you will see information displayed similar to the above. If results can't be parsed or any other problem is found a dialog will be displayed, describing the error found.

Windows Resources

General

If you have installed NSClient++ you will be able to add a Windows Collector and add Windows resources to be monitored. The Windows resources available are as shown below:

Windows resources

Monitoring Windows Performance Counters

The "Performance Counter" resource allows you to monitor any Windows Performance Counter. For example to monitor the disk space available on the "C:" hard drive you can use the following:

Windows Perf. Counter
Windows Performance Counters are used to provide information as to how well the operating system or an application, service, or driver is performing. A counter is specified using a path specifying performance object and counter. Examples are:

\Memory\Page Faults/sec
Number of times a virtual page was not found in memory.
\Memory\Available Bytes
Shows the total bytes of real memory available to the computer, less the number of bytes being used by running applications.

For details on Performance Counters and available Counters, please see the Windows Documentation.

Note: Unfortunately NSClient++ returns zero (0) if a performance counter isn't found. When adding and testing Performance Counters start NSClient++ on the Windows server in test mode and verify that you do not get any errors displayed on in the console.

Custom UNIX Resources

To add non-standard resources to be monitored, the Unix Command resource can be used. Such a resource is composed of two parts:

  1. A UNIX command executed on the server over SSH
  2. A script to parse the result
Writing script to parse result requires some Java language knowledge.

Add a Unix Command Resource

Select the collector in the tree to the left and and choose the Edit->Create menu option or the new button in the tool bar. A list of resources that can be added are presented in a dialog, select the Unix Command resource. The resource added will have the following settings:

Unix Command Resource

There are 3 settings to control the Unix Command resource:

Name
Name of the resource to be used when results are presented.
Command
Path to command to be executed.
Script
Java BeanShell script to parse and set result from executed command.
The Test part works similar to other resources and is used to test execution as well as the script.

Using Script to Parse Result

The script to parse results from an executed command is based on BeanShell, a Java source interpreter. Basically this allows using Java to specify how to read and parse the results and also to set the result. To help there are two variables pre-defined:

parser
A  parser to read and parse the result from the executed command. For more information, see The Parser below.
result
A simple Java bean to set the resulting metric to be displayed for a specific resource

Simple Example - Swapped Memory

Let's say that we want to monitor used swap memory on a Linux system. To do this we executes the "free" command as follows:

% /usr/bin/free -k
             total       used       free     shared    buffers     cached
Mem:       2055584    2036796      18788          0      52240     973812
-/+ buffers/cache:    1010744    1044840
Swap:      2097144        164    2096980

We want to extract the 3'rd column  from the 4'th line (164 in the example above). To do this we specify the following:

Command
"/usr/bin/free -k" to execute the command
Script
"double res = parser.get(3, 2);" to use the parser and extract row 3 and column 2 followed by
"result.set(res);" to set the result. Result.set() must be used to make sure result is set.

If you specify this and test it using the Test button you will see something like:

Unix Command Example

The Parser

The parser support several methods, but for simple row/column access the get(in, int) method as shown above is the easiest and most common way to extract data from a command. The following methods exists:


public java.lang.String getUnparsedResult()
Get unparsed result as a String.
Returns:
unparsed result

public void parse()
throws com.pureload.monitor.collector.CollectException
Parse, using the default column separator (white space or "\s+"). This method is called when get() or getString() methods is called if not previously parsed.
Throws:
com.pureload.monitor.collector.CollectException - on parse errors

public void parse(java.lang.String columnSeparator)
throws com.pureload.monitor.collector.CollectException
Parse using specified column separator string.
Parameters:
columnSeparator - column separator (regular expression)
Throws:
com.pureload.monitor.collector.CollectException - on parse errors

public int getNoOfLines()
throws com.pureload.monitor.collector.CollectException
Get parsed number of lines
Returns:
number of line
Throws:
com.pureload.monitor.collector.CollectException - on parse errors

public java.lang.String getString(int row,
int col)
throws com.pureload.monitor.collector.CollectException
Get parsed string, using specified row and columnn index
Parameters:
row - row index (first line is index 0)
col - column index (first columnd is index 0)
Returns:
accessed string
Throws:
com.pureload.monitor.collector.CollectException - on errors

public double get(int row,
int col)
throws com.pureload.monitor.collector.CollectException
Get parsed number, using specified row and columnn index
Parameters:
row - line index (first line is index 0)
col - column index (first columnd is index 0)
Returns:
accessed string, converted into a number (double)
Throws:
com.pureload.monitor.collector.CollectException - on errors


Installing NSClient++

Installing NSClient++ agent is required on all Windows servers to be monitored. These instructions describes how to install and run the the Agent as a Windows service.

Download NSClient++

Download NSClient++ agent from: http://nsclient.org/nscp/downloads.

Windows Installers are provided as "MSI files". Download the latest version available.

Install NSClient++

Install by executing the downloaded installer. Accept the license agreement and choose "Next" until you come to the NSClient++ Configuration page:

NSClient++ Installer

Here you must specify the following parameters:

Allowed Hosts:

Host name or IP address of the host where you will run the PureLoad Console. 

This can be a list (comma separated) with hosts that are allowed to connect and query data. If this is empty all hosts will be allowed to query data.

NSClient Password:

The password used to access the agent. If no password is set everyone will be able to use this service remotely.

Modules to load:

Select the first two modules as shown above. These are the only one required to be used from PureLoad.

In the final screen select "start service" to start the NSClient++ agent:

NSClient++ Installer

Starting/Stopping NSClient++

You control NSClient++ using the installed Start menu shortcuts or using the isntalled System Service.



Copyright © 2015 PureLoad Software Group AB. All rights reserved.