'Update CPU stats using SNMP.'

def update_snmp(self):

    if (self.short_system_name in ('windows', 'esxi')):
        try:
            cpu_stats = self.get_stats_snmp(snmp_oid=snmp_oid[self.short_system_name], bulk=True)
        except KeyError:
            self.reset()
        self.stats['nb_log_core'] = 0
        self.stats['idle'] = 0
        for c in cpu_stats:
            if c.startswith('percent'):
                self.stats['idle'] += float(cpu_stats['percent.3'])
                self.stats['nb_log_core'] += 1
        if (self.stats['nb_log_core'] > 0):
            self.stats['idle'] = (self.stats['idle'] / self.stats['nb_log_core'])
        self.stats['idle'] = (100 - self.stats['idle'])
        self.stats['total'] = (100 - self.stats['idle'])
    else:
        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'])
        if (self.stats['idle'] == ''):
            self.reset()
            return self.stats
        for key in iterkeys(self.stats):
            self.stats[key] = float(self.stats[key])
        self.stats['total'] = (100 - self.stats['idle'])
