Custom Icons for Device

Hello everyone!

I am trying to correct the icon on one my added devices, an unRAID server. LibreNMS picks it up as a generic linux server and gives it the penguin icon. I’d like to change it so that it has the unRAID icon. I think this is happening because libreNMS is getting the Object ID .1.3.6.1.4.1.8072.3.2.10 as “Linux 4.19.107-Unraid”

So I had the idea to create an unraid.yaml file in /opt/librenms/includes/definitions by simple copying the linux.yaml file and tweaking it to what is below as well as copying a png file into the /opt/librenms/html/images/os folder (unraid.png).

os: unraid                 <--- My change
type: server
group: unix
text: unRAID         <--- My change
ifXmcbc: true
ifname: true
over:
    - { graph: device_processor, text: 'Processor Usage' }
    - { graph: device_ucd_memory, text: 'Memory Usage' }
    - { graph: device_storage, text: 'Storage Usage' }
poller_modules:
    bgp-peers: false
    ospf: false
    stp: false
discovery_modules:
    applications: true
    bgp-peers: false
    stp: false
    vmware-vminfo: true
    libvirt-vminfo: true
processor_stacked: true
discovery:
    -
        sysObjectID: .1.3.6.1.4.1.8072.3.2.10
    -
        sysDescr_regex: '/Unraid/i'                <-------------- My Change

This did not work.

So I am stumped on how to do this. I did read that modifying the config.php files would be better

$config['os']['unraid']['icon'] = 'unraid';

But that did not work either. After some digging I found this as a suggestion:

$config['os']['unraid'] = [
       'os'   => 'Linux 4.19.107-Unraid',    <--- Was not sure what to put here.
       'text' => 'UnRAID',
       'type' => 'Server',
       'icon' => 'unraid'
];

This also did not work.

I get that the second set of brackets is for the identifier for the OS in libreNMS, and I suspect I need to make that a regex (/Unraid/i) but I have no idea how to do that, and the documentation is not helping me work it out.

Any help would be greatly appreciated.

Thanks in advance!

You have two options:
set up the distro script (and make sure it returns unraid) on your device
create a new os. following the docs will get you a lot further :slight_smile:

I have been trying to find this in the docs, but I cannot find it. So would you be able to link me to the part of the docs that explains how to do this?

https://docs.librenms.org/Support/SNMP-Configuration-Examples/#linux-snmpd-v2
https://docs.librenms.org/Developing/Support-New-OS/