Hi friends ! Today Im adding the container name in alarms columns, why? because I will like to see from which container the alarm belong.
I add the folowings xml into Spectrum/custom/alarm/config/
- alarm-table-config.xml
- TopologyModelNameString.xml
alarm-table-config.xml
<table idref="alarm-table-config">
<column-list>
<column idref="TopologyModelNameString"><hidden-by-default>true</hidden-by-default></column>
</column-list>
</table>
TopologyModelNameString.xml
<column id="TopologyModelNameString" xmlns ="http://www.aprisma.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.aprisma.com ../../common/schema/column-config.xsd">
<name>TopologyModelNameString</name>
<content>
<attribute>0x129e7</attribute>
</content>
</column>
This easily show the full PATH the device that generated the alarm, but the complex is show just the last container, wich is divided by ":" symbol. I try the split function and indexOf, but doesn't work.
eg "<![CDATA[ " + attr(0x129e7).toString().split(":") + "]]>" or attr(0x129e7).toString().substring(attr(0x129e7).toString().indexOf(':') + 4);
I am not an expert in the syntax of java, but I now this is posible. Any help ? =)
Thanks in advance !!!!
Diego Pereyra