Giter VIP home page Giter VIP logo

prtg-custom-rest-sensor-templates's Introduction

prtg-custom-rest-sensor-templates

PRTG custom REST sensor templates

This repository contains a collection of .template files used within the PRTG monitoring platform that allow to parse REST calls and map to PRTG sensor-channels.

Current collections:

TrueNAS monitoring for:

  • Pool health
  • Pool disks health (each disk and summary of all disks) (1)
  • Pool free space (percentage free space, "logical" and "physical") (2)
  • Replication health

Notes

(1) Disk health sensor creates a subchannel per disk. Please notice that PRTG supports a max of 50 sub channels. Any number of channels over that will cause the sensor to be in a failed state

(2) Physical free space uses metrics from TrueNAS that report snapshot utilization. Logical free space is based on each volume within the pool, which in aggregate appear not to take into account snapshot utilization.

Resources

PRTG custom sensor documentation: https://www.paessler.com/manuals/prtg/custom_sensors#advanced_sensors

PRTG REST custom sensor documentation: https://www.paessler.com/manuals/prtg/rest_custom_sensor#jsonpath

JSONPath online evaluator: https://jsonpath.com

PRTG has a very useful tool to test the custom REST template files. This utility makes the specified REST call and then processes the JSON result using it's own JSONPath library with the template specified. This tool uses the same logic as PRTG internally so the result of the rest.exe execution will match an execution done from within PRTG vs. the online JSONPath parsing tool which has limited support for how PRTG processes custom REST sensors.

Example usage of rest.exe utility contained within PRTG to test REST custom sensors:

Within PowerShell or Windows cmd, cd until you get to C:\Program Files (x86)\PRTG Network Monitor\Sensor System Use the rest.exe contained within that folder in the following way:

.\rest.exe http://<IP Address of TrueNAS>/api/v2.0/pool "..\Custom Sensors\rest\truenas.generic.pool.freespace.template" -customheaders "Authorization:<Your TrueNAS Authorhization token>"

You should see a response like this in the console:

{
  "prtg": {
    "result": [
      {
        "channelid": 0,
        "Value": 169,
        "Unit": "TimeResponse",
        "ShowChart": 0,
        "ShowTable": 0
      },
      {
        "channel": "USMacProRAIDZ",
        "Value": 39.1587156010425,
        "Unit": "Percent",
        "Float": 1,
        "LimitMinWarning": 10,
        "LimitMinError": 5,
        "LimitMode": 1
      },
      {
        "channel": "default",
        "Value": 98.34172341131395,
        "Unit": "Percent",
        "Float": 1,
        "LimitMinWarning": 10,
        "LimitMinError": 5,
        "LimitMode": 1
      },
      {
        "channel": "FileSharePool",
        "Value": 99.99491070944165,
        "Unit": "Percent",
        "Float": 1,
        "LimitMinWarning": 10,
        "LimitMinError": 5,
        "LimitMode": 1
      },
      {
        "channel": "mvdmacproraidzpool",
        "Value": 42.04015769357756,
        "Unit": "Percent",
        "Float": 1,
        "LimitMinWarning": 10,
        "LimitMinError": 5,
        "LimitMode": 1
      },
      {
        "channel": "MVDRAIDZS2DPOOL",
        "Value": 96.6840416973174,
        "Unit": "Percent",
        "Float": 1,
        "LimitMinWarning": 10,
        "LimitMinError": 5,
        "LimitMode": 1
      },
      {
        "channel": "MVDSQLBackups",
        "Value": 99.99959606150682,
        "Unit": "Percent",
        "Float": 1,
        "LimitMinWarning": 10,
        "LimitMinError": 5,
        "LimitMode": 1
      },
      {
        "channel": "USRaidZPool",
        "Value": 77.42501135271881,
        "Unit": "Percent",
        "Float": 1,
        "LimitMinWarning": 10,
        "LimitMinError": 5,
        "LimitMode": 1
      },
      {
        "channel": "DFSStorageTest",
        "Value": 99.77613879788306,
        "Unit": "Percent",
        "Float": 1,
        "LimitMinWarning": 10,
        "LimitMinError": 5,
        "LimitMode": 1
      }
    ]
  }
}

prtg-custom-rest-sensor-templates's People

Contributors

jsbattig avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.