# 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.

# 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:

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

Prerequisites for Syslog library

  1. Availability of the latest OpenShift Container Platform 4.4.x cluster.
  2. Creation of host path "/mnt/oneview-syslog-lib" in all worker nodes.
  3. Install helm chat in OpenShift.

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

  1. 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)

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

    $ printf '%s' Password' | base64
    
  3. 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.

  4. 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>.
    
  5. 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"
    
  6. From OpenShift CLI, login to default project.

  7. 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
    
  8. Navigate to oneview_syslog_lib and run the following commands.

    helm install helm/log-generator
    
  9. Verify the status of HPE OneView-syslog-lib pod. Figure 26 shows the output after the helm install HPE OneView-syslog-lib pod status.

Figure 26. HPE OneView-syslog-lib pod output

# 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. Figure 27 shows the output of Prometheus operator install process.

Figure 27. Prometheus Operator install process

  1. Click Subscribe. The Installed Operators page is displayed with the status of the operator. Figure 28 shows the output of Prometheus operator status.

Figure 28. Prometheus Operator install 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. Figure 29 shows the output for Prometheus service.

Figure 29. Prometheus service

  1. After clicking Create Prometheus, YAML file will be displayed. Click Create. Figure 20 shows the output for Prometheus service YAML.

Figure 30. Prometheus service YAML

  1. On the Prometheus Operator page, scroll right and go to Service Monitor. Click Create Service Monitor. Figure 31 shows the output of Create Service Monitor.

Figure 31. Create Service Monitor

  1. 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.

    Figure 32 shows the output for Create Service Monitor YAML.

    Figure 32. Service Monitor YAML

  2. 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.Figure 33 shows the output for Create Prometheus operator URL.

    Figure 33. Create Prometheus operator URL

  3. On the Routes page, navigate to Location. Click Prometheus URL to open Prometheus dashboard. Figure 34 shows the output for Click Prometheus URL to open Prometheus dashboard.

    Figure 34. Link for Prometheus operator URL dashboard

    Figure 35 shows the output of window Prometheus operator dashboard .

    Figure 35. 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. Figure 36 shows the output of checking HP OV(OneView) events in Prometheus operator dashboard.

Figure 36. HPE OneView events in Prometheus operator dashboard

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

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