librenms / librenms-agent

LibreNMS Agent & Scripts
GNU General Public License v2.0
118 stars 188 forks source link

snmp/distro doesn't show PVE version on PVE host. #282

Closed FingerlessGlov3s closed 4 years ago

FingerlessGlov3s commented 4 years ago

Hi,

When running the distro version detection script, if the host is PVE, it reports back as Debian 10, doesn't carry over the PVE version.

This can be easily fixed by adding IGNORE_OS_RELEASE=1 after the if statement for /usr/bin/pveversion

Verified with latest version of PVE

Before: Debian GNU/Linux 10 Afterr: Debian 10.3/PVE 6.1-8

FingerlessGlov3s commented 4 years ago

After a nights sleep, I thought about pull requesting this change but thought there might be other Distro's with this issue so, not 100% which is the best way to go about it.

SourceDoctor commented 4 years ago

@FingerlessGlov3s is your issue still relevant? Code has a match for Proxmox: https://github.com/librenms/librenms-agent/blob/master/snmp/distro#L63

if it's still the case feel free to write a patch for it

FingerlessGlov3s commented 4 years ago

Hey @SourceDoctor

Just tested it again, and it does match, it gets down to line 105, and changes to what ever os-release says https://github.com/librenms/librenms-agent/blob/a8cb5b0112848010660cca4ebca26313fc625caf/snmp/distro#L105

To fix this I added "IGNORE_OS_RELEASE=1" to line 64 and it works a treat.

Shall I put a PR in for this or will you make a quick commit for it?

SourceDoctor commented 4 years ago

please write a PR keep in mind with the changes don't change output for other systems

FingerlessGlov3s commented 4 years ago

PR Done

https://github.com/librenms/librenms-agent/pull/316