While the InfoHub database is available to any reader for asynchronous access without a need to be identified in the Configuration File, an InfoHub can also notify a reader when InfoHub data has a characteristic specified in a Subscription (see "Defining a Subscription"). For example, the Reference Implementation SNMP sub-agent uses this technique to generate SNMP traps without an asynchronous external request or polling. While most of the InfoHub works independently of any adapters, in order to perform asynchronous alerts or notifications, it requires some context for the Subscriber adapters. The syntax of the Subscriber Descriptor is:
Subscriber:{InfoDictID | InfoDictName}:[SubscriberName]:[SubscriberID]
InfoDictID or InfoDictName: The InfoDict ID or Name of the InfoDict holding the Subscriber definition.
SubscriberName: The name of the Subscriber.
SubscriberID: A unique 31-bit positive integer that uniquely identifies a subscriber.
The descriptor may specify neither, one, or both, of SubscriberName and SubscriberID. When the descriptor specifies both the Name and ID and there is no corresponding InfoDict entry, configuration processing implicitly creates an InfoDict entry. If the Configuration File specifies the same ID for more than one Subscriber associated with a Publisher, the configuration processing produces an IHDUPSUBSCRBR error. If configuration processing finds the Name missing, it generates an eight-character Name using random alphanumeric ASCII characters.
If SubscriberName is specified, the configuration gets SubscriberID from the specified InfoDict domain. If the specified domain has no definition for the Name, the InfoHub configuration process generates a new unique random 31-bit positive integer to use (that is, SubscriberID is unique for each InfoHubID), and stores it in the InfoDict domain in association with the SubscriberName. To use the default notification mechanism, an adapter process capable of reporting alerts must register its PID in ^InfoHubActivity using its SubscriberID.
InfoHub Internals | |
---|---|
When a Subscription detects an alert condition it queues the item (with a timestamp) under ^InfoHubInfo(InfoHubId,"Alerts") and INTRPTs all Subscribers attached to that Subscription. The Subscriber adapter process handles the queued alert item and KILLs its descendant node at its Subscriber ID; if there are no more Subscriber descendant nodes, it KILLs the queued item. Configuration stores Subscriber specifications in the following node: ^InfoHubConf(InfoHubID,"Subscribers",SubscriberID,BeginningSequenceNumber)=[EndingSequenceNumber]:InfoDictID:SubscriberName |
Example:
Subscriber:Reporters:SNMP:404 Subscriber:Reporters:NAGIOS:503
This example configures two subscribers–SNMP and NAGIOS. This example is a part of SimpleMonitor.conf in the ULFM Reference Implementation.