Specifically the scenario is as follows. We have deployed hubs (customer hubs) at customer site and at central site (central hubs). As of now, we have created attach queues for alarms and QoS at customer hubs and equivalent get queues at central hubs. The entire setup till date is working fine. We have NAS deployed on all the hubs including customer and site hubs.
However because of some recent requirement change, we have to forward selective alerts (filtered by probes) from custom site to central site and rest of alerts to be logged locally. I can write a LUA script which will work in on-arrival mode to log incoming alert to text file after checking for alarm contents whether it needs to be logged locally or forwarded to central hubs. However for rest of alerts, I can't send them to central site either through NAS or through queues.
Please help and suggest.
Instead of writing entries to a file, you can repost the alarm messages with a different subject. Then you can setup a queue to send messages with the new subject to the central hub, or you can add the new subject to the existing queue. On the central hub, you will need a custom probe to listen for messages with the new subject and then repost them with the alarm subject, so they get sent to the NAS.
This is not completely straightforward, but the script you already have that figures out which alarms need to be forwarded to the central hub is probably the most complicated piece.
Thanks for the information. Regarding deciding on which alarms to send to central site, I want to use alarm.get to get access to message contents and then repost the alarm. Is there any equivalent function in alarm class which does the repost ?
Also, is it possible to attach on one subject and get on another ?
In order to repost an alarm, you may need to use the rawalarm() function from Carstein. I thought there might be a function for that in the action class, but I checked the whitepaper and did not see one there. (The action class just happens to have functions for several of the actions you can do natively within AO profiles.) The nimbus.post() function would work to repost the message and many of the details, but there are some low-level fields that are set automatically by that function, which are likely to make the alarm look a little different on the receiving end.
When you configure an attach queue, you specify the subject, but you do not specify a subject when configuring a get queue. A get queue is only configured with the name of the attach queue and the address of the other hub. Everything in the attach queue is received by the get queue.
It would be nice if you could create a Lua script that would be used by the NAS replication feature or could explicitly trigger replication on an individual alarm, but I am not aware of any options that would allow that.
I will try out alarm reposting with a different subject using "rawalarm" function and let you know.