command cli show arp and export result

Reply
Highlighted
L1 Bithead

command cli show arp and export result

command cli show arp and export result
I search to export the result show arp command

show command, copy the result and export to my computer in ssh


Accepted Solutions
Highlighted
L1 Bithead

Re: command cli show arp and export result

excuse me it's ok

thank you very mutch

View solution in original post

Highlighted
L5 Sessionator

Re: command cli show arp and export result

Hi@axelfa ,

 

As you're looking for exporting arp list, just put IP address of your firewall and a associated API key in below path, the file will get exported through curl. In the post, may be you're not able to see full path, just copy below path and paste it in notepad. So you'll get more clarity.

Just make sure IP address and API key is correct.

 

curl -kG "https://192.168.1.1/api/?type=op&cmd=%3Cshow%3E%3Carp%3E%3Centry+name+%3D+%27all%27%2F%3E%3C%2Farp%3E%3C%2Fshow%3E&key=<api-key>"  > arp-list.xml

 

Hope it works!

Mayur

 

 



Mayur Sutare

View solution in original post


All Replies
Highlighted
Cyber Elite

Re: command cli show arp and export result

Hello,

If using SSH, then just highlight the stuff you want to copy and then paste it into notepad or something else. 

 

Regards,

Highlighted
L1 Bithead

Re: command cli show arp and export result

Thank you for you help but i don't want to do manualy

it's possible for the exemple ( scp export configuration from MyBackup.xml to user@<scphost>:/path) so whay not for show arp ..

 

Highlighted
L1 Bithead

Re: command cli show arp and export result

perhaps it's possible to do show arp and >into a file and export the file ?

 

Highlighted
L5 Sessionator

Re: command cli show arp and export result

@axelfa,

 

You can try to export it using API.

 

API URL would be,

/api/?type=op&cmd=<show><arp><entry name = 'all'/></arp></show>

 

Mayur



Mayur Sutare
Highlighted
L1 Bithead

Re: command cli show arp and export result

thank you

i 'm beginner

can you help me for a sample example:

i m testing: https://myfirewall/api/?type=op&command=<show><arp><entry name='all'/></arp></show>

message:

<response status="error" code="403">
<result>
<msg>Invalid Credential</msg>
</result>
</response>

 

Highlighted
L5 Sessionator

Re: command cli show arp and export result

@axelfa,

 

First you need to generate API key for your firewall and then you can use it under following path to execute required tasks. For generating api-key, try below path from system's browser from where your firewall is reachable. Here put login credentials which has proper access related to XML/REST API on firewall.

 

https://<firewall-ip>/api/?type=keygen&user=<username>&password=<password>

 

 

Once you have API-KEY for your firewall, use it under below path and shoot it. You should get ARP list in xml format.

 

https://192.168.1.1/api/?type=op&cmd=<show><arp><entry+name+%3D+%27all%27%2F><%2Farp><%2Fshow>&key=<...

 

 

Now if you want to export it in xml file on your system then try below through command prompt. For this, you need to install CURL. Once curl is install, try below from command prompt.

 

curl -kG "https://192.168.1.1/api/?type=op&cmd=%3Cshow%3E%3Carp%3E%3Centry+name+%3D+%27all%27%2F%3E%3C%2Farp%3...>" > arp-list.xml

 

I tried above in my lab and i am getting xml file created with name arp-list.xml.

 

If you need any reference guide for generating API key, installing CURL etc, please refer below KB article.

 

https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000Cm7yCAC

 

Hope it helps!

Mayur



Mayur Sutare
Highlighted
L2 Linker

Re: command cli show arp and export result

Looks good, I will also try this in my environment. Just confirm if it creates any extra resource utilization due to these API calls.

Highlighted
L5 Sessionator

Re: command cli show arp and export result

@Vikashh, It shouldn't create any negative impact on the firewall.

 

Mayur



Mayur Sutare
Highlighted
L1 Bithead

Re: command cli show arp and export result

Hello
I'm access a web acces Firewall

login password

and /api:

XML API
Commit
Configuration Commands
Export
Import
Logs
Operational Commands
Reports
User ID

it's similar to access : https://<firewall-ip>/api/?type=keygen&user=<username>&password=<password>

OR NOT ?

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!