Setting General Parameters

 

You can configure some general settings pertaining to your Agent project using Settings ->General option in the Settings tree. The options provided are


 

Operating System

 

Since the agent is a platform-dependent agent, it needs to be compiled with different kinds of compilers to create object files and executable. The option OS in the Settings->General panel provides the user to select the operating system used to compile the agent. Since the agent is using some system calls to get the system time, for socket communication, etc., it may differ in each operating system. The agent is fully ported and successfully tested in the following platforms:

And for other operating systems also, we can modify the system calls, if required. For more information, refer to the Porting Guide.

 

Debug Level

 

When the agent is running, it will generate debug information to know about the agent processing. The Debug option in the Setting->General dialog of the Agent Compiler provides four levels of debug statements:

  1. NONE: Selecting this option will not generate any debug messages in your log file.

  2. ERROR: Selecting this option will generate only critical error messages in your log file.

  3. DEBUG: Selecting this option will generate all critical error messages, packet/message dumps, etc. in your log file.

  4. TRACE: Selecting this option will generate all information about the agent, such as critical error message, SNMP packet dumps, agent flow, etc. in your log file.

The respective macros are ERRMSG, DEBUG, and TRACE. So if you define ERRMSG, you won't get much information in your log file. For more information on this, please refer to Logging Levels.

 

64 bit OS

 

This 64 bit OS option can be used if the target operating system where the agent is going to run / to be deployment is of 64 bit operating system. On choosing this option, the generated agent code and the agent executable / library will be compatible for 64 bit operating system.

 

If this option is chosen, after the code generation, the config.h file present under the "projects/<project-name>/agent/source/system/include" directory will have the following macro declared in it.

    1. #define OS_64BIT

As of now, 64 bit OS option is available only for Windows and Linux based operating systems.

 

Absolute Path for Agent Root Directory

 

The option Absolute path for agent root directory in the General Settings dialog refers to the full location of a file. It includes the drive letter it is stored on, such as "C", the folder name, sub-folder name(s), and file name. For example, C: \Office\Documents\Files.doc is an absolute path.

 

The Runtime agent needs a directory to create configuration file, log file, FileToVector file, etc. Hence, this option is used for the agent to know the absolute/relative path for the required files/directory. If this option is selected, absolute path will be taken as agent root directory.

 

The Absolute path for agent root directory is given as

<Installation directory>\WebNMS\C-Agent\projects\mpaproject01\agent\

 

If this option is not selected, then the relative path from where the agent is started will be taken. Relative path is a string of characters that gives a files location relative to another file. For example, the relative path of a .c file saved in a custom folder is as follows: folder_name\file_name.c

 

Text File Storage for API

 

A check box option for Text File Storage for API is provided in the Agent Compiler General Settings. By default, this option is checked. If the user does not want this option, then he can uncheck it. This feature enables the storage of configuration files, such as SNMPv1, v2c, v3 and proxy configurations, TL1 and CLI security configurations, etc. for persistence storage support.

 

The AGENT_FILE_TO_VECTOR macro is generated for handling the Text Files for the API Tables and security files. These files will be created under the <WebNMS>\C-Agent\projects\<project name>\agent\conf directory. The FILE_TO_VECTOR macro is generated for handling the text files for the generated tables/scalars in the MIB under the <WebNMS>\C-Agent\projects\<project name>\agent\ftov\<mib-name> directory.

 

When NoStorage option is selected, only the AGENT_FILE_TO_VECTOR macro will be generated in the config.h file and if the Text File option is selected then both the FILE_TO_VECTOR and AGENT_FILE_TO_VECTOR macros will be generated in the config.h file.

 

These text files will be created during the Agent startup. If you comment the AGENT_FILE_TO_VECTOR macro, compile and start the agent, then the text file will not be created under the <WebNMS>\C-Agent\projects\<project name>\agent\conf directory. When the option is disabled and the user wants to update configurations, then the API methods available in the submain.c file can be used to achieve the same.

 

Backup for Log Files

 

A check box for BackUp for Log files is provided in Agent Compiler General Settings. By default, this option is not selected. This option has to be selected to enable Backup logging. A backup log will be created when the agent.log file reaches a defined file size and the current contents of agent.log will be cleared. For more information on this, please refer to BackUp Log Features.

 

Agent Configuration file support

 

A check box for Agent conf file support is provided in Agent Compiler General Settings. By default, this option is not selected. This option has to be selected to enable Agent Conf support. A configuration file will be created during the code generation based on the feature options that has been chosen in the Agent Compiler project settings. For more information on this, please refer to Agent Configuration File.

 

Multi-threaded

 

Selecting this Multi-threaded option in the General Settings dialog of the Agent Compiler will support Multi-Threaded processing.

 

Number of Threads

 

The user can enter the number of threads that the agent needs to support. The default number of threads specified is 5. That is, the agent will support 5 threads for each protocol (SNMP/HTTP/TL1/CLI) by default.

 

Agent Address

 

The IP address of the agent in the case of SNMPv3 can be specified/configured in the text field provided.

 

Log File

 

The path of the Log file used by the agent to store debug messages, can be given provided in the text field provided.

 

Binding IP Address

 

A check box for Binding IP Address is provided in Agent Compiler General Settings. By default, this option is not selected. This option has to be selected to enable Binding IP Address. Now the agent will bind only to the IpAddress specified in the text field, "Agent Address". For more information on this, please refer to Binding IP Address.

 

Storage Type

 

The storage options supported by the agent are

Text File

 

When agent is started for the first time, it will have a default entry for each table/scalar of the instrumented MIB. At agent run time, either agent or manager can add/delete/modify a row in the table or modify any of the scalar objects. Once the agent is restarted, these changes will not be reflected in the agent. If the user wants these changes to be reflected in the agent when it is restarted then he can enable this option.

 

If this option is enabled then the Agent Compiler will generate one more source file called ftov.c for each table or a scalar group. This file will take care of writing the current value of each row of a table or a scalar object in a text file and reading the same when the agent is restarted.

 

Customizing Text File Storage

 

The Storage Model -> Text file storage option in the Settings Tree is used if Storage type in Text file is enabled for the MIB or any selected nodes of the MIB. The settings here allow you to customize Text File storage option if any node uses it.

 

Selecting this option (Storage Model -> Text File) will display a panel, which has the MIB Tree displayed on the right side. The Mib tree displays only the Nodes for which Storage Type in Text file is enabled. The right side of the panel provides the delimiter input field based on which the data is stored in the Text file. You can select a particular node and specify the delimiter to be used in the text file for that node.

 

Default Delimiter

 

The Agent Compiler assigns "space" as the default delimiter for data stored in Text Files. For example, the data for a table row may be stored in the text file as shown below:

 

public READ_WRITE ACTIVE

 

If this option is selected, the agent will read the data as public for the 1st column value, READ_WRITE for the 2nd column value, and ACTIVE for the 3rd column value.

 

In this example, if the 2nd column value "READ_WRITE" is provided as "READ WRITE", the agent will manipulate the words READ and WRITE as separate column values since "Space" is the delimiter.

 

Delimiter

 

If you do not want to provide "space" as the delimiter, you have to specify the character, for example #, $, ; as delimiter for the data stored in Text files. The length of special delimiter is restricted to 1 character.

 

You can assign a special character say "#" as the delimiter, then click Apply All. This will set "#" as the default delimiter for all the nodes specified in the tree view shown in the dialog. If you want to specify a different delimiter for different nodes (for example, in the case of AGENT-SAMPLE-MIB) say adiskTable, select "adisktable" in the tree view and key in special preferred delimiter (say $). This will cause the delimiter for "adisktable" alone to be set as '$'. When Apply All is clicked, you will find the option Reset All. This can be used to reset the delimiter for all the nodes to single space character.

 

Database

 

This option is preferred if the user application databases are extremely large and dynamic. If this option is enabled, then the agent information is stored in a database and this database is accessed from the handler files generated by using a set of APIs.

 

Database Settings

 

The Storage Model -> Database option in the Settings Tree is used if storage type is enabled as database in the General Settings dialog of the Agent Compiler. Selecting the Database settings prompts a dialog box as shown below. The options available in this dialog are based on the OS chosen in the General Settings dialog. If the OS is Windows, the following default settings will be provided in the dialog box. You can modify these values according to his requirement.

        • Data Source Name: It is the name specified in the Data Source Name of the ODBC Driver.

        • ODBC Driver: The driver name for which you want to set up the Data Source.

        • User Name: The name of the user.

        • Password: The Password provided for the user.

If the OS chosen is not Windows, the following default settings will be provided in the database settings option. The user can modify these values according to his requirement.

 

agent_proj_settings_database.jpg

 

The Server Host Name and Database Name has to be provided.

 

Runtime Memory

 

If this option is selected, the entire data maintained by the agent will be stored in memory at agent startup. Selecting this option depends on user applications. This option is preferred in the following cases:

      • The user application is tightly integrated with the agent application. (That is, the agent functionality is added by modifying the code generated by the Agent Compiler.)

      • The database maintained by the external application is not large.

No Storage

 

Enabling this option will disable storage type in Textfile, Database, and RunTime Memory. The run time agent will maintain a data structure (vector) for each table. This contains the default values for each table/scalar of the instrumented MIB. Any changes made in the table or to the scalar objects will not get reflected once the agent is restarted.

 

Disabling this option means that the agent will provide storage type in Text files or in Database or in RunTime Memory.

 

Customization of Storage Type for Selected Nodes Code Generation

 

There are four types of storage options, such as No Storage, Text File, Database, and Runtime Memory for code generation. Follow the steps given below to customize the storage type of a selected group nodes in a loaded MIB:

      1. Load a MIB (for example, AGENT-SAMPLE-MIB) into Agent Compiler and in the Project Settings panel, under the Settings -> General section, select No Storage/Text File/Database/Runtime Memory option for the Storage Type.

      2. Now select the MIB View panel in the workspace frame and expand the MIB by clicking the Expand the MIB tree icon on the toolbar.

      3. To provide Text File storage for tftpModule in AGENT-SAMPLE-MIB, right-click on the scalar group node, tftpModule, and select Text File option in the menu that is displayed. Similarly, you can set Runtime Memory option and No Storage option for any MIB node.

      4. To provide Database storage for adiskTable in AGENT-SAMPLE-MIB, right-click on the table group node, adiskTable, and select Database option in the menu that is displayed.

Scalar group nodes can have only three storage types (No Storage, Text File Storage, and Runtime Memory), while the Table group node can have all the four storage types (No Storage, Text File Storage, Runtime Memory, and Database). The storage type customization for selected nodes is possible only for the group node and not for the leaf nodes.

 

Memory Allocation

 

In code generation, we are supporting two kinds of variable declaration for MIB objects of type OCTET-STRING, OBJECT-IDENTIFIER, IPADDRESS. They are, Static memory allocation and Dynamic memory allocation.

 

Static Memory Allocation

 

In Static memory allocation mode, we are reserving a fixed amount of memory for each MIB object in the compilation period itself. That means, once agent is started, it will reserve its own amount of memory immediately.

 

Buffer Size

 

This is an option in Static Memory allocation. For this, two macros namely STRING_MAX_LEN and MAX_OID_LEN will be defined in config.h.

 

Dynamic Memory Allocation

 

In dynamic memory allocation mode, the memory is reserved in the run time. Based on the requirement, the memory will be allocated for each MIB objects and used. Based on the memory allocation type, the code generation will be changed.

 



Copyright © 2012, ZOHO Corp. All Rights Reserved.