cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
17414
Views
15
Helpful
10
Replies

Perfmon CPU

doug syer
Level 1
Level 1

I am working on a development project where I am querying the PerfMon Processor object to get statistics.

I am sucessfully querying hundreds of different stats using the python client we have developed however when I query Proccessor (ie CPU NOT process) counters they are always 0....

                perfmon_counter: "% CPU Time"

                perfmon_counter: IOwait Percentage

                perfmon_counter: Idle Percentage

                perfmon_counter: Irq Percentage

                perfmon_counter: Nice Percentage

                perfmon_counter: Softirq Percentage

                perfmon_counter: Steal Percentage

                perfmon_counter: System Percentage

                perfmon_counter: User Percentage

there are the counters i an querying...i am getting results...they are not Null/None, they are just integer 0....always...

the _Total Instance is always 0 as well as the invidividual CPU instances (named 0, 1 etc respectively)

Im testing on a 9.x and 10.x call manager.  Im sure they arent always 0, one of the call managers im using to test is quite busy...

when i query individual processors via snmp, we get data but that doesnt give you wait time and id much rather use serviceability/xml api  for everything..

any ideas?

doug

10 Replies 10

dstaudt
Cisco Employee
Cisco Employee

Make sure you are using the 'session' mechanism (open -> add counter -> collect), as the service requires multiple data points to calculate some stats (like percentages.)

Interesting, i am using the open-> add->collect, close mechanism but im not persisting the sessions across polls yet.  i was planning on adding that once i verified all the data was good but it looks like I need to do that now.  i have the session id caching mechanism im place just need to finish the rest.

I will try that and re post with results.

do you know which object/counters require the session to persist?  if that is the case, should I throw out the data for % based stats for the first poll since it will always be 0?

I'm not aware of a deterministic way to find out ahead of time, though I can't think of any off the top besides percentages.

Ignoring the first poll would right.

Using the session key fixed this by the way although the cms we monitor were also upgraded at some point but im using the sessions instead of creating and closing on every poll and the data looks good.  Thanks!

Hi,

I have the problem too with PerfMon Processor object.
How do I solve the problem? API logging looks good.

Hi,
We are trying the same method of opening a session [fetch sessionId]-> adding a counter (with instance name) to the sessionId --> and fetch session.

But we are still getting the value as 0 and Cstatus =2 (which is not ideal)
Attaching the payload and response from Postman.

Can you have a look and let me know what am I missing?

Hi

at first glance, your request looks good.
I think the waiting time between "perfmonAddCounter" and "perfmonCollectSessionData" is too low.
I built a waiting time of 15 seconds into my Python Script and it works for CUCM, IMP, CUxN and UCCX.
I've still attached my payload content. I hope it's helpful?!

 

Hi  BjoernMartin ,
Thanks for the reply,
I added the sleep time of 15 seconds in python script...even tried re running fetch session after 15-20 seconds . But Did not seem to work.

However when I compared the response you shared and one I got from our try
The CStatus obtained in the fetch session data =2 (documentation says it should be 0/1) Not sure of the reason for Cstatus =2.

I think I am missing some requirement for the perfMon :
The application user has the Service Monitoring Access Control group and has SOAP services in running state as per document here : https://d1nmyq4gcgsfi5.cloudfront.net/site/sxml/learn/getting-started/perfmon/
Could there be any other role /service we should add which I might be missing?

Thanks,
EDIT : After creating the session, I tried creating 

PerfmonBinding and now it is returning the proper values.

Thanks



Do you know how does it calculate CPU Utilization in session mechanism ?

Thanks,
Prama

Cole.Aten
Level 1
Level 1

The object you are pulling from has instances, this can be seen by using the following URL:

https://X.X.X.X/ast/AstIsapi.dll?PerfmonListObject

<Object Name="Processor" HasInstances="true">

<Counter Name="% CPU Time"/>

<Counter Name="IOwait Percentage"/>

<Counter Name="Idle Percentage"/>

<Counter Name="Irq Percentage"/>

<Counter Name="Nice Percentage"/>

<Counter Name="Softirq Percentage"/>

<Counter Name="Steal Percentage"/>

<Counter Name="System Percentage"/>

<Counter Name="User Percentage"/>

</Object>

With that being said, how are you adding your instanced counters? They should look something like

\\x.x.x.x\object(instancename)\countername

You can gather the instance names via the perfmonListCounter and perfmonListInstance mechanisms.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: