# Integration of HPE OneView with Prometheus

# Overview

This document contains details of integration of HPE OneView with Prometheus operator on an existing Red Hat OpenShift Container Platform 4.6.

# HPE OneView Syslog library

The HPE OneView syslog generator repo helps in getting the alerts of HPE OneView alerts into a syslog. This is a python- based solution and uses HPE OneView APIs (REST and Message queues (SCMB)) to get the alerts and stats that converts into syslog. This syslog can be forwarded and consumed by log- readable monitoring solutions in Prometheus.

The library is a config driver, which allows user to filter the alerts based on severity and hardware resources.

Primarily, this library generates syslog for the following:

  • Events generated from HPE OneView.
  • Interconnect statistics (Port transmit/Receive/Speed/Model).
  • Enclosure statistics (Temperature/Power).
  • Server statistics (Temperature/Power/CPU frequency/CPU utilization).
  • Remote support ticket information.

# Prerequisites for Syslog library

  • Availability of the latest OpenShift Container Platform 4.6 cluster.
  • Creation of host path "/mnt/oneview-syslog-lib" in all worker nodes.
  • Install helm chat in OpenShift.

# Flow Diagram

Figure 94. Integration of HPE OneView with Prometheus

# Deploying HPE OneView Syslog pod on an existing pod with Red Hat OpenShift Container Platform

  • Download HPE OneView syslog packages from the following GitHub link. https://github.hpe.com/GSE/ov-prometheus-grafana/tree/master/oneview_syslog_lib (opens new window)

  • Use the following base64 command to generate an encoded password for HPE OneView.

  • printf '%s' Password' | base64

  • Update HPE OneView IP address, username and the encoded password in "/oneview_syslog_lib /config.json" and update the same details in "/oneview_syslog_lib/helm/log-generator/templates/config-map.yaml". This is done in accordance with the needs of the customer.

NOTE

Use step 4 and step 5 to create your own Docker images.

  • Build your own docker image using Docker file as shown and push images to your Docker Hub.
> cd to oneview_syslog_lib

> docker build -t <org>/oneview-syslog-lib:<tag>.

> cd to grok_exporter

> docker build -t <org name>/grok-exporter:<tag>.
  • Update both HPE OneView-syslog-lib and grok-exporter docker images on deployment.yaml in container section.
containers:

  - name: oneview-syslog-lib

    image: "John/oneview-syslog-lib:v10.0"

containers:

  - name: oneview-grok-exporter

    image: "John/grok-exporter:v2.0"
  • From OpenShift CLI, login to default project.

  • Create Persistent volume (PV) and Persistent Volume Claim (PVC) and verify whether both of them are bounded properly.

> oc create -f ov-syslog-pv.yaml

> oc create -f ov-syslog-pvc.yaml
  • Navigate to oneview_syslog_lib and run the following commands.

  • helm install helm/log-generator

  • Verify the status of HPE OneView-syslog-lib pod. Below snapshot shows the output after the helm install HPE OneView-syslog-lib pod status.

# Installation of Prometheus operator on an existing Red Hat OpenShift Container Platform

  1. Logon to the Red Hat OpenShift Container Platform web console.

  2. Click OperatorsOperatorHub.

  3. Search for Prometheus Operator from the list of operators and click it.

  4. On the Prometheus Operator page, click install.

  5. On the Create Operator Subscription page, select namespace as default in Installation Mode, Update Channel and Approval Strategy options. Below figure shows the output of Prometheus operator install process.

  6. Click Subscribe. The Installed Operators page is displayed with the status of the operator. Below figure shows the output of Prometheus operator status.

# Integration of OneView syslog pod with Prometheus on an existing Red Hat OpenShift Container Platform

  1. Click Operators → Installed Operators from the left pane of the OpenShift Web Console to view the installed operators.

  2. On the Installed Operator page, select Prometheus Operator from the Project drop-down list to switch to the default project.

  3. Click Prometheus Operator.

  4. On the Prometheus Operator page, scroll right and go to Prometheus. Click Create Prometheus. Below snapshot shows the output for Prometheus service.

  5. After clicking Create Prometheus, YAML file will be displayed. Click Create.

  6. Below figure shows the output for Prometheus service YAML.

  7. On the Prometheus Operator page, scroll right and go to Service Monitor. Click Create Service Monitor. Below figure shows the output of Create Service Monitor.

  8. After clicking Create Service Monitor, YAML file will be displayed and then change the required values in matchLabels section as app: log-generator , port: http, and interval: 10s.

Below snaphost shows the output for Create Service Monitor YAML.

  1. On the console page, navigate to Networking option. Click Routes option to open the Create Route page for Prometheus. Enter details for Name and Services. Select the Prometheus operator. Select the Target Port as 9090. Click Create to generate the Prometheus URL.

    Below snapshot shows the output for Create Prometheus operator URL.

  2. On the Routes page, navigate to Location. Click Prometheus URL to open Prometheus dashboard.

Below snapshot shows the output for Click Prometheus URL to open Prometheus dashboard .

Figure 103. shows the output of window Prometheus operator dashboard .

Figure 104. Prometheus operator dashboard status

WARNING

Time difference between the browser and the server is expressed in seconds. Prometheus relies on accurate time and time drift might cause unexpected query results.

  1. On the Prometheus dashboard, select ov_all_critical_messages from the drop-down list and click Execute. Below snapshot shows the output of checking HP OV(OneView) events in Prometheus operator dashboard.

Figure 105.. HPE OneView events in Prometheus operator dashboard

  1. Click the Graph option to see the graphical view. Below snapshot shows the output of HPE OneView events in graphical view on Prometheus operator dashboard.

Figure 106. HPE OneView events in graphical view on Prometheus operator dashboard