'Update the host/system info using the input method.
Return the stats (dict)'

@GlancesPlugin._check_decorator
@GlancesPlugin._log_result_decorator
def update(self):

    self.reset()
    if (self.input_method == 'local'):
        self.stats['os_name'] = platform.system()
        self.stats['hostname'] = platform.node()
        self.stats['platform'] = platform.architecture()[0]
        if (self.stats['os_name'] == 'Linux'):
            try:
                linux_distro = platform.linux_distribution()
            except AttributeError:
                self.stats['linux_distro'] = _linux_os_release()
            else:
                if (linux_distro[0] == ''):
                    self.stats['linux_distro'] = _linux_os_release()
                else:
                    self.stats['linux_distro'] = '    '.join(linux_distro[:2])
            self.stats['os_version'] = platform.release()
        elif (self.stats['os_name'].endswith('BSD') or (self.stats['os_name'] == 'SunOS')):
            self.stats['os_version'] = platform.release()
        elif (self.stats['os_name'] == 'Darwin'):
            self.stats['os_version'] = platform.mac_ver()[0]
        elif (self.stats['os_name'] == 'Windows'):
            os_version = platform.win32_ver()
            self.stats['os_version'] = '    '.join(os_version[::2])
            if ((self.stats['platform'] == '32bit') and ('PROCESSOR_ARCHITEW6432' in os.environ)):
                self.stats['platform'] = '64bit'
        else:
            self.stats['os_version'] = ''
        if (self.stats['os_name'] == 'Linux'):
            self.stats['hr_name'] = self.stats['linux_distro']
        else:
            self.stats['hr_name'] = '{}    {}'.format(self.stats['os_name'], self.stats['os_version'])
        self.stats['hr_name'] += '    {}'.format(self.stats['platform'])
    elif (self.input_method == 'snmp'):
        try:
            self.stats = self.get_stats_snmp(snmp_oid=snmp_oid[self.short_system_name])
        except KeyError:
            self.stats = self.get_stats_snmp(snmp_oid=snmp_oid['default'])
        self.stats['os_name'] = self.stats['system_name']
        if (self.short_system_name == 'windows'):
            for (r, v) in iteritems(snmp_to_human['windows']):
                if re.search(r, self.stats['system_name']):
                    self.stats['os_name'] = v
                    break
        self.stats['hr_name'] = self.stats['os_name']
    return self.stats
