IT Operations Management (ITOM)
cancel
Showing results for 
Search instead for 
Did you mean: 

Monitoring hLinux hosts with SiteScope in Helion Platform

Monitoring hLinux hosts with SiteScope in Helion Platform

Raviv_givati

Background and requirements

The Hewlett Packard Enterprise Helion Platform is based on an industry-leading open source project in OpenStack and Cloud Foundry and provides enterprise customers with flexibility in software and hardware.

The HPE Helion OpenStack is an OpenStack technology coupled with a version of Linux provided by Hewlett Packard Enterprise named hLinux.

The HPE Software infrastructure monitoring and utilities team designed, built and deployed hLinux, which hosts the monitoring package which monitors availability and OS’s core performance using HPE SiteScope application monitoring software.

The major advantage of this type of monitoring solution is that HPE SiteScope is an agentless application monitoring software and it can monitor the hLinux hosts without installing any application or utility on the host itself.

 

Designing stage

After reviewing and validating all of the “out of the box” SiteScope OS templates, it was defined that the “hLinux” new OS template will include some of the “Ubuntu Linux” commands. This is due to the fact that several commands located in the template are compatible to hLinux and additional monitors in order to create the optimal monitors package.

Based on the above info, the new “hLinux OS” availability and performance monitors package includes:

  1. Ping – Send a ping request to the monitored hLinux host.
  2. CPU Usage (%) – Using a remote script monitor on the hLinux host.
  3. Linux Resource – Monitor multiple system statistics on a single hLinux host.
  4. Dynamic disk usage – Monitor the local and mounted disk space usage on the hLinux host.
  5. File system status – Monitor the file system drives space usage.

 

Pre-requisites

In order to be able to monitor the hLinux host, the following network ports should be open between the SiteScope server and the monitored host:

Ping – ICMP port 1

SSH - port 22

 

Deploying stage

Step 1: Service Account

Create Service Account on the hLinux host.

SiteScope requires a service account for SiteScope to access the monitored hLinux host via SSH.

Account Name: SiteScope

Credentials: ***********

 

$ useradd SiteScope

$ passwd SiteScope

$ mkdir /home/SiteScope

$ id SiteScope

$ chown SiteScope:SiteScope /home/ SiteScope

 

From the SiteScope server test the service account by logging into the hLinux host using putty or by issuing the following command from a windows command prompt:

> ssh –v <service_account>@<host_ip> (i.e. ssh –v SiteScope@<host’s IP>)

 

Step 2: Create a SSH Key pair

Option 1: Create the Key pair on the SiteScope Management Server

A public and private key allows communication between the SiteScope management server and the monitored host.

To simplify key management—the same pair can be used for all monitored hosts.

The keys may be created on the SiteScope management sever using the MindTerm application that is installed with SiteScope.

Login to SiteScope using the account that was setup to run SiteScope during the SiteScope installation.

Open the Windows command prompt and run the MindTerm application:

c:\SiteScope\java\bin\java -jar c:\SiteScope\WEB-INF\lib\mindterm.jar

The first time you will be asked to create the MindTerm folder that will contain the keys that are created. Answer “Yes”.

From the MindTerm application window select Menu => File => Create Keypair …

Change the Key type/format to RSA (ssh2) and Check OpenSSH .pub format.

Accept the remaining defaults as shown here.

Press the “Generate” button and follow the directions on the next screen to complete the key creation.

In the MindTerm directory created by the MindTerm application there will now be two files identity and identity.pub.

These are the private and public keys that will be used to configure the remote server in SiteScope.

Proceed to Step 3.

 

Option 2: Create the Key pair on any one of the hLinux monitored hosts

Alternately the key pair can be created on any of the hLinux monitored hosts.

Although the key pair is created on a single host it can be used for the configuration of all of the remaining monitored hosts.

Login into one of the hLinux hosts as the service account user that you created in step 1.

Issue the following command to create an RSA key pair:

$ /usr/bin/ssh-keygen -t rsa -f ./ssh_host_rsa_key -N ''

You will now have the following files created in the current directory ssh_host_rsa_key and ssh_host_rsa_key.pub.

These are the private and public key used to configure the remote server in SiteScope.

Proceed to Step 3.

 

Option 3: Use an existing Key pair from one of the hLinux monitored hosts

Alternately an existing key pair found in /etc/ssh on any of the hLinux monitored hosts may be used. These keys are named ssh_host_rsa_key and ssh_host_rsa_key.pub.

As root copy these files to the root directory of the service account created in step 1 and use the “chown” command to change the owner to the service account.

These are the private and public key used to configure the remote server in SiteScope.

Proceed to Step 3.

 

Step 3: Rename the public and private keys

Regardless of the method used to create the keys, the keys should be named something that will indicate that they are used for monitoring.

Some examples:

The host name of the SiteScope server (i.e. private: engmsis1.rsa, public: engmsis_rsa.pub)

The service account name for hLinux hosts (i.e. private: SiteScope.rsa, public: SiteScope_rsa.pub)

 

Step 4: Copy the keys to the SiteScope server ssh directory

The keys should be copied to the SiteScope ssh directory in the root SiteScope directory (default is c:\SiteScope\ssh).

Create the directory if it does not exist.

It is important to use a sftp application or the scp command to copy the key files from Linux to the Windows SiteScope server.

Although the key files are in text format a copy and paste of the text does not work correctly and the key files will be corrupted.

 

Step 5: Configure the public key on each hLinux host

Configure the public key on each hLinux host that will be monitored by SiteScope.

Copy the public key to the home directory of each hLinux host that will be monitored by SiteScope.

It is important to use an sftp application or scp to copy the key files from Linux to the Windows SiteScope server.

Although the key files are in text format a copy and paste of the text does not work correctly and the key files will be corrupted.

Login to the hLinux host using the service account created in step 1.

Create an .ssh directory in the home directory, an authorized_keys2 file in that directory, and copy the public key into authorized_keys2 file.

The following commands may be used:

$ mkdir .ssh

$ chmod 700 .ssh

$ cd .ssh

$ touch authorized_keys2

$ chmod 600 authorized_keys2

$ cat <what you named it in step 3>_rsa.pub >> authorized_keys2

$ rm <what you named it in step 3>_rsa.pub

 

Step 6: Add key exchange protocol on hLinux host

The ssh client packaged with SiteScope is Mindterm.

The standard hLinux installation of Helion uses OpenSSH and the default does not have the key exchange protocol used by SiteScope (diffie-hellman-group1-sha1) enabled. This can be added by appending it to the configured key exchange protocols and inserting a line into the sshd configuration file.

Add this line to /etc/ssh/sshd_config

kexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

Restart ssh to enable the configuration change

$ service ssh restart

Test the SSH Connection from SiteScope Server (Windows)

> ssh –v SiteScope@<hLinux Host ip>

 

Step 7: Configure the hLinux remote host on SiteScope

Option 1: Manually add the hLinux remote host.

To manually add a hLinux remote host to SiteScope Start the SiteScope web interface (http://<SiteScope_server>:8080).

Name: Host Name or IP Address “UNIX Remote Server”

Credentials: Service account username and password. Optionally, frequently used credentials such as service accounts can be defined in a credential

Operating System: Ubuntu Linux

Method: SSH

Prompt: $

Connection Limit: 4

SSH Authorization Method: Keyfile

Key file for SSH Connection: c:\SiteScope\ssh\<name from step 3>.rsa

SSH Version 2 only: Checked

 

The remaining fields can use the defaults.

See figure 4 for a complete view of the form to add a new UNIX Remote Server.

Apply the “Save & Test” button to add the host and test communications. Results will be one of these two options:

Or:

 

Information on possible errors as the above can be found in the following log files:

SiteScope Management Server: C:\sitescope\logs\RunMonitor

Linux Remote Host: /var/logs/auth.log

 

Option 2: Use a SiteScope Template to add remote hosts

When there are a number of hosts to monitor it is not practical to add each host manually. SiteScope provides templates which can be used to define the characteristics of the monitored host as well as the monitors to apply. When a template is deployed against a list of hosts the hosts are added during the process and the monitors are assigned to the newly added hosts.

 

Figure 4: SiteScope UNIX Remote Server:

 

 

Monitors deployment

As soon as the hLinux host is added as a UNIX remote server in SiteScope, you can start deploying the requested monitors:

Ping monitor:

Use the standard “out of the box” SiteScope ping monitor.

 

CPU Usage:

Create a new text file and name it “CPU_HLinux.txt”, add the following command into the file:

top -bn1 | grep "Cpu(s)" | \sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | \awk '{print 100 - $1}'

Save the file in “C:\SiteScope\scripts.remote”.

The script’s output will show the CPU usage in a percentage value.

The monitor image example below is defined to send alerts when the CPU usage is above 90%.

Use the standard script “out of the box” monitor and set the monitor according to the info appearing in Figure 5.

Figure 5:

 

Dynamic disk space usage:       

Use the standard “out of the box” SiteScope dynamic monitor.

 

Filesystem status, Linux Resources & Memory utilization monitors:

Use the standard “out of the box” SiteScope’s “Linux host” template.

The CPU Utilization monitor included in the template will show the CPU usage per core, total use and average in MHz values.

 

Final monitor properties view upon deployment completion:

  • infrastructure management
About the Author

Raviv_givati

//Add this to "OnDomLoad" event