Friday, September 9, 2016

Checkpoint Gaia - editing the internal database

Every now and then I get this error when running Checkpoint services

myhost> cpstat os
 fw_ipaddr_both: Unable to resolve ipaddr for myhost

Failed to establish session with AMON server at 127.0.0.1:18192

Why does it occur? I still have not found out a root cause.
The entry for myhost is missing in the file /etc/hosts. If you edit the file you will lose your changes with a reboot.
So I have found a workaround to fix it and get services running

You first check that the initial database does not have what you are looking for:


Expert # dbget hosts:v4:myhost:address

Then you run these commands to write directly into the database:




Expert # dbset  hosts:v4:myhost t
Expert # dbset  hosts:v4:myhost:address 1.2.3.4

final touch . Save your fix and recreate the /etc/hosts file.


Expert #  dbset :save
Expert #  /bin/hosts_xlate hosts /etc/hosts < /config/active


You are all set. the entry is permanent in file /etc/hosts