7.3 Defining Custom Symbols and FieldsCustom device symbols may be created and used in NNM submaps. The process requires creating the symbol using a bitmap editor, creating the class registration file (optional), and creating the subclass registration file. Both the class and subclass registration files are Symbol Registration Files (SRFs). 7.3.1 Description of the SRFWhen creating custom symbols, you must decide whether or not to use an existing symbol class. To display existing symbol classes, select Edit 7.3.1.1 The Computer Symbol Class FileSymbolClass "Computer" { Scale 7; Segment (-8, -8) to (8, -8) to (8, 8) to (-8, 8) DefaultStatusSource Compound; DefaultLayout RowColumn; Variety Icon; Filebase "computer"; Capabilities { isComputer = 1; isNode = 1; } } The symbol subclass file resides in the same directory as the symbol class file. The SymbolType keyword defines the class and subclass of the symbol. While the name of the file is not used, the naming convention is class_subclass . For example, the HP-UX subclass filename is Computer_hpux . (The name of the class file is simply Computer .) The Filebase keyword references the basename of the bitmap to be used for the symbol. If a symbol subclass file exists, the Filebase listed in the subclass file overrides the Filebase listed in the class file. The subclass file can also set attributes such as isWorkstation .[2] Listed in the following section is the HP-UX subclass file.[2] Many object attributes are set by SNMP queries. Attributes may also be set in SRFs. 7.3.1.2 The HP-UX Symbol Subclass FileSymbolType "Computer" : "HP-UX" { Filebase "hpux"; CursorSize 38; Capabilities { isWorkstation = 1; } } 7.3.2 Creating Your Own SRFSRFs require a symbol class file, a symbol subclass file, and bitmaps. If you plan on customizing bitmaps, obtain a decent bitmap editor. HP-UX ships with the Icon Editor application, which can be used to create and edit bitmaps. For Windows systems, obtain an evaluation copy of Paint Shop Pro® from Table 7-1.
7.3.2.1 The Toaster Subclass FileSymbolType "Computer" : "Toaster" { Filebase "toaster"; CursorSize 38; Capabilities { isWorkstation = 1; isToaster = 1; } } After creating the bitmap and defining the SRF, create or modify an existing entry in the $OV_CONF/oid_to_sym file. The OID used in this example is that of an HP-UX workstation. The oid_to_sym file entry for this example is:1.3.6.1.4.1.11.2.3.2.5:Computer:Toaster # The Toaster 7.3 Defining Custom Symbols and Fields After modifying the oid_to_sym file, exit the NNM GUI and update the database for all objects having the same OID by performing the following steps: Figure 7-13. The toaster is a custom symbol referenced in an SRF.[View full size image] ![]() Figure 7-14. Custom symbols are available from the symbol class when you add an object. The Toaster is listed as a subclass of the Computer symbol class.[View full size image] ![]() 7.3.3 Description of the FRFField Registration Files (FRFs) can be used to define new attributes such as isToaster . Attributes are set in Symbol Registration Files as previously defined in the Toaster symbol registration file. Defining a field provides the ability to locate an object by the new attribute. The FRF listed in Section 7.3.3.1 assigns the Boolean attribute isToaster . The keyword locate in the FRF provides the ability to search on the field, as shown in Figure 7-15. Figure 7-15. Custom fields such as isToaster may be used as locatable attributes. To search by attribute, select Edit![]() 7.3.3.1 Creating Your Own Field Registration FileField "isToaster" { Type Boolean; Flags capability, locate; } FRFs reside in the $OV_FIELDS/C directory. Whenever you modify existing FRFs or add new ones, you must re-register the fields in the object database. Perform the following steps to re-register the fields: Figure 7-16. Check the Object Properties of the custom symbol to verify the value of a field.![]() Figure 7-17. The isToaster attribute is set to TRUE for the toaster symbols. Fields are defined in the Field Registration Files and referenced in the Symbol Registration Files.![]() 7.3.4 Limiting Access to Custom Symbols and FieldsThe $OVwSymbolDir and $OvwFieldDir environment variables may be set to define the symbol and field registration directories for individual users. This is helpful to limit access to symbols and fields. For example, a user might need access to applications that work only with networking devices. The symbols and fields for networking devices might not need to be available to everyone. The SRFs and FRFs can be located in any directory. For example, if custom SRFs are located in /etc/opt/OV/customSymbolDir and custom FRFs are located in /etc/opt/OV/customFieldDiron a Unix system, define the environment variable in a user's .profile as follows:export OVwSymbolDir=/opt/OV/share/symbols/C:/etc/opt/OV/ customSymbolDir export OVwFieldDir=/opt/OV/share/fields/C:/etc/opt/OV/ customFieldDir By defining these environment variables, you have limited user access to the SRFs and FRFs. Symbol and field directories are separated by a colon (:).For Windows systems, you could add the custom directories to the user's system variable list or modify and execute the ov.envvars.bat file. |