Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assistance: Help creating config for PAN-OS backup via XML API #2098

Closed
tavern2782 opened this issue May 15, 2020 · 8 comments
Closed

Assistance: Help creating config for PAN-OS backup via XML API #2098

tavern2782 opened this issue May 15, 2020 · 8 comments
Labels

Comments

@tavern2782
Copy link

tavern2782 commented May 15, 2020

Hi all,

I apologize for creating such a noob issue. I'm a network engineer and am trying to learn how to use Oxidized. I've successfully got this working for my JunOS devices, but am not understanding the config needed for pull the PAN-OS config via the XML API.

Current config (sanitized, no HTTP):

username: <user>
password: <pass>
model: junos
resolve_dns: false
interval: 3600
use_syslog: false
debug: false
threads: 30
timeout: 20
retries: 3
prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
rest: false
next_adds_job: false
vars: {}
groups: {}
models: {}
pid: "/dev/null"
crash: false
  #directory: "/root/.config/oxidized/crashes"
  #hostnames: false
stats:
  history_size: 2
input:
  default: ssh
  debug: false
  ssh:
    secure: false
  ftp:
    passive: true
  utf8_encoded: true
output:
  default: file
  file:
      directory: "/root/.config/oxidized/configs"
source:
  default: csv
  csv:
    file: "/root/.config/oxidized/router.db"
    delimiter: !ruby/regexp /:/
    map:
     name: 0
     model: 1
     ip: 2
    gpg: false
model_map:
  juniper: junos
  palo_alto: panos

I'm also curious if it's possible to specify an input method under a groups config. Something like this:

groups:
    palo:
        input: http
            #http stuff here

Again, I apologize for the noob-ish question. I'm really trying to learn here but am coming up empty on examples from Google.

@ytti
Copy link
Owner

ytti commented May 16, 2020

To understand what panos does, the best place to read is the panos model. The model shows only ssh support:
https://github.com/ytti/oxidized/blob/master/lib/oxidized/model/panos.rb

If you'd want to use some HTTP API instead, best place is to check models which use http:
https://github.com/ytti/oxidized/blob/master/lib/oxidized/model/cambium.rb
https://github.com/ytti/oxidized/blob/master/lib/oxidized/model/grandstream.rb

@tavern2782
Copy link
Author

To understand what panos does, the best place to read is the panos model. The model shows only ssh support:
https://github.com/ytti/oxidized/blob/master/lib/oxidized/model/panos.rb

If you'd want to use some HTTP API instead, best place is to check models which use http:
https://github.com/ytti/oxidized/blob/master/lib/oxidized/model/cambium.rb
https://github.com/ytti/oxidized/blob/master/lib/oxidized/model/grandstream.rb

I appreciate your response, but this isn't really a good answer. Those models are written for those devices. The commands present in the models will not work for PAN.

@ytti
Copy link
Owner

ytti commented May 16, 2020

It is not clear what answer you are looking for. It seems you want to build new model to use XML API in PanOS (Which I assume is over HTTP). Is the answer you want working model using XML API? Or is the answer you're looking for instructions on how to start writing such API?

@will-h
Copy link
Contributor

will-h commented May 16, 2020

It looks as if the panos model in https://github.com/ytti/oxidized/blob/master/lib/oxidized/model/panos.rb is only designed to work over SSH to the CLI.

If you want to pull the config using some other method, including XML over HTTP, you'll need to write some code for this.

@tavern2782
Copy link
Author

It looks as if the panos model in https://github.com/ytti/oxidized/blob/master/lib/oxidized/model/panos.rb is only designed to work over SSH to the CLI.

If you want to pull the config using some other method, including XML over HTTP, you'll need to write some code for this.

This is what I was afraid of. I was hoping maybe there would be some workaround without necessarily needing a model. I'm just an IT engineer - my coding skills are weak and will likely remain that way for the foreseeable future.

For now, I guess I'll have to ditch Oxi and try something else.

Thank you for your time.

@will-h
Copy link
Contributor

will-h commented May 16, 2020

It's much more helpful if you take a bit of time to research the problem more before opening new issues, because it seems this has actually been discussed previously - take a look at #440 and the linked issues there. In particular it seems like the PR at #1110 has a fix. You could give that a try. :)

@tavern2782
Copy link
Author

tavern2782 commented May 16, 2020 via email

@mortzu
Copy link
Collaborator

mortzu commented Jan 12, 2022

Duplicate of #440
And there is a PR #2360

@mortzu mortzu closed this as completed Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants