leider noch ganz am Anfang mit Python hänge ich ein ein wenig in der Luft. Deshalb bin ich mir auch nicht sicher nach was ich im Forum suchen soll!
Ich lese ein JSON File aus. Als Ausgabe erhalte ich -- Auszug --
Code: Alles auswählen
{u'conf_instance_id': u'i-02bf3e0d8310045ff', u'action_ids': [{u'alert_type': -1, u'action_id': u'36397000015702831'}], u'display_name': u'ascent-prototype.hannover-re.cloud (AWS)', u'is_upgrade_available': True, u'notification_profile_id': u'36397000014036143', u'one_min_supported': True, u'monitor_id': u'36397000016333145', u'threshold_profile_id': u'36397000009798032', u'templateid': u'-', u'server_type': u'WINDOWS', u'monitor_groups': [u'36397000018614237'], u'state': 0, u'sm_poll_interval': 5, u'type': u'SERVER', u'user_group_ids': [u'36397000015100413'], u'log_needed': True, u'resource_not_supported': False, u'ipaddress': u'10.151.148.135', u'hostname': u'app1'}
Code: Alles auswählen
36397000021074195, SERVER, apex.hannover-re.cloud, True, 36397000014036143, [u'36397000003139007', u'36397000010098005']
Code: Alles auswählen
monitorids = monitor_list()
filtered_result = []
for monitor_entry in monitorids:
filtered_result.append("{monitor_id}, {type}, {display_name}, {log_needed}, {notification_profile_id}, {user_group_ids}".format(**monitor_entry))
result = filtered_result
print (result)
Wahrscheinlich wieder einmal ganz simple, aber wie das so ist -- schön wäre ein "Anstupser"
Danke Jörg