OverView Index Help                                                                WebNMS Agent Toolkit C Edition 6 

monitorservice.c
Defines the common part to all monitor service. A monitor service monitors values of an Attribute in an observed module. The observed Attribute is monitored at intervals specified by the granularity period. A gauge value (derived gauge) is derived from the values of the observed Attribute.
Return Type Method Summary
CHAR AddMonitorToTable(Vector *table, Monitor *monitor)
             It will add the created Monitor to the table maintained by the Counter Monitor.
MonitorInfo* CreateMonitorInfo(ObjectName *objName, CHAR *attrbName, U_LONG granularityPeriod, void *tableEntry, CHAR *message, U_CHAR monitorType, U_INT32 *notifStatus)
             It will create MonitorInfo using the given information and will return its reference.
void FreeMonitorInfo(MonitorInfo *info)
             It will free the memory allocated for the given Monitor notification.
Monitor* GetMonitor(Vector *table, U_LONG id)
             It will retrive the Monitor corresponding to the given ID.
void InitMonitorService()
             Initialize the variables and data structures related to Monitor Service.
CHAR IsSupportedType(U_CHAR monitorType, U_CHAR attrbType)
             Based on the given monitor type it will verify the given Attribute type can be observed or not.
void PollMonitorQueuesAndSendNotifications()
             It will call poll methods of Counter, Gauge and String monitors to observe the added Attribute.
void StartMonitorService()
             It will start the monitoring service.
void StopMonitorService()
             It will stop the monitoring service.
   
Method Details

AddMonitorToTable()

CHAR AddMonitorToTable(Vector *table, Monitor *monitor)

It will add the created Monitor to the table maintained by the Counter Monitor.

Arguments:
1. Table in which monitor will be added (IN).
2. Created Monitor (IN).
Return type:
SUCCESS or FAILURE.
Bugs:
null

CreateMonitorInfo()

MonitorInfo* CreateMonitorInfo(ObjectName *objName, CHAR *attrbName, U_LONG granularityPeriod, void *tableEntry, CHAR *message, U_CHAR monitorType, U_INT32 *notifStatus)

It will create MonitorInfo using the given information and will return its reference. If any error on creation then it will return NULL. Note: the given objectName will be stored as it is, it will not allocated inside.

Arguments:
1. ObjectName to be monitored (IN).
2. Attribute Name to be monitored (IN).
3. Granularity Period value (IN).
4. Table Entry reference if attribute belongs table (IN).
5. Brief message about Monitor (IN).
6. Monitor Type (Counter/Gauge/String) (IN).
7. Notification status (IN).
Return type:
Created MonitorInfo or NULL.
Bugs:
null

FreeMonitorInfo()

void FreeMonitorInfo(MonitorInfo *info)

It will free the memory allocated for the given Monitor notification.

Arguments:
1. MonitorInfo (IN/OUT)
Return type:
Nothing.
Bugs:
null

GetMonitor()

Monitor* GetMonitor(Vector *table, U_LONG id)

It will retrive the Monitor corresponding to the given ID. This method search the monitor table, and return the monitor reference if available, otherwise NULL will be returned.

Arguments:
1. ID of the monitor to be retrieved (IN).
Return type:
Monitor or NULL.
Bugs:
null

InitMonitorService()

void InitMonitorService(void)

Initialize the variables and data structures related to Monitor Service.

Arguments:
Nothing.
Return type:
Nothing.
Bugs:
null

IsSupportedType()

CHAR IsSupportedType(U_CHAR monitorType, U_CHAR attrbType)

Based on the given monitor type it will verify the given Attribute type can be observed or not. For example Counter monitor can manage positive integer Attribute, if the given attrbType is String then it will return NO.

Arguments:
1. Monitor Type - Counter/Gauge/String (IN)
2. Attribute Type - CHAR/U_CHAR/etc (IN).
Return type:
YES or NO.
Bugs:
null

PollMonitorQueuesAndSendNotifications()

void PollMonitorQueuesAndSendNotifications(void)

It will call poll methods of Counter, Gauge and String monitors to observe the added Attribute. Each poll method will send notification to its listeners based on the thersold value.

Arguments:
Nothing.
Return type:
Nothing.
Bugs:
This method has effect only when muti thread is not enabled

StartMonitorService()

void StartMonitorService(void)

It will start the monitoring service.

Arguments:
Nothing.
Return type:
Nothing.
Bugs:
null

StopMonitorService()

void StopMonitorService(void)

It will stop the monitoring service.

Arguments:
Nothing.
Return type:
Nothing.
Bugs:
null


OverView Index Help                                                                WebNMS Agent Toolkit C Edition 6 

Copyright (c) 2009 ZOHO Corp. All Rights Reserved.