Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Sarath_M
Contributor
Jump to solution

Error while exporting access rules using show package script

I am trying to export the access logs using $MDS_FWDIR/scripts/web_api_show_package.sh command on our Management server which is R80. I can export all the FW rules and other IPS rules but i'm not able to export the NAT rules.

It gives me the following error.

Unexpected character (S) at position 39.
at org.json.simple.parser.Yylex.yylex(Yylex.java:610)
at org.json.simple.parser.JSONParser.nextToken(JSONParser.java:269)
at org.json.simple.parser.JSONParser.parse(JSONParser.java:118)
at org.json.simple.parser.JSONParser.parse(JSONParser.java:81)
at org.json.simple.parser.JSONParser.parse(JSONParser.java:75)
at com.checkpoint.mgmt_api.client.ApiClient.store(ApiClient.java:567)
at com.checkpoint.mgmt_api.client.ApiClient.apiCall(ApiClient.java:305)
at com.checkpoint.mgmt_api.client.ApiClient.apiCall(ApiClient.java:359)
at com.checkpoint.mgmt_api.examples.ShowRulebaseExample.showNATRulebase(ShowRulebaseExample.java:939)
at com.checkpoint.mgmt_api.examples.ShowRulebaseExample.getPackageData(ShowRulebaseExample.java:428)
at com.checkpoint.mgmt_api.examples.ShowRulebaseExample.main(ShowRulebaseExample.java:286)

Kindly let me know how to export the NAT rules as well.

32 Replies
fulvio
Explorer

What I have noticed, not sur I should read too much into this, is that for sections that succeed when I run the mgmt_cli command in isolation:

mgmt_cli -r true -d "ABC_Corp" show access-rulebase limit 10 offset 1740, the output is continuous from rule 1741 to 1750.

at the begging of the JSON I get

"from" : 1741,
"to" : 1750,

for the two sections I am having issues with (only in web_api) the output commands is broken into sections

For example:

mgmt_cli -r true -d "ABC_Corp" show access-rulebase limit 10 offset 1890 uid d1d3d573-4fe0-4cef-9ac6-735899cc2511 

"from" : 1891,
"to" : 1894,

then, lower in the file,

"from" : 1895,
"to" : 1895,

then

"from" : 1896,
"to" : 1899,

similarly for 

mgmt_cli -r true -d "ABC_Corp" show access-rulebase limit 10 offset 1860 uid d1d3d573-4fe0-4cef-9ac6-735899cc2511 
"from" : 1861,
"to" : 1862,

then

"from" : 1863,
"to" : 1870,

0 Kudos
A_KOUADIO
Contributor

Run this, it will give the line

java -jar web_api_show_package-jar-with-dependencies.jar -k "your_package-name" --query-limit limit 1

0 Kudos
fulvio
Explorer

thank you very much! 

I can see the two lines failing now, will investigate.

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events