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

Fail to backup when switchprompt contains a space #134

Open
nafetsa opened this issue Aug 29, 2024 · 0 comments
Open

Fail to backup when switchprompt contains a space #134

nafetsa opened this issue Aug 29, 2024 · 0 comments
Labels

Comments

@nafetsa
Copy link

nafetsa commented Aug 29, 2024

Describe the bug

The prompt of my HPE OfficeConnect Switch 1920S reads '(HPE Routing) #' for privilege-15 and '(HPE Routing) >' for other privilege levels. When run on a php prompt with --debug, after the 'NOTICE: Ensuring process is enabled' it gives 10 timeouts and concludes with 'Process is now NOT enabled' and 'ERROR: Failed to download 'myHProuter' to '/usr/share/cacti/site/backups/myHProuter' via 'ssh''.

To Reproduce

Steps to reproduce the behavior:

  1. Go to the RouterConfigs tab
  2. Tick a HP OfficeConnect router
  3. Select 'backup'
  4. See that the backup fails and is rescheduled

Expected behavior

The backup should not fail.

Screenshots

Additional context

Cacti 1.2.26 running on Ubuntu 24.04.1 LTS
plugin RouterConfigs 1.6
plugin Thold 1.8.1
plugin Weathermap 1.3

Add any other context about the problem here.
This would all be no problem if you could change the offending prompt to one without spaces, but you can't seem to do that on this particular switch.

My fix is to add a space to the preg_match in line 355 and line 361 of routerconfigs/classes/PHPConnection.php like so:
image
becomes
image

but what works for me may not work for everone, or it may have unforseen side effects. I did not notice any effect for all my other (Cisco) switches.

@nafetsa nafetsa added the bug label Aug 29, 2024
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

1 participant