Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
SuneB
Explorer

show services-tcp conflicting answers

Hi,

I get different results when using the Web Services API contra the mgmt_cli. 

Eg. when asking for total number of tcp services, I get  'total': 217  when using the API and "total" : 225 when asking via the CLI.

Same goes for other services eg. "Other". 

It seems that API only returns objects created by the system and CLI returns all objects.

0 Kudos
7 Replies
PhoneBoy
Admin
Admin

How precisely are you constructing the API query?
Show the full query you are making with all arguments.

How precisely are you constructing the mgmt_cli query? (Which also uses the API)
Show the full CLI command used.

What version/JHF level of management is this against?

0 Kudos
SuneB
Explorer

Hi PhoneBoy,

API call is done with Python3's request-module, like this,

request:
url = https://ip-address/web_api/show-services-tcp
json_payload = {"limit" : 300, "offset" : 0, "details-level" : "uid"}
request_headers = {'Content-Type' : 'application/json', 'X-chkp-sid' : sessionID}
response = requests.post(url, json = json_payload, headers=request_headers)<200b>
response:
...
'total': 217

CLI call from SmartConsole,
request:
show services-tcp
response:
...
total: 226


The firewall is running R81.10

0 Kudos
PhoneBoy
Admin
Admin

You are exceeding the default limit for that API call.
These limits exist to ensure the API server remains performant and should not be exceeded.
When you do, you may see the inconsistent results you are observing.
The proper way to get all the results is to make multiple API calls using the limit/offset parameters to ensure you get all the results.

0 Kudos
SuneB
Explorer

Hi again,
I've tried using the default limit(50), same result:

API:

'from': 1, 'to': 50, 'total': 217
CLI:
from: 1
to: 50
total: 226
0 Kudos
PhoneBoy
Admin
Admin

Like @Bob_Zimmerman mentioned, best to diff the output between the two and see what the differences are.
I also recommend a TAC case.
@Omer_Kleinstern 

0 Kudos
Omer_Kleinstern
Employee
Employee

Hi @SuneB ,

 

Are you using a Multi-Domain Server?

Is the same administrator running the API and SmartConsole CLI?

 

Thanks,

Omer

 

0 Kudos
Bob_Zimmerman
Authority
Authority

Dump the results from both to files and diff them.

Are any services in the network call results but not the SmartConsole call results?

Which services are in the SmartConsole call results but not the network call results?

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events