NTF User Guide
NTF User Guide
USER GUIDE
Disclaimer
The contents of this document are subject to revision without notice due to
continued progress in methodology, design and manufacturing. Ericsson shall
have no liability for any error or damage of any kind resulting from the use of
this document.
Trademark List
All trademarks mentioned herein are the property of their respective owners.
These are shown in the document Trademark Information.
Contents
1 Introduction 1
1.1 Prerequisites 1
2 Basic Concepts 3
2.1 Notification Service 3
2.2 Notifications 4
2.3 Producers 9
2.4 Consumers 10
2.5 Summary 16
5 General Concerns 33
5.1 Standards Compliance 33
Reference List 35
1 Introduction
Scope
This document is a simplified version of the NTF specification but also contains
information related to the NTF system environment and other concerns.
Target Groups
This document is intended for application designers and developers.
1.1 Prerequisites
It is assumed that the reader is familiar with the SA-Forum system architecture
and concepts. For more information, refer to www.saforum.org.
2 Basic Concepts
NTF
NTF Notification NTF
producer1
NTF
producer1 producers producer4
producer3
Alarms and
security alarms
LOG
API
Cached
Configuration notifications
log streams Notification service accessible through
dedicated to NTF the Reader API
Notifications
NTF NTF NTF
subscriber1 subscriber2 Notification reader2
consumers
NTF
reader1
However, the NTF does not interpret the notifications and does not maintain
any state information associated with them. These are the responsibilities of the
NTF users and in particular the producers. Consumers can also want to correlate
notifications.
These basic NTF concepts are reviewed in more detail in the following section.
2.2 Notifications
Most Application Interface Specification (AIS) services are producers of
notifications and the service specification defines the ‘‘situations of significance’’
that an implementation of the service must ‘‘consider’’ important and therefore is
to report.
The NTF specification (refer to Reference [8]) defines the following five categories
of notifications:
a Alarms
b Security alarms
The data structure of all notification categories includes a common part, which
is also referred as the notification header. This is extended by each notification
category with data appropriate for the purpose of the category.
Later versions of the NTF specification (starting from A.03.01, refer to Reference
[9]) also allow the suppression of notifications to preserve system resources,
especially in overload scenarios. The exceptions are the alarms and security
alarms, which never can be suppressed.
The NTF guarantees the delivery of alarms and security alarms and it also stores
them persistently in a log stream. Therefore, alarms cannot be suppressed (refer
to Reference [9]) and their log file cannot be filtered either (refer to Reference [7]).
This means that an application designer must take special care of deciding when
an alarm is necessary. To make this decision easier, it is worth mentioning that an
operator would map an alarm to an emergency call or paging of their maintenance
personnel urging them to attend the situation.
So even if the situation seems to be critical for the application, but there is another
entity within the system that takes care of it, there is no need for an alarm and a
notification is probably sufficient. For example, if a component error is detected,
which is then reported to the AMF, it is enough to generate a notification about
the error as the AMF is there to deal with the situation and repair the component.
In turn, when the AMF runs out of solutions it generates an appropriate alarm
as defined by the AMF specification (refer to Reference [4]) to seek for human
attendance.
The alarms and security alarms generated by the different AIS services are
defined in the respective specifications.
The category-specific fields are different for alarms and security alarms.
Two fields are reported for both state and attribute changes.
The source indicator field determines whether the change is one of the following:
— Unknown
In the second field, the list of changed states/attributes is provided. Each change
includes the state/attribute ID, the new value, and can also indicate the old
value. For attribute changes, the attribute type is also provided, while states are
represented as integers because AIS specifications that define state change
notifications also define enum types for their states.
AIS specifications also define enum types that identify the states they can report
on.
The object create/delete notifications are generated to indicate the creation or the
deletion of a service entity and its representing managed object in the information
model. Among the AIS services, the Log service communicates this way the
creation and deletion of runtime log streams in the system.
As for the state and attribute change notifications, the source indicator field
is defined for the object create/delete notifications with a similar meaning as
described in the previous section.
The object create/delete notification also lists the setting of the object attributes
at the moment of its creation or deletion. This again requires the attribute
identifiers for each of the listed attributes, their type and value. As the standard
information model has no provisioning for the attribute ID, the Log service defined
the necessary enum type as part of the service API. Applications must take a
similar approach.
2.3 Producers
Notification producers are the applications or system processes that generate
notifications using the NTF producer API. Producing a notification therefore
means creating and filling in the required data structure and submitting it to the
NTF. The producers and even the NTF are unaware of the consumers of these
notifications. They are posted much as a ‘‘to whom it may concern’’ message. It is
the predefined data structure that helps the NTF service and interested consumers
in sorting out the relevance and interpreting the notifications.
Another key point about producing notifications is that it often occurs during
some critical operations. For example, considering the AMF when it detects an
error and executes a failover: it produces a series of state change notifications
as the different entities change their states because of the failover. That is, they
change the presence, the readiness, and the High Availability (HA) states at
least, but the operational state can also change. Also, as multiple entities can
be involved in the failover, the AMF can produce many similar notifications for
them as the failover progresses.
The NTF producer API therefore offers the possibility of reusing notification data
structures, as allocations can take some time and they also use extra resources:
— If more than one notification of the same type must be sent (for example,
state change notifications for all components of a Service Unit (SU) failing
over its services), the notifications have the same data structure and even
portion of the data is the same.
— Therefore the producer can allocate the needed data structure only once
and reuse it as many times as needed. This is done by updating the values
that change from one notification to another, such as update the DN of the
components as the same state change is reported for each of them.
— Once all needed notifications are sent the producer (for example, the AMF)
can free the allocated data structure.
Such a reuse, however, serializes the operations as each data setting must be
sent before the data structure can be reused for the next notification. This can
be a problem considering the reported critical operation (for example, failover).
However, sometimes the serialization is necessary for the proper correlation of
notifications. This is because the notification ID of previous related notifications
must be included in the new notification. The unique notification ID is generated
by the NTF within the send request.
Notification producers do not need to log the alarms and security alarms as they
are logged by the NTF in the dedicated log stream defined by the Log service (refer
to Reference [7]). However, they can consider logging their other notifications as
the current Core MW 3.0 NTF implementation (refer to refer to Reference [6])
does not log these.
2.4 Consumers
As mentioned earlier, the producers or the NTF do not know in advance which
processes are interested in the notifications, who are going to be the consumers.
Processes must express their interest to the NTF if they want to become a
consumer of some kinds of notifications.
— It can deliver the notifications as they are sent by the different producers. Such
a consumer is referred as a subscriber as it is a subscription-based mechanism.
— The NTF also stores the notifications produced in the system so that a
consumer can collect them later using the reader API. Such a consumer is
referred as a reader.
2.4.1 Filters
Setting up the filters requires similar data structures as the notification data
structures, as the filter conditions can be defined for the different portions of the
notification data structures. For each notification category a matching filter
data structure and allocation function are defined by the NTF API. These data
structures determine the notification parameters on which the filtering is enabled
for the given notification category. When a filter is applied by the NTF, only
notifications matching the filter setting pass the filter and are delivered to the
consumer.
Similarly to the notification data structures, the NTF API supports the reuse of the
notification filter data structures between different subscriptions or reads, or both.
2.4.2 Subscribers
Subscribers get a callback from the NTF each time a notification matching their
subscription becomes available. This means that a process wanting to become a
subscriber must provide this callback function (saNtfNotificationCallback)
when it initializes the NTF.
Once the different filters are in place, the user is ready to subscribe with the NTF
for notifications. Afterward it receives a callback if a notification matching any of
the filters becomes available in the system.
The NTF provides in the callback the notification itself and the subscriber can keep
the data structure as long as needed, that is, the NTF does not free the passed
data structure when the callback returns. This means that the subscriber has
the responsibility to free the allocation once it has processed the notification;
otherwise the NTF can run out of resources and start to discard notifications for
the given subscriber.
However, as the NTF is reliable, it still delivers the fact that some notifications
have been discarded if at initialization the subscriber also provided an appropriate
second callback (saNtfNotificationDiscardedCallback). When the NTF
invokes this callback, it contains the list of notification IDs that the NTF was
not able to deliver. As opposed to saNtfNotificationCallback, for the
saNtfNotificationDiscardedCallback the resources are handled by the NTF
only and they are freed when the callback returns. The subscriber must make a
copy of the notification IDs if it wants to retrieve them as a reader outside of
the callback.
2.4.3 Readers
As mentioned earlier, the filters are used by both subscribers and readers. The
moment in time when the subscription is submitted to the NTF determines from
where the NTF is to start delivering the notifications. In case of iterating through
the cache, there are potentially hundreds of notifications that would match the
filter.
Therefore, the read initialization besides the filter also includes the search criteria,
which determines the starting point from which the reader can iterate through
the notifications matching the filter.
The easiest way is clearly if the reader knows exactly the notification IDs it is
looking for, for example, from saNtfNotificationDiscardedCallback. A
notification ID is the perfect searching criteria as it uniquely identifies a notification
in the cache and the reader can collect it immediately with the first iteration.
If the reader does not know the notification ID, the starting point becomes time
based. The difficulty with this is that, as already mentioned, producers can delay
the notification generation and therefore the detection time of events (which is
given in the event time field of each notification) and the time the notification
is produced can differ. Also, in a distributed system, notifications are produced
concurrently and the NTF serializes them in a so called “chronological order” based
on the order it receives them and not necessarily as they were produced.
SA_NTF_SEARCH_BEFORE_OR_AT_TIME
SA_NTF_SEARCH_AT_OR_AFTER_TIME
SA_NTF_SEARCH_BEFORE_TIME
SA_NTF_SEARCH_AFTER_TIME
SA_NTF_SEARCH_AT_TIME
Event time = T
T T T T
SA_NTF_SEARCH_OLDER SA_NTF_SEARCH_YOUNGER
Ascending chronological order
As shown in Figure 2, if there are multiple matches (all marked with ‘‘T’’), the
following apply:
If only one notification matches the event time, not only SA_NTF_SEARCH_AT
_TIME and SA_NTF_SEARCH_AT_OR_AFTER_TIME coincide, but also
SA_NTF_SEARCH_BEFORE_OR_AT_TIME. That is to say all notifications in green
collapse into one.
The search criteria can also indicate that the reader only wants to apply the filter
(SA_NTF_SEARCH_ONLY_FILTER) in which case the iteration always starts from
the first notification on record.
In each iteration, the NTF returns exactly one notification from the set matching
the filter. The notification type is returned in the notification type field, which
determines the way the reader must process the notification data. Once the
reader completed the processing, it must release the allocated memory by calling
function saNtfNotificationFree.
In addition, starting with A.03.01 (refer to Reference [9]), the NTF specification
has defined the SaNtfCorrelationIdsT data structure to be used in application
APIs so that applications between themselves can pass notification IDs as
necessary. The AIS service APIs increasingly include such a parameter in calls
related to failures, failure handling, and status reports. Applications are strongly
encouraged to use such parameters and define their API in a similar manner.
(refer to Reference [5]), and the AMF, when a physical node fails in the system. The
example indicates the correlated root and parent notification IDs in parentheses.
Typically it is the PLM that detects the node failure and maps it to the failure of
the Hardware Element (HE) representing this hardware node in the information
model. For hardware failure, it generates an alarm (assume that its notification
ID is #1). It sets the different states of the HE and the Execution Environment
(EE) hosted by the HE as appropriate for the failure. It also generates a set of
notifications starting with the HE representing the node (#2, #3, #4), and proceeds
to the affected EE hosted on the node (#5, #6).
It is here assumed that the PLM generates the different state change notifications
for an entity in parallel, hence all referencing the same notification as root and
as parent. A PLM implementation can then generate in sequence, in which case
they would all reference #1 as the root, but as parent #2 would reference #1, #3
reference #2, and #4 reference #3, and so on.
In addition to these notifications through its tracking API, the PLM also informs all
its users tracking these changes. In the tracking callbacks, the PLM also provides
the correlated notification IDs (using the mentioned SaNtfCorrelationIdsT data
structure) so that its users can correlate any notifications they generate with
those the PLM has generated. Namely, in the callback for the HE readiness status
change it reports #1 as the root and as the parent notification ID, and #4 as the
notification ID reporting the readiness state change. For the EE, again the root is
#1, but the parent is #4 reporting the readiness state change of the HE. It passes
#6 as the notification reporting the EE readiness state change.
The CLM is one of the users of the PLM, which tracks the EEs on which CLM
nodes are configured. It receives the PLM track callback reporting the EE going
out-of-service. As a result, the CLM proceeds with the actions for the node leaving
the cluster. It produces its own notification about the membership change and
references the notifications produced by the PLM as it received them in the track
callback: #1 as the root and #6 as the parent:
The same way as the PLM did, the CLM reports the membership change through
its track API also including the notification IDs: #1 as root, #6 as parent, and #7 as
the one reporting the node leaving the cluster.
The AMF tracks the cluster membership, hence it receives the callback from
the CLM. It perceives the disappearance of a node as a node failure and all
components and SUs hosted on the nodes going out-of-service simultaneously
and become uninstantiated. The AMF reports these state changes following the
entity dependencies as applicable in a similar manner as in case of the PLM:
#8: AMF node operational state change notification (1, 7)
#9: AMF SU readiness state change notification (1, 8)
#10: AMF component readiness state change notification (1, 8)
#11: AMF component presence state change notification (1, 8)
#12: AMF SU presence state change notification (1, 8)
Again, in these state change notifications the AMF references the correlated
notification IDs. Also, the AMF performs the necessary failover procedures and so
calls back the standby components on other nodes to take the active assignments
of the components of this failed node. However, the AMF does not propagate
the notification identifiers automatically within its callbacks. A user process can
obtain the notification IDs by calling the appropriate API function and providing
the invocation identifier of the callback that triggered the request.
In this example, the AIS services were considered. However, any notification
producer process generating notifications is to follow the same principles in
correlating notifications and facilitate the Root Cause Analysis. If the PLM and the
CLM track APIs did not pass the correlated notification IDs, the CLM and the the
AMF are unable to correlate their notifications with the hardware failure reported
in the PLM HE alarm. One must take an extra effort to match them up.
Even with proper notification correlation it can be difficult to identify the root
cause as the different services have their own fault detection mechanisms and
many of them can fire simultaneously before the failure is reported through the
APIs. For example, one or more components of the failing node can miss their
health check before the AMF gets the track callback from the CLM reporting the
departure of the node.
There are also notifications that come in pairs. A typical example is the alarm,
which is used when an emergency situation occurs. When the situation is resolved,
a second alarm is generated to clear the emergency situation. To do so, the
second alarm references the first as a correlated notification and sets the severity
as cleared. For this example, the PLM alarm reported with the #1 notification ID
can be cleared later by #27, which references the root and parents as discussed
earlier in the first two positions and add a second reference to #1 as the alarm is
cleared. Such ‘‘sibling’’ notification is reported in the third position of correlated
notifications field:
#1: PLM HE alarm (1,)
[...]
#27: PLM HE alarm cleared (1, 26, 1)
In summary, the NTF only provides the means for correlating the notifications but
using these tools effectively remains the responsibility of the users.
2.5 Summary
To summarize, the NTF provides a common communication mechanism to report
primarily fault-related incidents and changes that can put these incidents into a
context. All this is to allow more educated reactions to emergency situations.
Depending on the contents, five categories of notifications are distinguished.
Each notification has a unique identifier. It can therefore be referenced, that
is, correlated with other notifications; the most important among which is the
clearing of an alarm raised earlier.
The NTF allows for these different functionalities, but it does not interpret the
notifications it delivers, it does not keep any related states or correlates them. It
only provides the infrastructure and expects the users, the notification producers
and consumers, to use this infrastructure meaningfully.
On the consumer side, it provides both push and pull mechanisms of dissemination.
It pushes notifications to subscribers in a timely fashion and reports if it cannot do
so. It provides the necessary delivery guarantees. For readers, the NTF provides a
pull interface through which the same information can be retrieved.
In both cases, the notifications are filtered so that consumers receive only the
information they need or can handle.
As it is a well-known mechanism, all entities in the system are to use the NTF
to provide the information that can be useful for fault management. Each AIS
services specification contains a section defining the alarms and notifications
the service generates.
The implementation is delivered with header file saNtf.h, which contains the data
type and function prototype declarations according to the SAI-AIS-NTF-A.03.01
version of the specification (refer to Reference [9]). However, the functionality
that has been implemented is compliant to the SAI-AIS-NTF-A.01.01 version
of the specification. If a requested function is not supported, it returns error
code SA_AIS_ERR_NOT_SUPPORTED. The version of the header file allows the
use of the SaNtfCorrelationIdsT data structure, as described in Section 2.4.4
in Reference [8].
The API follows the SA-Forum programming model according to which a user
must initialize the service to negotiate the service version and to obtain a handle
from the service by calling function saNtfInitialize. In spite of the version of
the header file, only the A.01.01 version can be initialized. The handle represents
one particular association between the caller process and the NTF service.
The same process can initialize the NTF multiple times, which provides separate
handles and therefore independent associations. Within the context of each
handle, only the API functions appropriate for the negotiated version of the
service can be used. However, a process can negotiate a different service version
for each of the handles it obtains when different versions become supported.
The association created between a user process and the NTF at initialization
ceases to exist when the handle is finalized explicitly by the process, or implicitly
if the process ceases to exist.
category. They can manipulate and update this data structure through API
functions referencing the appropriate notification handle.
Consumers implicitly receive a similar handle whenever the NTF delivers them a
notification regardless whether it is delivered in a callback or as part of the read
iteration. Again, they must use this handle to access the different portions of the
delivered notification.
Consumers also obtain a notification filter handle with each type of notification
filter allocation. They can manipulate the filter data structure only through
the API functions referencing the appropriate notification filter handle. These
notifications, handled by the notification filter, cease to exist and the related data
structure allocation is freed with the invocation of the respective API functions
saNtfNotificationFree and saNtfNotificationFilterFree.
Implicit or explicit finalization of the NTF handle implies the release of any
subhandle that the process can have obtained using that NTF handle, as well as
all the resources associated with such subhandles.
1. Allocate the memory for the notification data structure for the notification
category that must be sent:
b Send the notification using the current content of the notification data
structure.
The AMF sends a state change notification each time any of its entities change
their state. The following pieces of code are executed (the original code of
<opensaf>/osaf/services/saf/avsv/avd/avd_ntf.c has been modified; some
parts were omitted and comments were added to provide more explanation):
// since the allocation above was successful all used memory needs to be released
saNtfNotificationFree(myStateNotification.notificationHandle);
return NCSCC_RC_FAILURE;
}
// set the fields specific for state change notifications, i.e.
// the source indicator,
*(myStateNotification.sourceIndicator) = sourceIndicator;
// the state ID,
myStateNotification.changedStates->stateId = stateId;
// the indication that the old state is omitted by the current implementation,
myStateNotification.changedStates->oldStatePresent = SA_FALSE;
// and new state value
myStateNotification.changedStates->newState = newState;
// send the notification with the current information in the data structure
// referenced by the myStateNotification.notificationHandle
status = saNtfNotificationSend(myStateNotification.notificationHandle);
// omitted: check if the send was successful and log any failure
return status;
The following code (also from avd_ntf.c) is used by the AMF to fill out the
notification header for all categories of notifications. Some comments are added
here although the code is straightforward.
// the length and value of the notifying object’s name, i.e. AMF in this case
notificationHeader->notifyingObject->length = strlen(avd_name);
(void)memcpy(notificationHeader->notifyingObject->value, avd_name, strlen(avd_name));
// Fields of the NCI (notification class ID) as defined by the AMF specification
notificationHeader->notificationClassId->vendorId = SA_NTF_VENDOR_ID_SAF;
notificationHeader->notificationClassId->majorId = majorId;
notificationHeader->notificationClassId->minorId = minorId;
}
// use the provided API to allocate memory for variable length fields
ret = saNtfPtrValAllocate(notificationHandle,
sizeof (SaNameT) + 1,
(void**)&dest_ptr,
&(notificationHeader->additionalInfo[0].infoValue));
Each time an API function is invoked the outcome of the operation is checked if it
was successful. Once a notification allocation was successful and the process has
obtained a notification handle, it is important to release the memory allocations
even if there is a failure. Allocations for variable length fields, such as pointer
values and arrays, require the use of special allocation functions provided by
the API. However, there is no need to release them separately as they become
associated with the notification handle and are released when the notification
structure is freed using this handle.
The provided examples do not reuse any memory allocation and dispose it after
the state change notification has been sent successfully.
/* Changed states */
for (i = 0;
i < notification->notification.stateChangeNotification.
numStateChanges; i++) {
print_change_states(notificationHeader->notificationClassId,
¬ification->notification.
stateChangeNotification.changedStates[i]);
}
break;
case SA_NTF_TYPE_ALARM:
case SA_NTF_TYPE_OBJECT_CREATE_DELETE:
case SA_NTF_TYPE_ATTRIBUTE_CHANGE:
case SA_NTF_TYPE_SECURITY_ALARM:
default:
printf("unknown notification type %d",
(int)notification->notificationType);
break;
}
The following are the most important points of handling received notifications:
— Although the user made no allocation, it must free the memory associated
with the notification handle received from the NTF implementation.
SaNtfNotificationTypeFilterHandlesT notificationFilterHandles;
memset(¬ificationFilterHandles, 0, sizeof notificationFilterHandles);
// allocate and set the filter for state change notifications
errorCode = saNtfStateChangeNotificationFilterAllocate(ntfHandle,
&stChFilter,
notificationFilterAllocationParams->numEventTypes,
notificationFilterAllocationParams->numNotificationObjects,
notificationFilterAllocationParams->numNotifyingObjects,
notificationFilterAllocationParams->numNotificationClassIds,
0,
0);
// handle any returned error
if (errorCode != SA_AIS_OK) {
fprintf(stderr, "saNtfStateChangeNotificationFilterAllocate failed - %s\n",
error_output(errorCode));
return errorCode;
}
errorCode = saNtfNotificationFilterFree(
notificationFilterHandles.stateChangeFilterHandle);
To take advantage of the subscription, the user process must provide the
necessary callback at initializing the NTF service.
— A set of handles to the notification filters that the NTF is to use to match
notifications against this subscription.
The set of notification filter handles can contain one filter for each notification
type referenced by its handle, and must include at least one such handle. For
notification types that the user is not interested in the appropriate field are to be
set to SA_NTF_FILTER_HANDLE_NULL. All handles in the structure must have been
allocated in association with the same NTF handle.
The NTF API does not allow the change of subscriptions. If a subscriber wants to
change its existing subscriptions, the only way is to remove the old one and create
a new subscription with the new modified filters. To ensure that no notification is
lost because of such a change, the subscriber can want to subscribe first with the
new filters, and when this subscription is in place remove the old subscription. This
means that the subscriber must use a new subscription ID for the new subscription.
The main principles of using the reader API were discussed in Section 2.4.3
Readers on page 11. A user must perform the following:
1. Create the filters to be used by the NTF to match the notifications in the cache.
2. Initialize the reader API using the created filters and optionally with a search
criteria, which identifies the first notification to be returned among those
matching the filters.
The implementation of the ntfread CLI command provided with the Core
MW 3.0 NTF implementation shows a good example of the use of the reader
API. The following excerpts are from the ntfread.c file (located in the
<opensaf>/osaf/tools/safntf/ntfread directory). The original code has
been edited.
// omitted: allocation and setting of the alarm and other notification filters
// initialize the reader API with the search criteria and the allocated filters
rc = saNtfNotificationReadInitialize(searchCriteria, &fhdls, &readHandle);
if (rc == SA_AIS_ERR_NOT_EXIST) {
rc = SA_AIS_OK; /* no more notification exists */
} else {
fprintf(stderr, "saNtfNotificationReadNext failed - %s\n",
error_output(rc));
}
done:
return rc;
}
This example sets the search criteria so that only the filters are used to match the
notifications. The search mode is SA_NTF_SEARCH_ONLY_FILTER and the event
time and notification ID fields are ignored. This means that the NTF returns at
the first iteration with the oldest notification on record that matches the filters.
This also means that the search direction must be set to SA_NTF_SEARCH_YOUNGER
to iterate through all these notifications. This piece of code also invokes function
saNtfNotificationCallback, which is the subscriber’s callback function
discussed earlier.
The specification defines no information model for the NTF and therefore no
administrative operations.
However, the Core MW 3.0 NTF implementation provides a configuration file and
three CLI commands, ntfsend, ntfsubscribe, and ntfread, as extensions to
the specification.
4.1 Configuration
The NTF service implementation of Core MW 3.0 uses a configuration file,
ntfd.conf, with some environment variables that tailor the implementation
behavior. Its typical location is in the /etc/opensaf/ directory.
The ntfd.conf file is sourced by the NTF server at startup, so any change to the
file takes effect only once the server has been restarted.
The following is the content of the file that comes with the package:
# Uncomment the next line if you want to run the log server through valgrind
#export TOOL="valgrind --leak-check=full --log-file=/tmp/ntf.valgrind"
# Healthcheck keys
export NTFSV_ENV_HEALTHCHECK_KEY="Default"
The ntfsend CLI command can be used to send notifications with the parameters
provided as attribute to the command. Without any attributes, it generates a
single ‘‘default’’ alarm. -h or –-help prints the available options:
-a or --additionalText=TEXT additional text (string value)
-b or --burstTimeout=TIME send burst of notifications as defined by the
repeatSends [default: 1] attribute
and sleep TIME (usec)
-c or --notificationClassId=VE,MA,MI vendorid, majorid, minorid
-E or --eventTime=TIME numeric value of SaTimeT
-e or --eventType=16384...16389 numeric value of SaNtfEventTypeT
-n or --notificationObject=NOT_OBJ notification object (string value)
-N or --notifyingObject=NOTIFY_OBJ notififying object (string value)
-p or --probableCause=0..74 numeric value SaNtfProbableCauseT
-r or --repeatSends=NUM send the same notifification NUM times
-s or --perceivedSeverity=0...5 severity numeric value
-T or --notificationType=0x1000...0x5000 numeric value of SaNtfNotificationTypeT
The following example sends one security alarm with the perceived severity set to
SA_NTF_SEVERITY_MAJOR, probable cause to set SA_NTF_UNSPECIFIED_REASON,
and with the additional information string included as additional text.
Parameters not specified are set to their respective default values.
# ntfsend -T 0x5000 -s 4 --probableCause 74 -a “additional information
The ntfsubscribe CLI command subscribes to the NTF and prints the received
notifications to stdout. The attributes of the command specify the time and the
filter, based on notification type, for the subscription. By default it subscribes to all
notifications. -h or –-help prints the available options:
-a or –alarm subscribe for alarm notifications only
-c or –attributeChange subscribe for attributeChange notifications only
-o or –objectCreateDelete subscribe for objectCreateDelete notifications only
-s or –stateChange subscribe for stateChange notifications only
-t or --timeout=TIME timeout (sec) waiting for notification
-y or –securityAlarm subscribe for securityAlarm notifications only
The security alarm sent by the ntfsend example in Section 4.2.1 Command
ntfsend on page 30 can be received by ntfsubscribe used with option –y and
the printout looks as follows:
=== Oct 6 11:42:42 - Security Alarm ===
eventType = SA_NTF_INTEGRITY_VIOLATION
notificationObject = "default notification object"
notifyingObject = "default notifying object"
notificationClassId = 193.0.0 (0x0)
additionalText = "additional information"
probableCause = SA_NTF_UNSPECIFIED_REASON
severity = SA_NTF_SEVERITY_MAJOR
Security Alarm Detector Type: 5
Security Alarm Detector Value: 1
ervice User Type: 5
Service User Value: 3
Service Provider Type: 5
Service Provider Value: 2
To receive the alarm, ntfsubscribe must be started before sending the alarm
with ntfsend.
As the current implementation only caches alarms and security alarms, only these
can be read and filtered. By default, as shown in the reader API example, it reads
all alarms and security alarms starting from the oldest in the cache, which can be
up to 10000 notifications (or whatever is the value of the NTFSV_ENV_CACHE_SIZE
environment variable).
The following example filters and reads the alarm generated by command
ntfsend shown earlier. It uses options -s 4 and --probableCause 74,
which correspond to severity SA_NTF_SEVERITY_MAJOR and probable cause
SA_NTF_UNSPECIFIED_REASON specified in the alarm. However, ntfread is to
be used after ntfsend.
# ntfread -s 4 --probableCause 74
=== Oct 6 12:20:41 - Security Alarm ===
eventType = SA_NTF_INTEGRITY_VIOLATION
notificationObject = "default notification object"
notifyingObject = "default notifying object"
notificationClassId = 193.0.0 (0x0)
additionalText = "additional information"
probableCause = SA_NTF_UNSPECIFIED_REASON
severity = SA_NTF_SEVERITY_MAJOR
Security Alarm Detector Type: 5
Security Alarm Detector Value: 1
Service User Type: 5
Service User Value: 3
Service Provider Type: 5
Service Provider Value: 2
5 General Concerns
Reference List