Cacti 1.2.10 Routerconfig can't backup running-config for Cisco SG300-20 Switch

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
PiChen
Posts: 5
Joined: Tue Mar 24, 2020 9:39 pm

Cacti 1.2.10 Routerconfig can't backup running-config for Cisco SG300-20 Switch

Post by PiChen »

I'm first time routerconfig, I hope someone can help me.
I create a device (Cisco SG300-20 Switch) as below:
Cacti 1.2.10 Server: IP: 192.168.1.128
routerconfigs : 1.5.2

Cisco SG300-20 Switch: IP : 192.168.1.2
------------------------------------------------------------------------------------------------
Download or backup configuration files on an Cisco SG300 switch Via CLI is pass.
switch229ec0# copy running-config tftp://192.168.1.2/running-config.txt -> Pass
switch229ec0# copy running-config scp://cisco:cisco@192.168.1.12/running-config.txt -> Pass

I don't understand that routeconfigs setting for cisco Sg300 switch on Cacti 1.2.10 server and i can't find any Cacti 1.2.xx user guide on the Cacti Website.Can you help me solve this issue?
PiChen
Posts: 5
Joined: Tue Mar 24, 2020 9:39 pm

Re: Cacti 1.2.10 Routerconfig can't backup running-config for Cisco SG300-20 Switch

Post by PiChen »

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.

[root@cacti-server routerconfigs]# php router-download.php --debug
2020/03/25 12:04:43 - RCONFIG NOTICE: Starting automatic backup
2020/03/25 12:04:43 - RCONFIG STATS: Backup now running since 2020-03-25 12:04:43
2020/03/25 12:04:43 - RCONFIG DEBUG: SQL: SELECT * FROM plugin_routerconfigs_devices WHERE enabled = 'on' AND (nextbackup <= 1585109083 OR nextbackup IS NULL)
2020/03/25 12:04:43 - RCONFIG DEBUG: Attempting download for 7F-Cisco SG300-20 Switch
2020/03/25 12:04:43 - RCONFIG DEBUG: Base64 decoded: a:3:{i:71275450;i:1340968694;s:8:"password";s:8:"(8: chars)";i:1111705155;i:756247799;}
2020/03/25 12:04:43 - RCONFIG DEBUG: Base64 decoded:
2020/03/25 12:04:43 - RCONFIG 192.168.1.2 -> DEBUG: scp has 'PHPScp'
2020/03/25 12:04:43 - RCONFIG 192.168.1.2 -> DEBUG: Attempting to use 'PHPScp'
2020/03/25 12:04:43 - RCONFIG 192.168.1.2 (SCP) -> DEBUG: Creating SCP Server: 192.168.1.2, User: cisco, Password: (8 chars), Enablepw: (Not Set), Elevated:
2020/03/25 12:04:43 - RCONFIG 192.168.1.2 (SCP) -> DEBUG: deviceType: {"promptuser":"username:","promptpass":"password:","promptconfirm":"confirm|to tftp:","copytftp":"copy start tftp","version":"show version","sleep":"125000","timeout":"1","confirm":"","forceconfirm":"","connecttype":"both","checkendinconfig":"on","elevated":""}
2020/03/25 12:04:43 - RCONFIG 192.168.1.2 (SCP) -> DEBUG: Setting timeout to 1 second(s)
2020/03/25 12:04:43 - RCONFIG 192.168.1.2 (SCP) -> DEBUG: Setting sleep time to 125000 microsecond(s)
2020/03/25 12:04:43 - RCONFIG 192.168.1.2 (SCP) -> DEBUG: PHP doesn't have the ssh2 module installed
2020/03/25 12:04:43 - RCONFIG 192.168.1.2 (SCP) -> DEBUG: Follow the installation instructions in the official manual at http://www.php.net/manual/en/ssh2.installation.php
2020/03/25 12:04:43 - RCONFIG ERROR: Failed to connect to Device '7F-Cisco SG300-20 Switch' using connection type: scp
2020/03/25 12:04:43 - RCONFIG NOTICE: Failed to download for 7F-Cisco SG300-20 Switch
2020/03/25 12:04:43 - RCONFIG WARNING: 0 Devices Backed Up, 1 Devices Failed, 0 Disabled (ignored) in 0 seconds
2020/03/25 12:04:43 - RCONFIG DEBUG: 0 devices backed up successfully.
2020/03/25 12:04:43 - RCONFIG DEBUG: 1 devices failed to backup.
2020/03/25 12:04:43 - RCONFIG STATS: Time:0.43 Downloaded:0 Failed:1
[root@cacti-server routerconfigs]#
[root@cacti-server routerconfigs]#
[root@cacti-server routerconfigs]#
PiChen
Posts: 5
Joined: Tue Mar 24, 2020 9:39 pm

Re: Cacti 1.2.10 Routerconfig can't backup running-config for Cisco SG300-20 Switch

Post by PiChen »

Setting_ Router Configs.PNG
Setting_ Router Configs.PNG (163.24 KiB) Viewed 8039 times
PiChen
Posts: 5
Joined: Tue Mar 24, 2020 9:39 pm

Re: Cacti 1.2.10 Routerconfig can't backup running-config for Cisco SG300-20 Switch

Post by PiChen »

Cacti 1.2.10 Router Configs_Device.PNG
Cacti 1.2.10 Router Configs_Device.PNG (152.51 KiB) Viewed 8039 times
PiChen
Posts: 5
Joined: Tue Mar 24, 2020 9:39 pm

Re: Cacti 1.2.10 Routerconfig can't backup running-config for Cisco SG300-20 Switch

Post by PiChen »

Cacti 1.2.10 Router Configs_Device Types.PNG
Cacti 1.2.10 Router Configs_Device Types.PNG (143.98 KiB) Viewed 8039 times
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Cacti 1.2.10 Routerconfig can't backup running-config for Cisco SG300-20 Switch

Post by netniV »

2020/03/25 12:04:43 - RCONFIG 192.168.1.2 (SCP) -> DEBUG: PHP doesn't have the ssh2 module installed
2020/03/25 12:04:43 - RCONFIG 192.168.1.2 (SCP) -> DEBUG: Follow the installation instructions in the official manual at http://www.php.net/manual/en/ssh2.installation.php
These two lines here are your friend :)
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
mrscary
Cacti User
Posts: 149
Joined: Tue Aug 26, 2014 2:58 pm

Re: Cacti 1.2.10 Routerconfig can't backup running-config for Cisco SG300-20 Switch

Post by mrscary »

i am trying this out myself for the first time.. i get this in my CLOG
04/05/2020 13:30:52 - RCONFIG 192.168.1.1 (Telnet) -> DEBUG: Found Prompt (Colon)
04/05/2020 13:30:52 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: Found Prompt (Colon)
04/05/2020 13:30:51 - RCONFIG 192.168.1.1 (Telnet) -> DEBUG: No Prompt received (7: 10 : 3)
04/05/2020 13:30:51 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: Found Prompt (Colon)
04/05/2020 13:30:51 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: No Prompt received (7: 9 : 3)
04/05/2020 13:30:51 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: Found Prompt (Colon)
04/05/2020 13:30:50 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: No Prompt received (7: 8 : 3)
04/05/2020 13:30:50 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: Found Prompt (Colon)
04/05/2020 13:30:49 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: No Prompt received (7: 7 : 3)
04/05/2020 13:30:49 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: Found Prompt (Colon)
04/05/2020 13:30:49 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: No Prompt received (7: 6 : 3)
04/05/2020 13:30:49 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: Found Prompt (Colon)
04/05/2020 13:30:48 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: No Prompt received (7: 5 : 3)
04/05/2020 13:30:48 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: Found Prompt (Colon)
04/05/2020 13:30:47 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: No Prompt received (7: 4 : 3)
04/05/2020 13:30:47 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: Found Prompt (Colon)
04/05/2020 13:30:47 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: No Prompt received (7: 3 : 3)
04/05/2020 13:30:47 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: Found Prompt (Colon)
04/05/2020 13:30:46 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: No Prompt received (7: 2 : 3)
04/05/2020 13:30:46 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: Found Prompt (Colon)
04/05/2020 13:30:46 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: No Prompt received (0: 1 : 3)
04/05/2020 13:30:46 - RCONFIG 172.16.1.1 (Telnet) -> DEBUG: Timeout of 1 seconds has been reached
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Cacti 1.2.10 Routerconfig can't backup running-config for Cisco SG300-20 Switch

Post by netniV »

You'll need to enable full connection debugging and then email me a copy of the logs so that I can see what is being interpreted.
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: Cacti 1.2.10 Routerconfig can't backup running-config for Cisco SG300-20 Switch

Post by ck7 »

PiChen wrote: Tue Mar 24, 2020 11:28 pm Cacti 1.2.10 Router Configs_Device.PNG

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 5 guests