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

Output is being truncated even output_truncate: -1 is set #30

Open
Ared8 opened this issue Aug 8, 2023 · 1 comment
Open

Output is being truncated even output_truncate: -1 is set #30

Ared8 opened this issue Aug 8, 2023 · 1 comment

Comments

@Ared8
Copy link

Ared8 commented Aug 8, 2023

With this config (trying to get full config from a switch) for each execution the length of the output is different, sometimes outputs everything and sometimes output is truncated

modules:
show_full_config:
user: XXX
password: XXX
command: "show run view full | begin Current"
timeout: 60
output_metric: true
output_truncate: -1

using last version 1.5.0

@treydock
Copy link
Owner

When the output is truncated, does it end with ...? The code will return the full string when the truncate is -1:

func truncateString(str string, num int) string {
bnoden := str
if num == -1 {
return bnoden
}

If the truncated output does not contain the ... suffix then the truncation code isn't the cause. It might be there is a timeout occurring if the output is very large.

FWIW this exporter is designed to validate SSH is healthy and the output is intended to validate that SSH login was successful, ie execute uptime to validate got valid SSH login session. For something like downloading full switch configs, there are tools like oxidized: https://github.com/ytti/oxidized.

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