The command you run on the gateway to determine if IPS blade is enabled and, if so, what version of the database it has: ips stat.
The run-script API is documented here: https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/run-script~v1.9%20
Which translates to something like:
mgmt_cli -r true run-script script-name "Get status of IPS on Gateway" script "ips stat" targets.1 "MyGateway"
This API endpoint is asynchronous, meaning it will return a task-id instead of the results of that script.
To see the results, you need to use the show-task API: https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/show-task~v1.9%20
The responseMessage is encoded in base64 format, which will need to be decoded.
Thankfully, this can easily be done with the CLI:
mgmt_cli -r true --format json show-task task-id "d23f46e1-0f6a-4c53-8d94-380d292d6781" details-level full | jq '.tasks[]."task-details"[].responseMessage' | base64 -id
To explain this command (entered from expert mode on the management):
- -r true is a simple way to execute API commands from the management without providing credentials.
- --format json ensures mgmt_cli returns data in JSON format (by default it does not, but direct API calls will).
- jq '.tasks[]."task-details"[].responseMessage' (after the |) pulls out the responseMessage from the mgmt_cli output
- base64 -id (after the |) decodes the base64
There are other ways to achieve this that don't involve the API as well.