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

AsyncOS prompt not always matching #3327

Open
YoucefYousfi opened this issue Nov 26, 2024 · 2 comments
Open

AsyncOS prompt not always matching #3327

YoucefYousfi opened this issue Nov 26, 2024 · 2 comments

Comments

@YoucefYousfi
Copy link

YoucefYousfi commented Nov 26, 2024

In our company, we have ESA devices running AsyncOS 14.X.
We have made two changes to adapt asyncos.rb to our devices :

  • prompt is in the format "(Machine hostname) " so we use this regex : prompt /^\r*([(]?[\w.- ]+[)]?[#>]\s*)$/ (I believe this is due to the devices running in cluster mode)
  • there is no third option for passphrase, only 1 or 2. We opt for 2 so we changed "send1\n" to "send2\n"

Apart from these changes, the script is identical. However, there is something wrong with the behavior that I could not understand : The prompt is correctly detected and handled until the end of the showconfig command, the prompt reappears and is identical as expected, but Oxidized does not run the pre_logout command "exit" to end the session. Instead, it hangs until the timeout is raised, failing the backup.

I could not identify the cause of this, any idea on how to fix this?

robertcheramy added a commit that referenced this issue Nov 29, 2024
- The prompt specified in issue #3327 works
- Creating a cmdset in order to get a YAML simulation file
@robertcheramy
Copy link
Collaborator

The prompt you specified ("(Machine hostname) ") works in Version 0.31.0 without changing the model.
Could you provide a [YAML Simulation file}(https://github.com/ytti/oxidized/blob/master/docs/Issues.md#sumbit-a-yaml-simulation-file) ?

The needed script command line is `./device2yaml.rb user@devicename -c cmdsets/asyncos -o yaml/asyncos.yaml

You will have to press space and 3 + return when asked to, the script does not know how to interact to the device.

@YoucefYousfi
Copy link
Author

The file generated is rather big with 55809 lines due to the big configuration. The prompt is exactly in this format : "(Machine xx-xx-x1xx1-xxxx-xxxx.xxxx.xxxxx.example.xxx)> ". It does not match with default prompt due to this character '-'. That is how I generated the file but it contains sensitive configuration. However I can share the ssh logs so that you can see (it hangs at the end of showconfig command, when the prompt appears) :

        </capture_destinations>
        <capture_custom_filter></capture_custom_filter>
      </capture_filter>
    </system_packet_trace>
</config>

</machine>
</cluster_config>

(Machine xx-xx-x1xx1-xxxx-xxxx.xxxx.xxxxx.example.xxx)> 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants