I am trying to come up with a count of active alarms in various different paths. i have the paths defined in a dataset called Systems. I read the path and then run the queryAlartStatus on the path using %s.
Here is the code:
data = event.source.parent.Systems
NumAlarms = 0
for row in range(data.rowCount):
almPath = data.getValueAt(row,0)
result=system.alert.queryAlertStatus(path=’%s’, activeAndAcked=1, activeAndUnacked=1).rowCount %(almPath)
NumAlarms=NumAlarms + result
print NumAlarms
here is the error returned:
TypeError: unsupported operand type(s) for %: ‘int’ and ‘unicode’
if i print the almPath they are correct.
if replace %s with %i it will run, just returns bogus data.
Thanks for the help.
Scott