> Source: [sk105708](https://support.checkpoint.com/results/sk/sk105708)

# sk105708 - The rulename_check tool 

| Property | Value |
|----------|-------|
| Solution ID | sk105708 |
| Date Created | 2015-04-13 |
| Last Modified | 2018-03-18 |
| Technical Level | General |
| Products | Security Management Server, SmartConsole, Multi-Domain Security Management Server |
| Versions | R82.10, R82, R81.20, R82.20 |

## Solution

**This article is not relevant for R80.x.**

*** ** * ** ***

**<br />**

<br />

Background
----------

When text is copied from advanced text editors (e.g. Microsoft Word) and pasted into the SmartDashboard in a rule, certain non-ASCII characters are pasted as well. These non-ASCII characters (such as "�", "�", "�") will cause the policy installation to fail with various errors like "Internal error", "Load on module error", etc.  
Kernel debug on the gateway in this case will show: *fwloghandle_check_string: invalid char in string (ascii XXX)*

The rulename_check tool
-----------------------

Check Point provides a special [Tool for checking Check Point objects and rules for non-ASCII characters](http://supportcontent.checkpoint.com/documentation_download?ID=47468) that detects the problematic rules in a more convenient way.  
This Tool also prints the rule numbers, but the numbers may be incorrect in case there are VPN automatic rules

**Usage:**

1. Download and unpack the rulename_check tool  

2. Log in to Expert mode.  

3. Run : ***\[Expert@Hostname\]#* *./rulename_check***

The tool will scan the*$FWDIR/conf/rulebases_5_0.fws* file and when it finds the rule with an invalid name, it adds the comment in the string �*--INVALID RULE NAME--* �.  
After running the tool open SmartDashboard, search for this string and fix all names.

Additional Options:
> *-f* - path to a specific file  
> *-d* - delete the rulename to fix the problem. it will also mark all those rule ("*--CLEAN RULE NAME--* ")  
> *-r* - read only mode � it will only print the result of the scan, but won't do any modification to the database.

CLI Procedure
-------------

1. Connect to the command line on the Security Management Server / Multi-Domain Security Management Server.  

2. Log in to Expert mode.
3. On Multi-Domain Security Management Server - switch to the context of the involved Domain Management Server:

   *\[Expert@HostName\]# mdsenv \<Domain_Name\>*
4. Check whether any of the defined Network Objects contains non-ASCII characters:

   *\[Expert@HostName\]# grep -P -n "\[\\x80-\\xFF\]" $FWDIR/conf/objects_5_0.C*
5. Check whether any of the defined Security Rules contains non-ASCII characters:

   *\[Expert@HostName\]# grep -n -e "name.\*(.\*" -e "##.\*" $FWDIR/conf/rulebases_5_0.fws -o \| grep -e "\["$'\\x80'"-"$'\\x9F'"\]" -e \[\[:cntrl:\]\] -e "##"*   

   ![](https://sc1.checkpoint.com/sc/SolutionsStatics/sk105708/1a1604111013.jpg)  

6. *\[Expert@HostName\]# grep -n -e "comments.\*(.\*" -e "##.\*" $FWDIR/conf/rulebases_5_0.fws -o \| grep -e "\["$'\\x80'"-"$'\\x9F'"\]" -e \[\[:cntrl:\]\] -e "##"*   

   ![](https://sc1.checkpoint.com/sc/SolutionsStatics/sk105708/2a1604111016.jpg)  

   ![](https://sc1.checkpoint.com/sc/SolutionsStatics/sk105708/2a1604111029.jpg)  

7. If Network Objects / Security Rules indeed contain non-ASCII characters then delete the non-ASCII characters:

   1. Collect a complete backup of the Management Server (refer to section "How to Backup" below). At least, backup these files:

      * *$FWDIR/conf/objects_5_0.C*
      * *$FWDIR/conf/rulebases_5_0.fws*

      <br />

      Show / Hide how to backup  
      > * [sk108902 - Best Practices - Backup on Gaia OS](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk108902)
      > * [sk91400 - System Backup and Restore feature in Gaia](http://supportcontent.checkpoint.com/solutions?id=sk91400)
      > * [sk54100 - How to back up your system on SecurePlatform](http://supportcontent.checkpoint.com/solutions?id=sk54100)
      > * [sk98153 - How to take snapshot of Endpoint Security Management Server database](http://supportcontent.checkpoint.com/solutions?id=sk98153)
      > * [sk33329 - How to exclude or include files in the Backup on SecurePlatform or Gaia OS](http://supportcontent.checkpoint.com/solutions?id=sk33329)
      > * [sk92570 - How to exclude logs from Provider-1 backup on Gaia](http://supportcontent.checkpoint.com/solutions?id=sk92570)
      > * [sk62226 - How to test Provider-1 MDS Backup file](http://supportcontent.checkpoint.com/solutions?id=sk62226)
      > * Gaia Administration Guide ([R76](http://supportcontent.checkpoint.com/documentation_download?id=22928), [R77](http://supportcontent.checkpoint.com/documentation_download?id=24828)):  
      >   * Chapter 10 'Maintenance' - System Configuration Backup
      > * SecurePlatform Administration Guide ([R76](http://supportcontent.checkpoint.com/documentation_download?id=22919), [R77](http://supportcontent.checkpoint.com/documentation_download?id=24810)):  
      >   * Chapter 4 'Configuration Using the Web Interface' - Device - Backup
      >   * Chapter 7 'SecurePlatform Shell' - System Commands - backup
      >   * Chapter 7 'SecurePlatform Shell' - Snapshot Image Management
      > * Multi-Domain Security Management Administration Guide ([R76](http://supportcontent.checkpoint.com/documentation_download?id=22916), [R77](http://supportcontent.checkpoint.com/documentation_download?id=24807)):  
      >   * Chapter 12 'Multi-Domain Security Management Commands and Utilities' - Command Line Reference - cma_migrate
      >   * Chapter 12 'Multi-Domain Security Management Commands and Utilities' - Command Line Reference - mds_backup
      >   * Chapter 12 'Multi-Domain Security Management Commands and Utilities' - Command Line Reference - mds_restore
      > * Installation and Upgrade Guide ([R76](http://supportcontent.checkpoint.com/documentation_download?id=22901), [R77 Gaia](http://supportcontent.checkpoint.com/documentation_download?id=24831), [R77 Non-Gaia](http://supportcontent.checkpoint.com/documentation_download?id=30531)):  
      >   * Chapter 'Upgrading Multi-Domain Security Management' - Upgrade Multi-Domain Security Management Tools - migrate export
      >   * Chapter 'Upgrading Multi-Domain Security Management' - Upgrade Multi-Domain Security Management Tools - cma_migrate
      >   * Chapter 'Upgrading Multi-Domain Security Management' - Upgrade Multi-Domain Security Management Tools - Backup and Restore
   2. Login to SDB and search for the object/rule name/comments that contains the non-ASCII character based on the above command output. Delete non-ASCII character and then push policy. "OR"

   3. Stop Check Point services:

      * On Security Management Server:

        *\[Expert@HostName\]# cpstop*   

      * On Multi-Domain Security Management Server:

        *\[Expert@HostName\]# mdsstop_customer \<Domain_Name\>*

      <br />

      <br />

   4. Edit the relevant file in Vi editor (*$FWDIR/conf/objects_5_0.C* and/or *$FWDIR/conf/rulebases_5_0.fws* )   

   5. Delete the non-ASCII characters in the relevant lines (refer to the output of the '`grep`' command).   

   6. Save the changes in the file and exit from the Vi editor.
   7. Start Check Point services:

      * On Security Management Server:

        *\[Expert@HostName\]# cpstart*   

      * On Multi-Domain Security Management Server:

        *\[Expert@HostName\]# mdsstart_customer \<Domain_Name\>*

   <br />

   <br />

8. Connect with SmartDashboard to Security Management Server / Domain Management Server.   

9. Install the policy onto the relevant Security Gateway / Cluster object.

---

# Agent Instructions

This content is from the Check Point Support Center (https://support.checkpoint.com), the official knowledge base for Check Point cybersecurity products.

## Navigating This Knowledge Base

- **Complete index**: [llms.txt](https://support.checkpoint.com/llms.txt)
- **All SK articles**: [SecureKnowledge Sitemap](https://support.checkpoint.com/sitemaps/secureknowledge-sitemap-index.xml)
- **SK article URL pattern**: `https://support.checkpoint.com/results/sk/{skId}`
- **Markdown responses**: AI bot User-Agents automatically receive `text/markdown` content
