cancel
Showing results for 
Search instead for 
Did you mean: 

Policy Auditor API Query

Jump to solution

So I have successfully used the executeQuery command to extract all sorts of other data sets but when I am attempting to query Policy Auditor data I run into a issue. Has anyone else seen this?

mc = mcafee.client(address, port, username, password)

target = 'PAAuditRuleResultView'

select = '(PAAuditRuleResultView.BenchmarkID PAAuditRuleResultView.RuleID PAXRuleTextView.Title)'

where = '( where ( and ( eq PAAuditRuleResultView.ActualResult "fail" ) ( eq PAAuditRuleResultView.IsCurrentResult t ) ( eq PAAuditRuleResultView.SystemName "%s" ) ) )' % (systemname)

order = '(order(asc PAAuditRuleResultView.BenchmarkID))'

data = mc.core.executeQuery(target=target, select=select, where=where, order=order)

When I run this code I get this error

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "mcafee.py", line 454, in __call__

    raise e

mcafee.CommandInvokerError: Invalid S-expression in 'select' clause: PAAuditRuleResultView.BenchmarkID

Message was edited by: mrjester on 9/23/13 8:02:23 PM CDT
1 Solution

Accepted Solutions
Highlighted

Re: Policy Auditor API Query

Jump to solution

I don't use python on a regular basis... but did you forget the 'select' part of the command?

select = '(select PAAuditRuleResultView.BenchmarkID PAAuditRuleResultView.RuleID PAXRuleTextView.Title)'

2 Replies
Highlighted

Re: Policy Auditor API Query

Jump to solution

I don't use python on a regular basis... but did you forget the 'select' part of the command?

select = '(select PAAuditRuleResultView.BenchmarkID PAAuditRuleResultView.RuleID PAXRuleTextView.Title)'

Re: Policy Auditor API Query

Jump to solution

Yep that is exactly what it was apparently I had been looking at code too long yesterday and totally overlooked that. Found it this morning upon coming in. Thankks for the help

More McAfee Tools to Help You

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from McAfee experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by McAfee employees.
Join the Community
Join the Community