11-12-2015 10:45 AM
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
11-12-2015 10:51 AM
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.)
11-12-2015 11:18 AM
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?
11-12-2015 11:22 AM
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.
04-19-2016 06:01 AM
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!
04-20-2020 12:47 AM
02-02-2021 11:39 PM
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?
02-03-2021 12:26 AM
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?!
02-03-2021 01:07 AM - edited 02-03-2021 02:42 AM
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
04-02-2017 12:40 AM
Do you know how does it calculate CPU Utilization in session mechanism ?
Thanks,
Prama
04-06-2017 10:41 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide