Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
darren97
Contributor

web_api_show_package.sh - Script stopped running due to severe error!

Hello,

 

Trying to run export of fw rules from management.

command: $MDS_FWDIR/scripts/web_api_show_package.sh -d DOMAIN -g GATEWAY -u user -p password

Script stopped running due to severe error!
Result file location: show_package...

When I opened .elg file: An error occurred while logging in to the server. Message: 'Authentication to server failed.'. Status Code: '400'

When I try to login with the same credentials in command "mgmt_cli login -u user" it works.

What account should be used or what am I doing wrong?

Thank you.

0 Kudos
7 Replies
the_rock
MVP Diamond
MVP Diamond

Is it mds?

Best,
Andy
"Have a great day and if its not, change it"
0 Kudos
darren97
Contributor

yes, it is.

0 Kudos
the_rock
MVP Diamond
MVP Diamond

Maybe try both creds for mds or cma itself.

Best,
Andy
"Have a great day and if its not, change it"
0 Kudos
darren97
Contributor

Hello,

I selected mds using mdsenv and run command:

$FWDIR/scripts/web_api_show_package.sh -g INT02 -k INT02_policy -o /var/log/

I finnaly got something, but without fw and nat rules 😞

fw_export.png

0 Kudos
Don_Paterson
MVP Gold
MVP Gold

Does the account you are running the script as have permissions in/to the domain?

 

0 Kudos
darren97
Contributor

I am using user account that is configured as Multi Domain Super User in CheckPoint SmartConsole.

$FWDIR/scripts/web_api_show_package.sh -o /var/log/ -u user -p password

To expert mode, I am logged as admin user.

I tried command above which should include all gateways, based on .elg file I logged in successfully, but I am getting this:

[6/8/26 8:36 PM com.checkpoint.mgmt_api.examples.MyLogger.debug()DEBUG]: Run command: 'show-gateways-and-servers' with details level 'full'
[6/8/26 8:36 PM com.checkpoint.mgmt_api.examples.MyLogger.debug()DEBUG]: Found 29 gateways from 'show-gateways-and-servers'
[6/8/26 8:36 PM com.checkpoint.mgmt_api.examples.ShowPackageTool.collectGatewaysInUseAndInstalledPolicies()INFO]: Found 24 gateways that have a policy installed on them
[6/8/26 8:36 PM com.checkpoint.mgmt_api.examples.MyLogger.debug()DEBUG]: Run command: 'show-vpn-communities-star' with details level 'full'
[6/8/26 8:36 PM com.checkpoint.mgmt_api.examples.MyLogger.debug()DEBUG]: Run command: 'show-vpn-communities-meshed' with details level 'full'
[6/8/26 8:36 PM com.checkpoint.mgmt_api.examples.MyLogger.debug()DEBUG]: Found 0 vpn communities
[6/8/26 8:36 PM com.checkpoint.mgmt_api.examples.MyLogger.debug()DEBUG]: Run command: 'show-packages' with details level 'full'
[6/8/26 8:36 PM com.checkpoint.mgmt_api.examples.MyLogger.debug()DEBUG]: Found 0 packages
[6/8/26 8:36 PM com.checkpoint.mgmt_api.examples.MyLogger.warning()WARNING]: No packages found on the server. Try to login to a user's domain
[6/8/26 8:36 PM com.checkpoint.mgmt_api.examples.ShowPackageTool.logoutReportAndExit()INFO]: Script finished running with warnings!

Here: https://www.youtube.com/watch?v=dsmwZDXF7kM in 4:30 not even use admin, password and working smoothly. In my case through MDS no luck, when I switch to specific domain, login successfull, but no real output.

 

0 Kudos
Danny
MVP Diamond
MVP Diamond

You can also try to use this backup extension to export your rulebase into a .html file.

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events