Closed empi89 closed 6 years ago
The device obviously always shows prompt and command, right? It doesn't print them sometimes and not print sometimes? So they should be taken away by this: https://github.com/ytti/oxidized/blob/master/lib/oxidized/model/comware.rb#L18
Why isn't it working? I think it's race condition because broken model. We rely on screen-scraping prompt to know when output has ended. If we do not eat prompt when it happens, another command may consume it early and we go out of sync and cause all kind of funky issues.
Your correction makes it more broken. send
doesn't expect anything, if those commands produce prompt, you have prompts in buffer which are unconsumed.
In the original model, there is same problem: https://github.com/ytti/oxidized/blob/master/lib/oxidized/model/comware.rb#L37-L43
I assume bunch of these actually produce command line, which is not consumed.
It would be safer to refactor all send
away. Replace them with cmd
which expects to see prompt, or if another argument is specifies, expect to see that regexp. This way we retain lock-step with output.
I can't tell how to refactor the original, as I don't have the platform, but once it works with all send
replaced with cmd
it'll be far more robust.
This issue has been automatically closed because there has been no response to our request for more information from the original author. The information that is currently in the issue is insufficient to take further action. Feel free to re-open this issue if additional information becomes available, or if you believe it has been closed in error.
Hi guys, can someone comment this? Im facing the same issue that versions are spaming because of these lines: Can you @ytti suggest me which lines to edit @ comware.rb ?
Found solution for HP 1920/1910. just add this line to comware.rb
if vars :ignore_disp_ver cfg.gsub! /^! Info: Current terminal monitor is off. .*/,'' Oxidized.logger.debug "Ignoring display info" end
I have a huge amount (>500) of HPE switches and especially the 5120 which sometimes output the prompt and command. This leads to flapping in configuration versions and flooding of hooks. e.g.:
I have observed that this is especially the case when the devices have some cpu load due to snmp polling. I have already changed some parts of the comware-Model to have it more reliable:
with
Because I often had the message "Info: Current terminal monitor is off." contained in the output.
For the display current-configuration I would like to implement some kind of late-filter which removes the lines starting with a prompt. However I have not found any examples how to do this in the other models. Could you please provide a hint on this? Thanks in advance!