Routerconfig doesn't work

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
sim
Posts: 5
Joined: Mon Nov 26, 2018 4:14 am

Routerconfig doesn't work

Post by sim »

I'm very new for routerconfig, I hope someone can help me.
I create a device (Cisco ASA5506) as below:
Enable Device: Yes
IP: 172.16.X.X
Directory: blank
Schedule: Daily
Device Type: Cisco IOS
Connection Type: SSH
Authentication account: Test, I use my admin account which is created in authentication tab name "Test".

I try to backup manually but it just refresh and nth happen. I don't see any error log in Cacti.log. Please anyone help me.
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Routerconfig doesn't work

Post by netniV »

What version of Cacti and RouterConfigs are you running? You can run a download manually at the command line to check you what the debug shows. You can also enable Debug via the GUI.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
sim
Posts: 5
Joined: Mon Nov 26, 2018 4:14 am

Re: Routerconfig doesn't work

Post by sim »

I'm running Cacti 1.1.38 and routerconfig 1.4.0.
sim
Posts: 5
Joined: Mon Nov 26, 2018 4:14 am

Re: Routerconfig doesn't work

Post by sim »

I try manually download, in the cli it seem working (can login and copy run-config) but php cannot read that backup file and I also don't see backup file in backup location.

Please see below log:

[root@localhost ~]# php /usr/share/cacti/plugins/routerconfigs/router-download.php
2018/11/27 09:23:09 - RCONFIG NOTICE: Starting automatic backup
2018/11/27 09:23:09 - RCONFIG STATS: Backup now running since 2018-11-27 09:23:09
2018/11/27 09:23:09 - RCONFIG DEBUG: SQL: SELECT * FROM plugin_routerconfigs_devices WHERE enabled = 'on' AND (nextbackup <= 1543285389 OR nextbackup IS NULL)
2018/11/27 09:23:09 - RCONFIG DEBUG: Attempting download for Device-1
2018/11/27 09:23:09 - RCONFIG DEBUG: Base64 decoded: a:3:{i:660872456;i:1455700181;s:8:"password";s:13:"(13: chars)";i:509408025;i:1464028385;}
2018/11/27 09:23:09 - RCONFIG DEBUG: Base64 decoded: a:3:{i:1525768244;i:1196085949;s:8:"password";s:13:"(13: chars)";i:191184865;i:881864384;}
2018/11/27 09:23:09 - RCONFIG 172.16.12.1 -> DEBUG: Attempting to connect via SSH
2018/11/27 09:23:09 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Creating SSH(Server: 172.16.12.1, User: XXX, Password: (13 chars), Enablepw: (13 chars), Devicetype: {"id":"1","name":"Cisco IOS","username":"username:","password":"password:","copytftp":"copy run tftp","version":"show version","confirm":"y","sleep":"125000","timeout":"1","forceconfirm":"","checkendinconfig":"on"}
2018/11/27 09:23:09 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Setting timeout to 5 second(s)
2018/11/27 09:23:09 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Setting sleep time to 125000 microsecond(s)
2018/11/27 09:23:09 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: okay: logged in...
2018/11/27 09:23:09 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Connected via ssh
2018/11/27 09:23:09 - RCONFIG 172.16.12.1 (SSH) -> NOTICE: Ensuring process is enabled
2018/11/27 09:23:09 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: -->
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- **** Authorized User Only!!!! ****
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- User XXX logged in to Device-1
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- Logins over the last 31 days: 11. Last login: 09:20:07 ICT Nov 27 2018 from 172.16.50.9
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- Failed logins since the last login: 0.
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- Type help or '?' for a list of available commands.
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- Device-1>
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- Device-1>
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Found Prompt (Normal)
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Attempt 1 of 10 to find prompt
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Sending enable command
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- en
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- Password:
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Found Prompt (Password)
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: --> (13 chars)
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- *************
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- Device-1#
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Found Prompt (Enabled)
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Ok we are in enabled mode
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> Process is now enabled
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: --> copy run tftp
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- copy run tftp
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- Source filename [running-config]?
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Found Prompt (Question)
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Line: Source filename [running-config]?
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Result: (0)
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Question found
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> NOTICE: Sending Filename (Source):
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: -->
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- Address or name of remote host []?
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Found Prompt (Question)
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Line: Address or name of remote host []?
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Result: (0)
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Question found
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> NOTICE: Sending Server: 172.16.20.62
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: --> 172.16.20.62
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- 172.16.20.62
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- Destination filename [running-config]?
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Found Prompt (Question)
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Line: Destination filename [running-config]?
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Result: (0)
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Question found
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> NOTICE: Sending Filename (Destination): Device-1
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: --> Device-1
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- Device-1
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- Cryp
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- toc
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- h
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- eck
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- sum:
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Found Prompt (Colon)
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Line: Device-1
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Line: Cryptochecksum:
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Result: (0)
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Sending a return
2018/11/27 09:23:10 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: -->
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- 89c2ee4c 1f279b1d 9a6fb381 dae73eaf
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- 7240
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- by
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- tes
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- copi
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- ed
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- in 0.3
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- 10 s
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- ecs
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <--
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: <-- Device-1#
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Found Prompt (Enabled)
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Line: 89c2ee4c 1f279b1d 9a6fb381 dae73eaf
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Line: 7240 bytes copied in 0.310 secs
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Line: Device-1#
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Result: (0)
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Checking for valid incoming file at /home/configs/backups/Device-1
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Attempting to open file at /home/configs/backups/Device-1
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: checking end in config
2018/11/27 09:23:11 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: --> exit
2018/11/27 09:23:16 - RCONFIG 172.16.12.1 (SSH) -> DEBUG: Timeout of 5 seconds has been reached
2018/11/27 09:23:16 - RCONFIG NOTICE: Failed to download for Device-1
2018/11/27 09:23:16 - RCONFIG WARNING: 0 Devices Backed Up, 1 Devices Failed, 0 Disabled (ignored) in 7 seconds
2018/11/27 09:23:16 - RCONFIG DEBUG: 0 devices backed up successfully.
2018/11/27 09:23:16 - RCONFIG DEBUG: 1 devices failed to backup.
2018/11/27 09:23:16 - RCONFIG STATS: Time:6.51 Downloaded:0 Failed:1
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Routerconfig doesn't work

Post by netniV »

I'm sure there is an option that will suppress sending the exit and instead just closes the connection. I would recommend using that based on your log.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
sim
Posts: 5
Joined: Mon Nov 26, 2018 4:14 am

Re: Routerconfig doesn't work

Post by sim »

It works now. just disable "Close without exit".

Thanks for you help.
Yaseen
Posts: 2
Joined: Fri Jun 05, 2020 12:57 am

Re: Routerconfig doesn't work

Post by Yaseen »

hey ,

I am also getting the same error , its trying to search the /home/configs/backups/Test directory .
tftp server path in /etc/xinet.d/tftp is /home/configs/backups
router configs path : /home/configs/backups

[[0n2020/06/05 13:44:58 - RCONFIG (SSH) -> DEBUG: Checking for valid incoming file at /home/configs/backups/Test
2020/06/05 13:44:58 - RCONFIG (SSH) -> ERROR: Failed to find file at /home/configs/backups/Test
2020/06/05 13:44:58 - RCONFIG NOTICE: Failed to download for Test
2020/06/05 13:44:58 - RCONFIG WARNING: 0 Devices Backed Up, 1 Devices Failed, 0 Disabled (ignored) in 2 seconds
2020/06/05 13:44:58 - RCONFIG DEBUG: 0 devices backed up successfully.
2020/06/05 13:44:58 - RCONFIG DEBUG: 1 devices failed to backup.
2020/06/05 13:45:01 - RCONFIG STATS: Time:4.76 Downloaded:0 Failed:1
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Routerconfig doesn't work

Post by netniV »

Are you sure a file is actually being created there called Test? Also makes sure Test doesn't exist as as folder as that will fail it too.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
ck7
Posts: 2
Joined: Wed Nov 11, 2020 1:20 am

Re: Routerconfig doesn't work

Post by ck7 »

Yaseen wrote: Fri Jun 05, 2020 3:24 am hey ,

I am also getting the same error , its trying to search the /home/configs/backups/Test directory .
tftp server path in /etc/xinet.d/tftp is /home/configs/backups
router configs path : /home/configs/backups

[[0n2020/06/05 13:44:58 - RCONFIG (SSH) -> DEBUG: Checking for valid incoming file at /home/configs/backups/Test
2020/06/05 13:44:58 - RCONFIG (SSH) -> ERROR: Failed to find file at /home/configs/backups/Test
2020/06/05 13:44:58 - RCONFIG NOTICE: Failed to download for Test
2020/06/05 13:44:58 - RCONFIG WARNING: 0 Devices Backed Up, 1 Devices Failed, 0 Disabled (ignored) in 2 seconds
2020/06/05 13:44:58 - RCONFIG DEBUG: 0 devices backed up successfully.
2020/06/05 13:44:58 - RCONFIG DEBUG: 1 devices failed to backup.
2020/06/05 13:45:01 - RCONFIG STATS: Time:4.76 Downloaded:0 Failed:1


Please find my Router config for Cisco switch SG 300 which is working as excpected
Router config setup
===============
tftp-server : 192.168.1.20
tftp-path : /switchbackups


New Device setting
================
Enable Device : yes
IP Address: 192.168.1.24
Directory : /SW/Region-1/SW1-192.168.1.24/ (Note: its automatically it will create subdirectory inside the tftp-path : Final directory look like : /switchbackups/SW/Region-1/SW1-192.168.1.24/running-config-192.168.1.24)
schedule : Weekly
Device Type : i made my custom for SG 300 it included in below
Connection Type : SSH
Authentication Account: Your Switch Username and password ( Which is added in Authentication tab)
Other Options are by default.


Device Type:
===========

Name : Testing
Connection Type ssh
Username Prompt Username:
Password Prompt Password:
Configuration file empty
Copy TFTP copy running-config tftp://%SERVER%/%FILE%
Show Version
Confirmation Prompt confirm|to tftp:
Confirm y
Force Confirm
Check End in Config
Assume elevated
Default timeout
Default sleep time
Any Key prompt

Here my Folder Structure looks like below
------> /switchbackups (Tftp Primary Folder)
|-------->/SW/Region-1/SW1-192.168.1.24/ (Subdirectory for SW1)
|---------->SW1-192.168.1.24-2020-11-06-1801, SW1-192.168.1.24-2020-11-07-1801, SW1-192.168.1.24-2020-11-08-1801 (Running-Config file saved with timestamp Hostaname+YYYY-MM-DD-HHmm)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest