[snmp] CPU usage per core
import netsnmp CPU_TYPE = '.1.3.6.1.2.1.25.3.1.3'CORE_USAGE = '.1.3.6.1.2.1.25.3.3.1.2.' # +IDCORE_NAME = '.1.3.6.1.2.1.25.3.2.1.3.' # +IDdef get_cpu_usage(host,version=2,community='public'): s = netsnmp.Session(DestHost=host, Version=version, Community=community) vars = netsnmp.VarList(netsnmp.Varbind('.1.3.6.1.2.1.25.3.2.1.1')) #count resouces resources = s.walk(vars) cpu_res = {} for res in r..