HPE ILO Memory Alert Template

Hello,

When I get a memory error for HPE ILO, I prepared a template to get an alert, but as in the picture, the Error DIMM part is empty. In this section, I want to see the name of my memory that fails, for example “PROC 1 DIMM 5”. Which variable should I use on the template?

image

<html>
<head>
  <title>{{ $alert->title }}</title>
  <style type="text/css">

  body {
    margin: 15px;
    font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 20px;
    color: #333333;
    background-color: #fff;
    font-weight: 400;
  }

  .box {
    position: relative;
    -webkit-border-radius: 0px;
    -moz-border-radius: 0px;
    border-radius: 0px;
    background: #ffffff;
    margin-bottom: 10px;
    width: 100%;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.24);
  }

  .no-padding {
    padding: 0 !important;
  }

  .table {
    max-width: 600px;
    background-color: #fff;
    border-collapse: collapse;
    border-spacing: 0;
    color: #333;
  }

  .table th, .table td {
    padding: 5px 10px;
    line-height: 20px;
    text-align: left;
    vertical-align: top;
    border-top: 1px solid #f4f4f4;
  }

  .table tbody > tr:nth-child(even) > td, .table tbody > tr:nth-child(even) > th {
    background-color: #f9f9f9;
  }

  .table .state-marker, .state-marker {
    padding: 0px;
    margin: none;
    width: 7px;
  }

  .table tbody > tr > td.state-marker {
    background-color: #004774;
  }

  .table .ALERT .state-marker {
    background-color: #bd1e1e;
  }

  .table tbody > tr.ALERT > td {
    background-color: #ffebee;
  }

  .ALERT {
    color: red;
  }

  .table .ACKNOWLEDGED .state-marker {
    background-color: rgb(187, 135, 4);
  }

  .table tbody > tr.ACKNOWLEDGED > td {
    background-color: #fff8eb;
  }

  .ACKNOWLEDGED {
    color: goldenrod;
  }

  .table .RECOVERED .state-marker {
    background-color: rgb(0, 92, 0);
  }

  .table tbody > tr.RECOVERED > td {
    background-color: #ebffec;
  }

  .RECOVERED {
    color: green;
  }

  .header { font-size: 20px; font-weight: bold; padding: 10px;}

  </style>
</head>
<body>
    <p>Merhaba bu alert Arya-IT NOC Ekibi tarafından oluşturulmuştur. Ilgili sunucunun memory durumunu kontrol ederek lütfen bilgi sağlayınız.</p> <br>
<table border="2" class="table box box-solid">
  <tbody>
    @if ($alert->state == 1) <tr class="ALERT">
    @elseif ($alert->state == 2) <tr class="ACKNOWLEDGED">
    @elseif ($alert->state == 0) <tr class="RECOVERED">
    @elseif ($alert->state == 3) <tr class="RECOVERED">
    @else <tr class="RECOVERED">
    @endif
        <td class="state-marker"></td>
        <td colspan=2 style="padding: 10px; text-transform: uppercase;" class="header">
          @if ($alert->state == 1) <span class="ALERT">{{ $alert->severity }} @endif
            @if ($alert->state == 2) <span class="ACKNOWLEDGED">acknowledged @endif</span>
            @if ($alert->state == 3) <span class="RECOVERED">recovering @endif</span>
            @if ($alert->state == 0) <span class="RECOVERED">recovered @endif</span>
        </td>
    </tr>
    <tr>
        <td colspan=2><strong>Alert Title:</strong></td>
        <td><strong>{{ $alert->name }}</strong></td>
    </tr>
    <tr>
        <td colspan=2><strong>System Name:</strong></td>
        <td><strong><a href="https://xxxxxxxxxxxxx.com/device/{{ $alert->device_id }}/" class="entity-popup red" data-eid="{{ $alert->device_id }}" data-etype="device">{{ $alert->sysName }}</a></strong></td>
    </tr>
    <tr>
        <td colspan=2><strong>Device IP:</strong></td>
        <td><strong><a href="https://xxxxxxxx.com/device/{{ $alert->device_id }}/" class="entity-popup red" data-eid="{{ $alert->device_id }}" data-etype="device">{{ $alert->hostname }}</a></strong></td>
    </tr>
        @foreach ($alert->faults as $key => $value)
        <tr>
            <td colspan=2><strong>Error DIMM:</strong></td>
            <td>{{$value['state_name']}}</td>
        </tr>
        @endforeach

  </tbody>
</table>
</body>
</html>

Hello again,

when i edit the rule and template and rule the problem is solved. If you want to use it, it is as follows.

SQL Query:

SELECT * FROM devices,sensors WHERE (devices.device_id = ? AND devices.device_id = sensors.device_id) AND sensors.sensor_current REGEXP "[3-4]" AND sensors.sensor_oid LIKE '%.1.3.6.1.4.1.232.6.2.14.13.1.20.%'

Template:

<html>
<head>
  <title>{{ $alert->title }}</title>
  <style type="text/css">

  body {
    margin: 15px;
    font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 20px;
    color: #333333;
    background-color: #fff;
    font-weight: 400;
  }

  .box {
    position: relative;
    -webkit-border-radius: 0px;
    -moz-border-radius: 0px;
    border-radius: 0px;
    background: #ffffff;
    margin-bottom: 10px;
    width: 100%;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.24);
  }

  .no-padding {
    padding: 0 !important;
  }

  .table {
    max-width: 600px;
    background-color: #fff;
    border-collapse: collapse;
    border-spacing: 0;
    color: #333;
  }

  .table th, .table td {
    padding: 5px 10px;
    line-height: 20px;
    text-align: left;
    vertical-align: top;
    border-top: 1px solid #f4f4f4;
  }

  .table tbody > tr:nth-child(even) > td, .table tbody > tr:nth-child(even) > th {
    background-color: #f9f9f9;
  }

  .table .state-marker, .state-marker {
    padding: 0px;
    margin: none;
    width: 7px;
  }

  .table tbody > tr > td.state-marker {
    background-color: #004774;
  }

  .table .ALERT .state-marker {
    background-color: #bd1e1e;
  }

  .table tbody > tr.ALERT > td {
    background-color: #ffebee;
  }

  .ALERT {
    color: red;
  }

  .table .ACKNOWLEDGED .state-marker {
    background-color: rgb(187, 135, 4);
  }

  .table tbody > tr.ACKNOWLEDGED > td {
    background-color: #fff8eb;
  }

  .ACKNOWLEDGED {
    color: goldenrod;
  }

  .table .RECOVERED .state-marker {
    background-color: rgb(0, 92, 0);
  }

  .table tbody > tr.RECOVERED > td {
    background-color: #ebffec;
  }

  .RECOVERED {
    color: green;
  }

  .header { font-size: 20px; font-weight: bold; padding: 10px;}

  </style>
</head>
<body>
    <p>Hello, this alert was created by Arya-IT NOC Team. Please provide information by checking the memory status of the relevant server.</p> <br>
<table border="2" class="table box box-solid">
  <tbody>
    @if ($alert->state == 1) <tr class="ALERT">
    @elseif ($alert->state == 2) <tr class="ACKNOWLEDGED">
    @elseif ($alert->state == 0) <tr class="RECOVERED">
    @elseif ($alert->state == 3) <tr class="RECOVERED">
    @else <tr class="RECOVERED">
    @endif
        <td class="state-marker"></td>
        <td colspan=2 style="padding: 10px; text-transform: uppercase;" class="header">
          @if ($alert->state == 1) <span class="ALERT">{{ $alert->severity }} @endif
            @if ($alert->state == 2) <span class="ACKNOWLEDGED">acknowledged @endif</span>
            @if ($alert->state == 3) <span class="RECOVERED">recovering @endif</span>
            @if ($alert->state == 0) <span class="RECOVERED">recovered @endif</span>
        </td>
    </tr>
    <tr>
        <td colspan=2><strong>Alert Title:</strong></td>
        <td><strong>{{ $alert->name }}</strong></td>
    </tr>
    <tr>
        <td colspan=2><strong>System Name:</strong></td>
        <td><strong><a href="https://xxxxxxxxx.com/device/{{ $alert->device_id }}/" class="entity-popup red" data-eid="{{ $alert->device_id }}" data-etype="device">{{ $alert->sysName }}</a></strong></td>
    </tr>
    <tr>
        <td colspan=2><strong>Device IP:</strong></td>
        <td><strong><a href="https://xxxxx.com/device/{{ $alert->device_id }}/" class="entity-popup red" data-eid="{{ $alert->device_id }}" data-etype="device">{{ $alert->hostname }}</a></strong></td>
    </tr>
        @foreach ($alert->faults as $key => $value)
        <tr>
            <td colspan=2><strong>Error DIMM:</strong></td>
            <td>{{$value['sensor_descr']}}</td>
        </tr>
        @endforeach

  </tbody>
</table>
</body>
</html>

image

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.