Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

henrydoan
Kilo Explorer

To update the Discovery "Linux - Distribution" probe to account for Debian hosts, add the following to the probe's post processor script (addition highlighted in blue):

...

        else if (lowercaseOutput.indexOf('centos') != -1) {

                  current.os = "Linux CentOS";

                  versionMatch = /release ([0-9\.]+)/.exec(lowercaseOutput);

        }

        else if (lowercaseOutput.indexOf('ubuntu') != -1) {

                  current.os = "Linux Ubuntu";

                  versionMatch = /version="([0-9\.]+)/.exec(lowercaseOutput);

        }

        else if (lowercaseOutput.indexOf('debian') != -1) {

                  current.os = "Linux Debian";

                  versionMatch = /debian \\m ([0-9\.\-]+)/.exec(lowercaseOutput);

        }

        else {

                  current.os = "GNU/Linux";

        }

        if(versionMatch && versionMatch[1])

                  current.os_version = versionMatch[1];

  },

  type: "ProbePostProcessor"

});


The corresponding probe parameter also required (Debian generally has a /etc/issue file instead of /etc/*release):

#!/bin/sh

if [ -f /etc/*release ]; then

        cat /etc/*release

else

        cat /etc/issue

fi

Version history
Last update:
‎08-21-2017 10:30 AM
Updated by: