Detect Raspbian, Change Icon?

Is anyone else interested in detecting Raspbian (as Raspbian, not Debian), and then showing the Raspberry Pi icon? I’m thinking digging in to it more, but only if it makes sense for more than just me … :-).

FYI, lsb_release -i returns,
Distributor ID: Raspbian

So pretty easy to detect, agreed?

You should probably do this via the distro script: https://github.com/librenms/librenms-agent/blob/master/snmp/distro

Agreed! Was thinking exactly the same thing - in fact, was playing with this last night. I can make it work … but then further changes on the LibreNMS side, agreed?

Nope, we use what’s returned in distro - well unless you want a logo associating. If so, html/images/os/$name - $name is what you return from distro so maybe use rasbian.

Forgot you had this all set up already!

OK, got it working … minor change to distro, and downloaded the Raspbian logo. Submit as a pull request I assume?

Thanks!

Yes please :slight_smile:

Will do - thanks for the help!

And the distro update to librenms-agent, correct? Just making sure.

BTW, in case it’s easier for you to just add this in - here is the change (in the distro script). Before …
elif [ -f /etc/debian_version ] ; then
DIST=“Debian cat /etc/debian_version
REV=””

And after …
elif [ -f /etc/debian_version ] ; then
DIST="Debian cat /etc/debian_version
REV=”"
ID=lsb_release -i | awk -F ':' '{print $2}' | sed 's/ //g'
if [ “${ID}” = “Raspbian” ] ; then
DIST="Raspbian cat /etc/debian_version"
fi

So just added those last 4 lines in the “debian section”. Thanks.

Hi,

Just checking in - do I need to do anything to get this in to the version of distro on Github? It’s working fine for me locally, but want to share if possible … :).

Thanks!

Submit a pull request :slight_smile:

Done, PR #144 (librenms-agent). Yell if I botched anything!

1 Like