Exemple #1
0
def my_get_snmp_data(device_tuple, user_tuple, oids_dict):
    snmp_data_dict = myDict()
    snmp_data_dict['epoch'] = str(time.time())
    for oid_alias, oid_string in oids_dict.items():
        snmp_data_dict[oid_alias] = get_snmp_data(
            tuple(device_tuple),
            tuple(user_tuple),
            oid_string
        )
    return dict(snmp_data_dict)
Exemple #2
0
 def get_snmp(self, device_tuple, oid_string, index):
     if self.test is True:
         self.last = self.last + randint(100, 2000)
         snmp_data = self.last
         return snmp_data
     oid_string = '.'.join([oid_string, str(index)])
     snmp_data = get_snmp_data(
         tuple(device_tuple),
         tuple(self.user_tuple),
         oid_string
     )
     return snmp_data