Showing results for 
Search instead for 
Did you mean: 

Trying to get juicy pie chart from ad hoc query


I am looking to try to browse direct to the output of an ad hoc query, when that output is a pie chart.  I am not sure if this is possible, so am wondering if somebody could give me a 'no' or nudge me in the right direction.  I have been playing around with a simple query of displaying agent versions for managed systems.

Yes, I am going for a quick answer, but I am still digging around at the moment.  I am *guessing* that there is specific code behind the pie charts that parses the query XML, and this may not be possible at present (or at least possible in a relatively simple manner!)


My stumbling around/playing has gotten me a little more used to what is going on:

Query export:
  <name language="en">Query: Managed Agent Versions</name>
  <description language="en"></description>
  <property name="target">EPOLeafNode</property>
  <property name="tableURI">query:table?orion.table.columns=EPOLeafNode.NodeName%3AEPOProdPropsView_EPOAGENT.hotfix%3AEPOProdPropsView_EPOAGENT.productversion&amp;orion.table.order=az&amp;</property>
  <property name="conditionURI">query:condition?orion.condition.sexp=%28+where+%28+stateEq+EPOLeafNode.ManagedState+%22managed%22+%29+%29</property>
  <property name="summaryURI">query:summary?orion.query.type=pie.pie&amp;orion.sum.query=true&amp;show.percentage=false&amp;;orion.sum.order=desc&amp;orion.sum.limit.count=360&amp;orion.sum.aggregation=count&amp;orion.sum.aggregation.showTotal=true</property>

Translation (original attempt and now working):

DOES NOT WORK (receives 'Conversion failed when converting from a character string to uniqueidentifier'):
EPOLeafNode.NodeName EPOProdPropsView_EPOAGENT.hotfix EPOProdPropsView_EPOAGENT.productversion)&where=(where(eq EPOLeafNode.ManagedState "managed"))&order=(order(asc EPOLeafNode.NodeName))

WORKS (removed where clause to troubleshoot):
EPOLeafNode.NodeName EPOProdPropsView_EPOAGENT.hotfix EPOProdPropsView_EPOAGENT.productversion)&order=(order(asc EPOLeafNode.NodeName))

Looking at https://<server>:<port>/remote/core.listTables, I found that ManagedState field was of type managedState, and not of type string.
Looking at https://<server>:<port>/remote/core.listDatatypes, I can see that the allowed operations list is limited to: stateEq, soo realising that I had not seen the 'state' bit in the query export....

https://<server>:<port>/remote/core.executeQuery?target=EPOLeafNode&select=(select EPOLeafNode.NodeN... EPOProdPropsView_EPOAGENT.hotfix EPOProdPropsView_EPOAGENT.productversion)&where=(where(stateEq EPOLeafNode.ManagedState "managed"))&order=(order(asc EPOLeafNode.NodeName))

and voila!