Kali ini akan membahas tentang Monitoring menggunakan netdata dan menggunakan nodejs plugin API yang memanfaatkan snmp dari Mikrotik. Yang dibutuhkan untuk ini adalah sebagai berikut :

Contoh konfigurasinya :

Anda cukup buatkan file /etc/netdata/node.d/snmp.conf dengan data sebagai berikut:

{
    "enable_autodetect": false,
    "update_every": 1,
    "max_request_size": 100,
    "servers": [
        {
            "hostname": "xxx.xxx.xxx.xxx",
            "community": "public",
            "update_every": 1,
            "max_request_size": 50,
            "options": { "timeout": 10000 },
            "charts": {
                "snmp_switch.health": {
                    "title": "Health",
                    "type": "area",
                    "priority": 1,
                    "family": "CPU",
                    "dimensions": {
                        "volt": {
                            "oid": ".1.3.6.1.4.1.xxxxx.1.1.3.8.0",
                            "divisor": 10,
                            "offset": 0,
                            "units": "voltage"
                        },
                        "temp": {
                            "oid": ".1.3.6.1.4.1.xxxxx.1.1.3.10.0",
                            "divisor": 10,
                            "offset": 0
                        },
                        "cpu-temp": {
                            "oid": ".1.3.6.1.4.1.xxxxx.1.1.3.11.0",
                            "divisor": 10,
                            "offset": 0
                        },
                        "fan1": {
                            "oid": ".1.3.6.1.4.1.xxxxx.1.1.3.17.0",
                            "divisor": 1,
                            "offset": 0
                        },
                        "fan2": {
                            "oid": ".1.3.6.1.4.1.xxxxx.1.1.3.18.0",
                            "divisor": 1,
                            "offset": 0
                        }
                    }
                },
                "snmp_switch.port3": {
                    "title": "Port3",
                    "units": "kilobits/s",
                    "type": "area",
                    "priority": 1,
                    "family": "ports",
                    "dimensions": {
                        "in": {
                            "oid": ".1.3.6.1.2.1.xx.1.1.1.6.7",
                            "algorithm": "incremental",
                            "multiplier": 8,
                            "divisor": 1024,
                            "offset": 0
                        },
                        "out": {
                            "oid": ".1.3.6.1.2.1.xx.1.1.1.10.7",
                            "algorithm": "incremental",
                            "multiplier": -8,
                            "divisor": 1024,
                            "offset": 0
                        }
                    }
                },
                "snmp_switch.port7": {
                    "title": "Port 7",
                    "units": "kilobits/s",
                    "type": "area",
                    "priority": 1,
                    "family": "ports",
                    "dimensions": {
                        "in": {
                            "oid": ".1.3.6.1.2.1.xx.1.1.1.6.11",
                            "algorithm": "incremental",
                            "multiplier": 8,
                            "divisor": 1024,
                            "offset": 0
                        },
                        "out": {
                            "oid": ".1.3.6.1.2.1.xx.1.1.1.10.11",
                            "algorithm": "incremental",
                            "multiplier": -8,
                            "divisor": 1024,
                            "offset": 0
                        }
                    }
                },
                "snmp_switch.office": {
                    "title": "Office",
                    "units": "kilobits/s",
                    "type": "area",
                    "priority": 1,
                    "family": "ports",
                    "dimensions": {
                        "in": {
                            "oid": ".1.3.6.1.2.1.xx.1.1.1.6.10",
                            "algorithm": "incremental",
                            "multiplier": 8,
                            "divisor": 1024,
                            "offset": 0
                        },
                        "out": {
                            "oid": ".1.3.6.1.2.1.xx.1.1.1.10.10",
                            "algorithm": "incremental",
                            "multiplier": -8,
                            "divisor": 1024,
                            "offset": 0
                        }
                    }
                },
                "snmp_switch.OIXP": {
                    "title": "OIXP",
                    "units": "kilobits/s",
                    "type": "area",
                    "priority": 1,
                    "family": "ports",
                    "dimensions": {
                        "in": {
                            "oid": ".1.3.6.1.2.1.xx.1.1.1.6.6",
                            "algorithm": "incremental",
                            "multiplier": 8,
                            "divisor": 1024,
                            "offset": 0
                        },
                        "out": {
                            "oid": ".1.3.6.1.2.1.xx.1.1.1.10.6",
                            "algorithm": "incremental",
                            "multiplier": -8,
                            "divisor": 1024,
                            "offset": 0
                        }
                    }
                },
                "snmp_switch.upstream": {
                    "title": "upstream",
                    "units": "kilobits/s",
                    "type": "area",
                    "priority": 1,
                    "family": "ports",
                    "dimensions": {
                        "in": {
                            "oid": ".1.3.6.1.2.1.xx.1.1.1.6.5",
                            "algorithm": "incremental",
                            "multiplier": 8,
                            "divisor": 1024,
                            "offset": 0
                        },
                        "out": {
                            "oid": ".1.3.6.1.2.1.xx.1.1.1.10.5",
                            "algorithm": "incremental",
                            "multiplier": -8,
                            "divisor": 1024,
                            "offset": 0
                        }
                    }
                }
            }
        }
    ]
}

Kemudian buatkan 1 file kembali untuk Dashboard Kustom, contohnya adalah dash.html. Dengan data sebagai berikut :

<!-- snip netdata -->
<body>
<div style="width: 100%; text-align: center; display: inline-block;">

    <div style="width: 100%; height: 24vh; text-align: center; display: inline-block;">
        <div style="width: 100%; height: 15px; text-align: center; display: inline-block;">
            <b>Traffic to Upstream & OIXP</b>
        </div>
        <div style="width: 100%; height: calc(100% - 15px); text-align: center; display: inline-block;">
            <br/>
                <div data-netdata="snmp_switch.OIXP"
                        data-dimensions="in"
                        // data-common-max="netdata-net-in"
                        data-decimal-digits="0"
                        data-title="OIXP TX"
                        data-chart-library="easypiechart"
                        data-width="15%"
                        data-height="100%"
                        data-after="-300"
                        data-points="300"
                        ></div>
                <div data-netdata="snmp_switch.OIXP"
                        data-dimensions="out"
                        // data-common-max="netdata-net-out"
                        data-decimal-digits="0"
                        data-title="OIXP RX"
                        data-chart-library="easypiechart"
                        data-width="15%"
                        data-height="100%"
                        data-after="-300"
                        data-points="300"
                        ></div>
               <div data-netdata="snmp_switch.upstream"
                        data-dimensions="in"
                        // data-common-max="netdata-net-in"
                        data-decimal-digits="0"
                        data-title="Upstream TX"
                        data-chart-library="easypiechart"
                        data-width="15%"
                        data-height="100%"
                        data-after="-300"
                        data-points="300"
                        ></div>
                <div data-netdata="snmp_switch.upstream"
                        data-dimensions="out"
                        data-decimal-digits="0"
                        data-title="Upstream RX"
                        data-chart-library="easypiechart"
                        data-width="15%"
                        data-height="100%"
                        data-after="-300"
                        data-points="300"
                        ></div>
               <div data-netdata="snmp_switch.office"
                        data-dimensions="in"
                        data-decimal-digits="0"
                        data-title="Office TX"
                        data-chart-library="easypiechart"
                        data-width="15%"
                        data-height="100%"
                        data-after="-300"
                        data-points="300"
                        ></div>
                <div data-netdata="snmp_switch.office"
                        data-dimensions="out"
                        data-decimal-digits="0"
                        data-title="Office RX"
                        data-chart-library="easypiechart"
                        data-width="15%"
                        data-height="100%"
                        data-after="-300"
                        data-points="300"
                        ></div>
        </div>
    </div>

    <div style="width: 100%; height: 24vh; text-align: center; display: inline-block;">
        <div style="width: 100%; height: 15px; text-align: center; display: inline-block;">
            <b>Traffic to Development</b>
        </div>
        <div style="width: 100%; height: calc(100% - 15px); text-align: center; display: inline-block;">
               <div data-netdata="snmp_switch.port3"
                        data-dimensions="in"
                        data-decimal-digits="0"
                        data-title="port3 TX"
                        data-chart-library="easypiechart"
                        data-width="15%"
                        data-height="100%"
                        data-after="-300"
                        data-points="300"
                        ></div>
                <div data-netdata="snmp_switch.port3"
                        data-dimensions="out"
                        data-decimal-digits="0"
                        data-title="Port3 RX"
                        data-chart-library="easypiechart"
                        data-width="15%"
                        data-height="100%"
                        data-after="-300"
                        data-points="300"
                        ></div>
                <div data-netdata="snmp_switch.port7"
                        data-dimensions="in"
                        data-decimal-digits="0"
                        data-title="Port7 TX"
                        data-chart-library="easypiechart"
                        data-width="15%"
                        data-height="100%"
                        data-after="-300"
                        data-points="300"
                        ></div>
                <div data-netdata="snmp_switch.port7"
                        data-dimensions="out"
                        data-decimal-digits="0"
                        data-title="Port7 RX"
                        data-chart-library="easypiechart"
                        data-width="15%"
                        data-height="100%"
                        data-after="-300"
                        data-points="300"
                        ></div>
    </div>

    <div style="width: 100%; height: 23vh; text-align: center; display: inline-block;">
        <div style="width: 100%; height: 15px; text-align: center; display: inline-block;">
           <h2> <b>Netdata Core Health</b> </h2> </br> </br>
        </div>
        <div style="width: 100%; max-height: calc(100% - 15px); text-align: center; display: inline-block;">
                <div data-netdata="snmp_switch.health"
                        data-dimensions="volt"
                        data-decimal-digits="1"
                        data-title="Voltage"
                        data-chart-library="gauge"
                        data-width="15%"
                        data-height="100%"
                        data-after="-300"
                        data-points="300"
                        data-units="volt"
                        ></div>
                <div data-netdata="snmp_switch.health"
                        data-dimensions="temp"
                        data-decimal-digits="0"
                        data-title="Temperature"
                        data-chart-library="gauge"
                        data-width="15%"
                        data-height="100%"
                        data-after="-300"
                        data-points="300"
                        data-units="Celcius"
                        ></div>
                                        <div data-netdata="snmp_switch.health"
                        data-dimensions="cpu-temp"
                        data-decimal-digits="0"
                        data-title="CPU Temperature"
                        data-chart-library="gauge"
                        data-width="15%"
                        data-height="100%"
                        data-after="-300"
                        data-points="300"
                        data-units="Celcius"
                        ></div>
                <div data-netdata="snmp_switch.health"
                        data-dimensions="fan1"
                        data-decimal-digits="0"
                        data-title="FAN Speed 01"
                        data-chart-library="gauge"
                        data-width="15%"
                        data-height="100%"
                        data-after="-300"
                        data-points="300"
                        data-units="RPM"
                        ></div>
                <div data-netdata="snmp_switch.health"
                        data-dimensions="fan2"
                        data-decimal-digits="0"
                        data-title="FAN Speed 02"
                        data-chart-library="gauge"
                        data-width="15%"
                        data-height="100%"
                        data-after="-300"
                        data-points="300"
                        data-units="RPM"
                        ></div>
            </div>
        </div>
    </div>
</div>
</body>

Tangkapan Layar

Sandy Ad