コード例 #1
0
    def start_time(self):
        """
        Gets the timestamp of the metric data, converting it from an AppDynamics timestamp to standard
        Python :class:`datetime`.

        :return: Time the violation was resolved
        :rtype: :class:`datetime.datetime`
        """
        return from_ts(self.start_time_ms)
コード例 #2
0
    def end_time(self):
        """
        Gets the end time of the violation, converting it from an AppDynamics timestamp to standard
        Python :class:datetime.

        :return: Time the violation was resolved
        :rtype: datetime
        """
        return from_ts(self.end_time_ms)
コード例 #3
0
    def start_time(self):
        """
        Gets the timestamp of the metric data, converting it from an AppDynamics timestamp to standard
        Python :class:`datetime`.

        :return: Time the violation was resolved
        :rtype: :class:`datetime.datetime`
        """
        return from_ts(self.start_time_ms)
コード例 #4
0
 def created_on(self):
     """
     :rtype: datetime.datetime
     """
     return from_ts(self.created_on_ms)
コード例 #5
0
 def detected_time(self):
     return from_ts(self.detected_time_ms)
コード例 #6
0
 def start_time(self):
     return from_ts(self.start_time_ms)
コード例 #7
0
gn_prod = [x for x in apps if x.name == "MyApp"][0]

# Calculate start and end times for the report: 24h period ending with midnight last night
#
today = to_ts(datetime.now().date())
yesterday = today - (86400 * 1000)

# Get the list of nodes so we can look up by node_id
#
all_nodes = c.get_nodes(gn_prod.id)
nodes_by_id = dict(list(zip([x.id for x in all_nodes], all_nodes)))

# Get all health rule violations and print them
#
violations = c.get_healthrule_violations(gn_prod.id,
                                         'BETWEEN_TIMES',
                                         start_time=yesterday,
                                         end_time=today)
for v in violations:
    print("-" * 70)
    print("Start time:   ", from_ts(v.start_time_ms))
    print("End time:     ", from_ts(v.end_time_ms))
    print("Description:  ", v.description)
    print("Details:      ", v.deep_link_url)
    if v.affected_entity.type == "APPLICATION_COMPONENT_NODE":
        try:
            print("Affected Node: ",
                  nodes_by_id[v.affected_entity.entity_id].name)
        except KeyError:
            print("Affected Node: UNKNOWN")
コード例 #8
0
 def created_on(self):
     """
     :rtype: datetime.datetime
     """
     return from_ts(self.created_on_ms)
コード例 #9
0
# Get the application list and find "MyApp"
#
apps = c.get_applications()
gn_prod = [x for x in apps if x.name == "MyApp"][0]

# Calculate start and end times for the report: 24h period ending with midnight last night
#
today = to_ts(datetime.now().date())
yesterday = today - (86400 * 1000)

# Get the list of nodes so we can look up by node_id
#
all_nodes = c.get_nodes(gn_prod.id)
nodes_by_id = dict(list(zip([x.id for x in all_nodes], all_nodes)))

# Get all health rule violations and print them
#
violations = c.get_healthrule_violations(gn_prod.id, 'BETWEEN_TIMES', start_time=yesterday, end_time=today)
for v in violations:
    print("-" * 70)
    print("Start time:   ", from_ts(v.start_time_ms))
    print("End time:     ", from_ts(v.end_time_ms))
    print("Description:  ", v.description)
    print("Details:      ", v.deep_link_url)
    if v.affected_entity.type == "APPLICATION_COMPONENT_NODE":
        try:
            print("Affected Node: ", nodes_by_id[v.affected_entity.entity_id].name)
        except KeyError:
            print("Affected Node: UNKNOWN")

コード例 #10
0
 def server_start_time(self):
     return from_ts(self.server_start_time_ms)
コード例 #11
0
 def local_start_time(self):
     return from_ts(self.local_start_time_ms)