J
J
JDiZeeX2018-07-21 09:40:24
Zabbix
JDiZeeX, 2018-07-21 09:40:24

How to monitor information in html plate through zabbix?

There is a certain html table, the data in which is updated every n seconds
5b52d363cd116119126932.png

Source
<html>
<head>
    <title>Подключения</title>
    <style type="text/css">
        table {
            border: 2px solid black;
            border-collapse: collapse;
        }

        td, th {
            border: 1px solid black;
            padding: 2px;
        }
    </style>
    <script type="text/javascript">
        function timedRefresh(timeoutPeriod) {
            setTimeout("location.reload(true);", timeoutPeriod);
        }
    </script>
</head>
<table>
    <tr>
        <th>IP Address</th>
        <th>Computer name</th>
        <th>Terminal name</th>
        <th>Login</th>
        <th>Module ID</th>
        <th>Module name</th>
        <th>Module display name</th>
        <th>Last activity</th>
    </tr>
    
    <tr>
        <td>
            192.168.10.1
        </td>
        <td>
            192.168.10.1
        </td>
        <td>
            admin
        </td>
        <td>
            admin
        </td>
        <td style="text-align: right">
            200
        </td>
        <td>
            BACK
        </td>
        <td>
            BACKOffice
        </td>
        <td>
            2018-07-21T09:24:00.460+03:00
        </td>
    </tr>
    
    <tr>
        <td>
            192.168.10.1
        </td>
        <td>
            POS1
        </td>
        <td>
            Кафе
        </td>
        <td>
            
        </td>
        <td style="text-align: right">
            101
        </td>
        <td>
            FRONT
        </td>
        <td>
            FRONTOffice
        </td>
        <td>
            2018-07-21T09:24:22.929+03:00
        </td>
    </tr>
    
    <tr>
        <td>
            192.168.10.1
        </td>
        <td>
            POS2
        </td>
        <td>
            Бар
        </td>
        <td>
            
        </td>
        <td style="text-align: right">
            1200
        </td>
        <td>
            UNKNOWN
        </td>
        <td>
            FRONTOffice
        </td>
        <td>
            2018-07-21T09:24:22.929+03:00
        </td>
    </tr>

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


The number of rows in this table may change regularly (depending on the number of equipment connections), and it is not possible to predict how many of them there will be.
What is the best way for me to store such a table in zabbix? I understand that I can just use curl to get its source code and store it right, but in the future I plan to display this tablet in Grafana.
I will also need to put a trigger on the "Last activity" column to identify equipment that has not responded for a long time.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel, 2018-08-03
@JDiZeeX

We put similar things in Zabbix like this: Using Python,
we turn the data into JSON {'{#ITEM}': '605', ...}, one JSON for the discovery rule and creating a prototype of data elements by a parameter that will be unique in the table (computer name?), the second JSON that will be sent over the generated data. And then prototypes of dependent data elements are created in zabbix, which, through regexp, pull out the necessary parameters from the JSON string.

D
Dimonchik, 2018-07-21
@dimonchik2013

well, there you can also put regexps into variables
or process them somehow

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question