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

Fortigate config backup failing #3218

Open
LoveSkylark opened this issue Jul 5, 2024 · 9 comments
Open

Fortigate config backup failing #3218

LoveSkylark opened this issue Jul 5, 2024 · 9 comments
Labels
help_wanted No one is working on this issue. If no one fixes it, it will be automaticaly closed after some time. Stale

Comments

@LoveSkylark
Copy link

I am trying to backup my FortiGate Firewalls and I keep getting the error:

│ W, [2024-07-05T11:01:20.253418 #33] WARN -- : x.x.x.x raised Timeout::Error with msg "execution expired"

I'm successfully backing up 100+ other devices from different vendors.
It is large config and it takes few minutes to scroll though the CLI if I run 'show | grep .' manually, I have seen previous posts about similar issues and Have tried those solutions.

I changed the global timeout to 600 and I have also tried:

models:
  fortios:
    timeout: 600
    vars:
      fullconfig: false

Problem is I see this time out error 1-2 minutes after the server has started so there is no chance that 10 minutes have passed.

This is how my config file looks like:

    model: cisco
    resolve_dns: true
    interval: 72000
    use_syslog: false
    threads: 30
    use_max_threads: false
    timeout: 600
    retries: 3
    prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
    rest: 0.0.0.0:8888
    next_adds_job: false
    vars: {}
    groups:
      core:
        username: xxxx
        password: yyyy
    models:
      fortios:
        timeout: 600
        vars:
          fullconfig: false
    model_map:
      juniper: junos
      cisco: ios
      cisco: iosxe
      mikrotik: routeros
      ubiquiti: airos
      fortigate: fortios
      fortiswitch: fortios
    pid: "/home/oxidized/.config/oxidized/pid"
    crash:
      directory: "/home/oxidized/.config/oxidized/crashes"
      hostnames: false
    stats:
      history_size: 10
    input:
      default: ssh, telnet
      ssh:
        secure: false
      ftp:
        passive: true
      utf8_encoded: true
    output:
      default: git
      git:
          user: Oxidized
          email: [email protected]
          repo: "/home/oxidized/.config/oxidized/configs"
    source:
      default: http

Any help/suggestion on what I may be doing wrong is greatly appreciated.

@robertcheramy
Copy link
Collaborator

Which version of Oxidized are you using? 0.30.1 introduced a fix for this - not doing a full config (with all defaults).

@LoveSkylark
Copy link
Author

I'm using the latest docker image oxidized/oxidized:latest, downloaded 3 days ago witch would make it: 0.30.1-113-g1269d04.

And yes I think I read your ticket about the "nofull config" and I looked through the "fortios.rb" file and ran each command individual over SSH from the same server, I tried both 'show full-configuration | grep .' and 'show | grep .' over the SSH without any problems, but the screen ran for a long time (have 40+ vDoms) but everyhting ran fine in SSH.

As you can see from above I even tried to disable full backup manually in the config but I suspect this is not the issue because the error I get is happening around 2 minutes after the server comes up, long before the "timeout 600" is in effect (unless my config file is somehow incorrect).

@robertcheramy robertcheramy added the help_wanted No one is working on this issue. If no one fixes it, it will be automaticaly closed after some time. label Jul 9, 2024
@robertcheramy
Copy link
Collaborator

I'm sorry to read this. I've no way to reproduce the behavior as I don't have a fortigate with 40+ vDoms. => Setting the flag help_wanted.

@KevinTang8888
Copy link

what's the lg message with following CLI?

journalctl -u oxidized.service

@iRomanyshyn
Copy link

Hi guys! I think it's not good to do only show instead of show full-configuration as it makes a much smaller file and drops all users configured including any external users. And if someone restores that config the router will be inaccessible on any port due to missing "secrets" I think. I mean it cannot enable HTTPS, SSH, etc. on any interface as there are no certificates in the configuration imported.

@KevinTang8888
Copy link

Hi guys! I think it's not good to do only show instead of show full-configuration as it makes a much smaller file and drops all users configured including any external users. And if someone restores that config the router will be inaccessible on any port due to missing "secrets" I think. I mean it cannot enable HTTPS, SSH, etc. on any interface as there are no certificates in the configuration imported.

Have you tried to restore the oxidized backuped config to a new FortiGate device?

@robertcheramy
Copy link
Collaborator

Hi guys! I think it's not good to do only show instead of show full-configuration as it makes a much smaller file and drops all users configured including any external users. And if someone restores that config the router will be inaccessible on any port due to missing "secrets" I think. I mean it cannot enable HTTPS, SSH, etc. on any interface as there are no certificates in the configuration imported.

This has been fixed and will be included in Oxidized 0.31: https://github.com/ytti/oxidized/blob/master/docs/Model-Notes/FortiOS.md#config-vs-full-config

The issue here is that oxidized gets timeouts on fortigate, even when the getting the configuration without defaults. If you have an unrelated issue, please open a separate issue.

@iRomanyshyn
Copy link

Hi guys! I think it's not good to do only show instead of show full-configuration as it makes a much smaller file and drops all users configured including any external users. And if someone restores that config the router will be inaccessible on any port due to missing "secrets" I think. I mean it cannot enable HTTPS, SSH, etc. on any interface as there are no certificates in the configuration imported.

Have you tried to restore the oxidized backuped config to a new FortiGate device?

Yes, I did.

Copy link

This issue is stale because it has been open 90 days with no activity.

@github-actions github-actions bot added the Stale label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help_wanted No one is working on this issue. If no one fixes it, it will be automaticaly closed after some time. Stale
Projects
None yet
Development

No branches or pull requests

4 participants