CraftComputing / ProjectAxeEffect

42 stars 2 forks source link

NMS Configuration - LibreNMS #13

Open aolsonesxtech opened 4 months ago

aolsonesxtech commented 4 months ago

I was able to add a custom OS and discovery to get both temperature and humidity to librenms

2 files are needed. 1 in %librenms_directory%/includes/definitions/axeeffect.yaml

os: axeeffect
text: 'AxeEffect Environmental Probe'
type: environment
icon: generic
over:
    - { graph: device_temperature, text: Temperature }
    - { graph: device_humidity, text: Humidity }
    - { graph: device_ping_perf, text: 'ICMP Response' }
discovery:
    - sysObjectID:
        - .1.3.6.1.4.1.26381
discovery_modules:
    ports: false
    ports-stack: false
    entity-physical: false
    processors: false
    mempools: false
    cisco-vrf-lite: false
    storage: false
    hr-device: false
    discovery-protocols: false
    bgp-peers: false
    vlans: false
    ucd-diskio: false
    services: false
    stp: false
    ntp: false
    wireless: false
    fdb-table: false
poller_modules:
    ipmi: false
    entity-physical: false
    processors: false
    mempools: false
    storage: false
    netstats: false
    hr-mib: false
    ucd-mib: false
    ipSystemStats: false
    ports: false
    bgp-peers: false
    ospf: false
    ucd-diskio: false
    services: false
    stp: false
    ntp: false
    wireless: false
    fdb-table: false
    applications: false

and in %librenms_directory%/includes/definitions/discovery/axeeffect.yaml

mib: ENTITY-SENSOR-MIB
modules:
    sensors:
        temperature:
            data:
                -
                    oid:  entPhySensorTable
                    value: entPhySensorValue
                    divisor: 100
                    num_oid: '.1.3.6.1.2.1.99.1.1.1.4.0.{{ $index }}'
                    descr: 'Temperature'
                    index: 'entPhySensorValue.{{ $index }}'
        humidity:
            data:
                -
                    oid:  entPhySensorTable
                    value: entPhySensorValue
                    descr: 'Humidity'
                    divisor: 1000
                    num_oid: '.1.3.6.1.2.1.99.1.1.2.4.0'

if/when the final one comes out with more sensors, we may have to modify the naming here to specify which probe is which.

aolsonesxtech commented 4 months ago

@CraftComputing, feel free to use this for the documentation. I imagine we are going to amass quite a few of these.

cjhammel commented 4 months ago

@aolsonesxtech, Was there anything else that you needed to do in librenms to get it to see the AxeEffect device? I have created the files and restarted my librenms server and librenms is not discovering the AxeEffect device correctly. It still sees it as Hytera Repeater.

aolsonesxtech commented 4 months ago

@cjhammel did you add these files before or after discovery? if I recall correctly, lnms only does a discovery job once ever so often, so it may take a a bit if you added the device, then added these files. Also it's doing the correlation of the name (and what settings to use) based on sysObjectID: - .1.3.6.1.4.1.26381. can you check yours and see if it's reporting the same as mine? I only have one, so my sample size isn't very large.

cjhammel commented 4 months ago

@aolsonesxtech, OK I previously had the device in lnms before I added your yaml files. Once I deleted the device and added it back in lnms picked it correctly.

aolsonesxtech commented 4 months ago

for what it's worth, you don't have to delete, on the configuration page of that device, there's a "rediscover device" option there.

image

Happy it worked now though!

cjhammel commented 4 months ago

I tried that and lnms would not discover it correctly. It took deleting and re adding.

defunctknightsurfer commented 1 month ago

Thank you. I did have to make a modification to includes/definitions/discovery/axeeffect.yaml on my version, and remove the index reference.

OS Version: axe-effect_v1.3.uf2

mib: ENTITY-SENSOR-MIB
modules:
    sensors:
        temperature:
            data:
                -
                    oid:  entPhySensorTable
                    value: entPhySensorValue
                    divisor: 100
                    num_oid: '.1.3.6.1.2.1.99.1.1.1.4.0'
                    descr: 'Temperature'
        humidity:
            data:
                -
                    oid:  entPhySensorTable
                    value: entPhySensorValue
                    descr: 'Humidity'
                    divisor: 1000
                    num_oid: '.1.3.6.1.2.1.99.1.1.2.4.0'