Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

need your help about resource logs

avatar
Explorer

Hello.

 

I'm a new guy using Coludera.

I have very simple question about a log.

 

I need to check every single minute's resource's log such as cpu usage, mem usage, disk I/O etc,

but it's hard to find that kinds of data in log files.

To be more specific, I want to utilize resource logs as data frame shape

for recognizing whether the server is going well or not.

 

so, can I obtain resource data ?

 

Aplogies for this stupid question. Appreciate your response.

 

 

1 ACCEPTED SOLUTION

avatar
Master Guru
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
2 REPLIES 2

avatar
Master Guru
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Explorer

Hi Ben, 

 

Appreciate your quick and kind response. 

 

I have one more question.

After reading your answer, I've started to develope using "time-seriese" api.

During programming, I found a problem with data before about 30 days.

I'd like to obtain a every single minute's data of whole period but, It might be only available every 10 minute's( or longer)  data set

when I tried to get old resource data.

 

I used this api below.

Could you help me know how to get every single minute's such as, cpu/mem usage ?

 

import time
import datetime

api_instance = cm_client.TimeSeriesResourceApi(api_client)
from_time = datetime.datetime.fromtimestamp(time.time() - 7776000)
to_time = datetime.datetime.fromtimestamp(time.time())
query = "select cpu_user_rate "\
" where entityname = 'xx' "
# Retrieve time-series data from the Cloudera Manager (CM) time-series data store using a tsquery.
result = api_instance.query_time_series(_from=from_time, query=query, to=to_time)#, desired_rollup='RAW', must_use_desired_rollup = 'true')
ts_list = result.items[0]
for ts in ts_list.time_series:
print (ts.metadata.attributes['entityName'], ts.metadata.metric_name)
for point in ts.data:
print (point.timestamp, point.value)

 

Appreciate your response.

Ben,