5.8 Customizing Error Messages

The default error message strings (remediation messages) are defined in the following file:

/usr/local/nac/scripts/BaseClasses/Strings.py

You can create custom error message strings that appear in the test result reports, and on the test results access window that the end-user views by editing or creating the following file:

/usr/local/nac/scripts/Custom/BaseClasses/CustomStrings.py

To customize the error messages:

  1. Create a file using a text editor, and name it as follows:

    /usr/local/nac/scripts/Custom/BaseClasses/CustomStrings.py
    

    using the following format:

                class CustomStrings:
    
              stringTable = {
                 "name1" : "message1",
                 "name2" : "message2",
     }
    

    Where:

    The name value (name1) matches the name of the test (see Table 5-1).

    The message value (message1)is the text you want to appear in the reports and on the end-user access windows.

    For example:

    class CustomStrings:
    
            stringTable = {
              "checkAntiVirusUpdates.String.1" : "The required anti-virus software was not found.  Install the software from this location <a href='http://myserver.someplace.com/dir/application.exe'>Location Name</a>",
              "name2" : "message2",
            }
    

    NOTE:A “%s” in the description text is a special variable that is interpolated into extra information (passed from Novell ZENworks Network Access Control) such as lists of missing patches, or missing software.

    IMPORTANT:Normally Novell ZENworks Network Access Control uses Strings.py. If you create a CustomStrings.py file, make sure that the number of placeholders (%s) for a given entry is equal to the placeholders for that entry in Strings.py. If CustomStrings.py has a different (smaller) number of placeholders than the entry in Strings.py had, tests will result in an "unknown error," which can result in endpoints getting quarantined when they should not be.

    NOTE:While editing the description avoid the use of double quotes “”. Use single quotes instead. Double quotes will get interpreted by the software and can cut the string short or cause the replacement to fail.

  2. Once your custom strings script is complete, and you are ready to push it out to all of the ESs:

    1. Verify that the scripts and base classes are under the Custom directory tree as specified above.

    2. Enter the following on the command line of the Novell ZENworks Network Access Control MS:

      installCustomTests
      

This command compiles the Python source files, builds an RPM, updates the policy groups, and sends these changes to all ESs.

Table 5-1 Default Test Names and Descriptions

Test name

Description

checkAntiVirusUpdates.String.1

The required anti-virus software was not found. Install anti-virus software and keep the virus definitions up-to-date. Supported Anti Virus software: %s,

checkAntiVirusUpdates.String.2

%s is installed but the service is not running and the virus signatures are not up-to-date (installed: %s required: %s).,

checkAntiVirusUpdates.String.3

%s is installed but the service is not running.,

checkAntiVirusUpdates.String.4

(version: %s),

checkAntiVirusUpdates.String.5

%s is installed but the virus signatures are not up-to-date (installed: %s required: %s).,

checkAntiVirusUpdates.String.6

The %s service is running and virus signatures are up-to-date.,

checkAutoUpdateStatus.String.1

The OS is not relevant to this test.,

checkAutoUpdateStatus.String.2

The auto_update_level_required parameter is required.,

checkAutoUpdateStatus.String.3

Automatic Updates have not been configured. For Windows 2000, install Service Pack 4, then enable Automatic Updates by selecting: Control Panel>>Automatic Updates. For Windows XP: select Control Panel>>System>>Automatic Updates tab.,

checkAutoUpdateStatus.String.4

Automatic Updates are set to: %s,

checkAutoUpdateStatus.String.5

Automatic Updates must be configured to %s. For Windows 2000, install Service Pack 4, then enable Automatic Updates by selecting: Control Panel>>Automatic Updates. For Windows XP: select Control Panel>>System>>Automatic Updates tab.,

checkAutoUpdateStatus.String.6

The Automatic Update client has been disabled. Ask your local System Administrator for instructions on how to enable it.,

checkHotFixes.String.1

An unsupported operating system was encountered.,

checkHotFixes.String.2

The OS is not relevant to this test.,

checkHotFixes.String.3

The service pack level is not relevant to this test.,

checkHotFixes.String.4

The %s installed are not current. Run Windows Update to install the most recent service packs and hotfixes. The missing hotfixes are: %s. You may need to run Windows Update multiple times to install all the hotfixes. Some of the hotfixes listed may be contained in a cumulative patch.,

checkHotFixes.String.5

All required %s are installed.,

checkHotFixes.String.6

There are no %s installed. Run Windows Update to install the most recent service packs and hotfixes. You may need to run Windows Update multiple times to install all the hotfixes.,

checkIESecurityZoneSettings.String.1

There was no security zone specified.,

checkIESecurityZoneSettings.String.2

Internet Explorer %s security zone settings are acceptable.,

checkIESecurityZoneSettings.String.3

There was no security level specified.,

checkIESecurityZoneSettings.String.4

An invalid security level '%s' was specified.,

checkIESecurityZoneSettings.String.5

Could not test Internet Explorer %s security zone settings. On Windows 2000 you must be logged in as the same user that is currently being tested.,

checkIESecurityZoneSettings.String.6

The required security level for your Internet Explorer %s security zone is %s or greater. To change the setting, select Tools>>Internet Options>>Security>>%s>> select the setting and click OK. If you are using a custom setting, higher security settings are required for:<ul>%s</ul>* indicates an Internet Explorer 6 or later setting,

checkIESecurityZoneSettings.String.7

There were no Internet Explorer %s security zone settings found.,

checkIEVersion.String.1

Unable to retrieve IE version.,

checkIEVersion.String.2

Internet Explorer version %s is acceptable.,

checkIEVersion.String.3

The required Internet Explorer browser was not found or is not current. Install the latest version.,

checkMicrosoftOfficeMacroSecurityLevel.String.1

The office_program and the security_level_required parameters are required.,

checkMicrosoftOfficeMacroSecurityLevel.String.2

The specified office_program or security_level_required values are invalid.,

checkMicrosoftOfficeMacroSecurityLevel.String.3

There are no Microsoft Office products installed or the user is not logged in as the same user that is being tested.,

checkMicrosoftOfficeMacroSecurityLevel.String.4

All macro settings are acceptable.,

checkMicrosoftOfficeMacroSecurityLevel.String.5

Microsoft Office %s is not installed.,

checkMicrosoftOfficeMacroSecurityLevel.String.6

The Microsoft %s macro security level setting must be set to %s or above. To change the security level, open %s and do the following: Select \'Options...\' under the \'Tools\' menu. Choose the \'Security\' tab. Press the \'Macro Security...\' button. Select the \'Security Level\' tab. Finally, select the security level %s or higher.,

checkNetBiosInfo.String.1

An unsupported operating system was encountered.,

checkPersonalFirewalls.String.1

The required personal firewall software was not found. Install a personal firewall and keep it up-to-date. Supported firewall software: %s,

checkPersonalFirewalls.String.2

%s is installed but not running.,

checkPersonalFirewalls.String.3

%s service is installed and running.,

checkServicePacks.String.1

An unsupported operating system was encountered.,

checkServicePacks.String.2

The OS is not relevant to this test.,

checkServicePacks.String.3

There are no service packs installed. Run Windows Update to install the most recent service packs.,

checkServicePacks.String.4

There are no service packs installed. Run Windows Update to install the most recent service packs.,

checkServicePacks.String.5

All required service packs are installed,

checkServicePacks.String.6

The service packs installed are not current. Run Windows Update to install the most recent service packs. The current installed service pack is %s. You must be running service pack %s or later.,

checkServicesNotAllowed.String.1

All services found are allowed.,

checkServicesNotAllowed.String.2

The following services are not allowed: %s. Stop the service by selecting Control Panel>>Administrative Tools (located in the Performance and Maintenance category folder)>>Services application>>right-click on the service and select properties. Change the startup type to manual and click stop. Click OK to save your changes.,

checkServicesNotAllowed.String.3

%s, # placeholder for link location for each service.

checkServicesRequired.String.1

All required services were found.,

checkServicesRequired.String.2

The following required services were not found: %s. Start the service by selecting Control Panel>>Administrative Tools>>Services application>>right-click on the service and select properties. Change the startup type to automatic and click start. Click OK to save your changes. If the service does not exist contact your administrator.,

checkServicesRequired.String.3

%s, # placeholder for link location for each service.

checkSoftwareNotAllowed.String.1

Could not import the re module required by this test.,

checkSoftwareNotAllowed.String.2

All software found is allowed.,

checkSoftwareNotAllowed.String.3

Do not specify the HKEY_LOCAL_MACHINE\SOFTWARE registry key.,

checkSoftwareNotAllowed.String.4

The following software is not allowed: %s. Uninstall the software listed. Also, remove any file types listed by double-clicking My Computer>>select Tools>>Folder Options>>File Types and remove the file type mentioned.,

checkSoftwareNotAllowed.String.5

%s, # placeholder for link location for each software package.

checkSoftwareRequired.String.1

Could not import the re module required by this test.,

checkSoftwareRequired.String.2

All required software is installed.,

checkSoftwareRequired.String.3

The required software was not found: %s.,

checkSoftwareRequired.String.4

%s, # placeholder for link location for each software package.

checkUniqueId.String.1

An unsupported operating system was encountered.,

checkUniqueId.String.2

Could not determine unique ID,

checkWindowsSecurityPolicy.String.1

All Windows security policies are acceptable.,

checkWindowsSecurityPolicy.String.2

An unsupported operating system was encountered.,

checkWindowsSecurityPolicy.String.3

The OS is not relevant to this test.,

checkWindowsSecurityPolicy.String.4

The security setting required parameter '%s' is invalid,

checkWindowsSecurityPolicy.String.5

The following Windows security policies are configured incorrectly: %s. Set the Windows security policies by selecting Start>>Control Panel>>Administrative Tools>>Local Security Policy>>Local Policy>>Security Options>>double-click the policy and select enable or disable.,

checkWindowsStartupRegistryEntriesAllowed.String.1

All Windows startup registry entries are acceptable.,

checkWindowsStartupRegistryEntriesAllowed.String.2

The following Windows startup registry entries are not allowed in the HKEY_LOCAL_MACHINE>>Software>>Microsoft>>Windows Run and RunOnce registry keys: %s. Contact your network administrator for removal of these items from the registry.,

checkWormsVirusesAndTrojans.String.1

No worms, viruses or trojans were found.,

checkWormsVirusesAndTrojans.String.2

The following worms, viruses, or trojans were found: %s. Contact your network administrator for assistance on removing them.,

checkAntiSpyware.String.1

The %s software is installed and a scan was run recently on %s.,

checkAntiSpyware.String.2

The %s software was found but a scan has not performed within the last %s days.,

checkAntiSpyware.String.3

The required anti-spyware software was not found. Supported anti-spyware software: %s,

checkAntiSpyware.String.4

The %s software was found but a signature update has not been performed within the last %s days.,

checkAntiSpyware.String.5

The %s software was found but a scan has never been performed.,

checkBadIP.String.1

There were no unauthorized network connections found.,

checkBadIP.String.2

An unsupported operating system was encountered.,

checkBadIP.String.3

The IP addresses %s are on unauthorized networks.,

checkBadIP.String.4

The IP address %s is on an unauthorized network.,