TECHZEN Zenoss User Community ARCHIVE  

Issues with custom report

Subject: Issues with custom report
Author: Tanner Edge
Posted: 2019-01-31 17:04

Hello,

I am attempting to run a report that will return all device names, priorities, states and IP addresses. I have attached the parameters that I am using. The report runs fine, and I can view it in Zenoss, but when I get to page 12 of 14, it errors out. (The error text is posted after this post). When I attempt to export the report, for some reason the IP addresses are very wrong. They are accurate with the report results in Zenoss, but not in the exported document. Any ideas on what could be causing this problem? I don't really need to access page 12 of the report in Zenoss if I can accurately export the data. 

I appreciate any ideas. Thanks. 



------------------------------
Tanner
------------------------------

Attachments:

ReportConditionsZenoss.png



Subject: RE: Issues with custom report
Author: Tanner Edge
Posted: 2019-01-31 17:06

Type: <type 'exceptions.TypeError'> 
Value: sequence item 470: expected string, int found 


Traceback (most recent call last):
File "/opt/zenoss/lib/python/ZPublisher/Publish.py", line 126, in publish
request, bind=1)
File "/opt/zenoss/lib/python/ZPublisher/mapply.py", line 77, in mapply
if debug is not None: return debug(object,args,context)
File "/opt/zenoss/lib/python/ZPublisher/Publish.py", line 46, in call_object
result=apply(object,args) # Type s<cr> to step into published object.
File "/opt/zenoss/lib/python/Shared/DC/Scripts/Bindings.py", line 322, in __call__
return self._bindAndExec(args, kw, None)
File "/opt/zenoss/lib/python/Shared/DC/Scripts/Bindings.py", line 359, in _bindAndExec
return self._exec(bound_data, args, kw)
File "/opt/zenoss/lib/python/Products/CMFCore/FSPageTemplate.py", line 240, in _exec
result = self.pt_render(extra_context=bound_names)
File "/opt/zenoss/lib/python/Products/CMFCore/FSPageTemplate.py", line 180, in pt_render
self, source, extra_context
File "/opt/zenoss/lib/python/Products/PageTemplates/PageTemplate.py", line 79, in pt_render
showtal=showtal)
File "/opt/zenoss/lib/python/zope/pagetemplate/pagetemplate.py", line 132, in pt_render
strictinsert=0, sourceAnnotations=sourceAnnotations
File "/opt/zenoss/lib/python/zope/pagetemplate/pagetemplate.py", line 240, in __call__
interpreter()
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 266, in __call__
self.interpret(self.program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 528, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 513, in do_optTag
return self.no_tag(start, program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 508, in no_tag
self.interpret(program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 883, in do_useMacro
self.interpret(macro)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 528, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 513, in do_optTag
return self.no_tag(start, program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 508, in no_tag
self.interpret(program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 847, in do_condition
self.interpret(block)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 528, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 513, in do_optTag
return self.no_tag(start, program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 508, in no_tag
self.interpret(program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 941, in do_defineSlot
self.interpret(slot)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 528, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 513, in do_optTag
return self.no_tag(start, program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 508, in no_tag
self.interpret(program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 883, in do_useMacro
self.interpret(macro)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 528, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 513, in do_optTag
return self.no_tag(start, program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 508, in no_tag
self.interpret(program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 883, in do_useMacro
self.interpret(macro)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 528, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 513, in do_optTag
return self.no_tag(start, program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 508, in no_tag
self.interpret(program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 949, in do_defineSlot
self.interpret(block)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 528, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 513, in do_optTag
return self.no_tag(start, program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 508, in no_tag
self.interpret(program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 941, in do_defineSlot
self.interpret(slot)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 528, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 513, in do_optTag
return self.no_tag(start, program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 508, in no_tag
self.interpret(program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 941, in do_defineSlot
self.interpret(slot)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 528, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 513, in do_optTag
return self.no_tag(start, program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 508, in no_tag
self.interpret(program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 528, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 513, in do_optTag
return self.no_tag(start, program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 508, in no_tag
self.interpret(program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 883, in do_useMacro
self.interpret(macro)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 528, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 513, in do_optTag
return self.no_tag(start, program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 508, in no_tag
self.interpret(program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 941, in do_defineSlot
self.interpret(slot)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 528, in do_optTag_tal
self.do_optTag(stuff)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 513, in do_optTag
return self.no_tag(start, program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 508, in no_tag
self.interpret(program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 526, in do_optTag_tal
self.no_tag(stuff[-2], stuff[-1])
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 508, in no_tag
self.interpret(program)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 338, in interpret
handlers[opcode](self, args)
File "/opt/zenoss/lib/python/zope/tal/talinterpreter.py", line 737, in do_insertStructure_tal
structure = self.engine.evaluateStructure(expr)
File "/opt/zenoss/lib/python/Products/PageTemplates/Expressions.py", line 218, in evaluateStructure
text = super(ZopeContext, self).evaluateStructure(expr)
File "/opt/zenoss/lib/python/zope/tales/tales.py", line 696, in evaluate
return expression(self)
File "/opt/zenoss/lib/python/Products/PageTemplates/ZRPythonExpr.py", line 48, in __call__
return eval(self._code, vars, {})
File "PythonExpr", line 1, in <expression>
File "/opt/zenoss/Products/ZenModel/DeviceReport.py", line 196, in reportBody
return "\n".join(body)
TypeError: sequence item 470: expected string, int found

------------------------------
Tanner
------------------------------

Hello,

I am attempting to run a report that will return all device names, priorities, states and IP addresses. I have attached the parameters that I am using. The report runs fine, and I can view it in Zenoss, but when I get to page 12 of 14, it errors out. (The error text is posted after this post). When I attempt to export the report, for some reason the IP addresses are very wrong. They are accurate with the report results in Zenoss, but not in the exported document. Any ideas on what could be causing this problem? I don't really need to access page 12 of the report in Zenoss if I can accurately export the data. 

I appreciate any ideas. Thanks. 



------------------------------
Tanner
------------------------------


Subject: RE: Issues with custom report
Author: Jay Stanley
Posted: 2019-06-07 08:39

Looks like one of your devices might be returning an int instead of string for one of those functions.. try running this in zendmd to see if you get a hit

for dev in dmd.Devices.getSubDevicesGen():
  data = [dev.getDeviceName(), dev.getPriorityString(), dev.getProductionStateString(), dev.getManageIp]
  if any(True for x in data if isinstance(x, (int, float))):
    print dev.getPrimaryUrlPath()


------------------------------
jstanley
------------------------------


< Previous
Report of baseline monitors
  Next
Backing up Analytics
>