Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sat Jun 15, 2019 9:46 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Router Config - Devices not Showing
PostPosted: Fri May 03, 2019 10:46 am 
Offline

Joined: Fri May 03, 2019 10:39 am
Posts: 3
Hello All!

I am new to Cacti and it's plugins. I have been working on installing Cacti on CentOS7.6 and have got a working version of Cacti on 1.2.2. I am now trying to get Router Configs working and automatic backups of our devices. I have installed Router Configs plugin version 1.5.0.

I have TFTP configured and working where I can manually TFTP a configuration from the Switch to the Cacti host and it saves the backups in the folder that Cacti is configured to look at for Router Configs.

My problem is when getting the devices to show in the Router Config Utility itself at this point. I have tried adding devices into Router Configs. When i Go to Utilities -> Router Configs and devices I do not see any devices. I have added 6 devices manually, and i see at the top where it says "All 6 Devices", however no devices are actually shown so I can't select one to do a "Backup" or any action against. Has anyone seen this before or have any ideas on how to troubleshoot this?

I noticed the error messages below:

2019/05/03 12:17:13 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/routerconfigs/router-devices.php[66]:show_devices(), /plugins/routerconfigs/router-devices.php[728]:CactiErrorHandler())

2019/05/03 12:17:13 - ERROR PHP WARNING in Plugin 'routerconfigs': Invalid argument supplied for foreach() in file: /usr/share/cacti/plugins/routerconfigs/router-devices.php on line: 728

Below is the foreach statement that it is referencing in the error message:

foreach ($result as $row) {
form_alternate_row('line' . $row['id'], false);

$total = db_fetch_cell_prepared('SELECT count(device)
FROM plugin_routerconfigs_backups
WHERE device = ?',
array($row['id']));

$state = $date_array[''];
if ($row['lastbackup'] > 0) {
$do_backup = new DateTime();
$do_backup->setTimestamp($row['lastbackup']);
$date_backup = $do_backup->format('Y-m-d H:i:s');

foreach ($date_array as $date_value=>$date_state) {
if ($date_backup >= $date_value) {
$state = $date_state;
break;
}
}
}


Top
 Profile  
 
 Post subject: Re: Router Config - Devices not Showing
PostPosted: Fri May 03, 2019 1:40 pm 
Offline

Joined: Fri May 03, 2019 10:39 am
Posts: 3
So I saw that this was bug 104 for the version 1.5.0 of Router Configs. I updated to 1.5.1 and this was resolved. I ended up finding some other issues though. I had to install SSH2 library for PHP and got past that.

I now have a new issue and am trying to get through, errors below:

2019/05/03 14:29:03 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/routerconfigs/router-backups.php[28]:include(), /include/auth.php[28]:require_once(), /include/global.php[466]:include_once(), /include/vendor/csrf/csrf-magic.php[426]:csrf_check(), /include/vendor/csrf/csrf-magic.php[207]:csrf_error_callback(), /include/global.php[462]:CactiErrorHandler())
2019/05/03 14:29:03 - ERROR PHP NOTICE: Undefined index: REQUEST_URI in file: /usr/share/cacti/include/global.php on line: 462
2019/05/03 14:28:57 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/routerconfigs/router-backups.php[28]:include(), /include/auth.php[28]:require_once(), /include/global.php[466]:include_once(), /include/vendor/csrf/csrf-magic.php[426]:csrf_check(), /include/vendor/csrf/csrf-magic.php[207]:csrf_error_callback(), /include/global.php[462]:CactiErrorHandler())
2019/05/03 14:28:57 - ERROR PHP NOTICE: Undefined index: REQUEST_URI in file: /usr/share/cacti/include/global.php on line: 462
2019/05/03 14:27:22 - RCONFIG 172.16.8.1 (SSH) -> ERROR: Failed to find file at /home/configs/backups/Core_Test
2019/05/03 14:27:22 - RCONFIG ERROR: Failed to download 'Core_Test' to '/home/configs/backups/Core_Test' via 'ssh'
2019/05/03 14:23:23 - CMDPHP ERROR: A DB Cell Failed!, Error: Unknown column 'title' in 'where clause'


Top
 Profile  
 
 Post subject: Re: Router Config - Devices not Showing
PostPosted: Fri May 17, 2019 3:40 pm 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2499
The error regarding REQUEST_URI is coming from the csrf protection code in the core. That would normally only happen if you are running a web-based php file at the command line incorrectly. How where you running the backup which caused those errors to appear?

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
 Post subject: Re: Router Config - Devices not Showing
PostPosted: Fri May 17, 2019 3:56 pm 
Offline

Joined: Fri May 03, 2019 10:39 am
Posts: 3
Thanks for your reply! I am not sure what has changed since the time I opened this post and what I have done to change the results.

But now when I run:

php /usr/share/cacti/plugins/routerconfigs/router-download.php I get the below:

RCONFIG ERROR: Failed to remove pre-existing incoming file: /home/configs/backups/SWITCHNAME

I can TFTP a config to the and it is successful. However it is saving it in /proc/####/task/####/cwd/.

But in the /etc/xinetd.d/ in the tftp file i have set the path to /home/configs/backups.


Top
 Profile  
 
 Post subject: Re: Router Config - Devices not Showing
PostPosted: Fri May 17, 2019 4:35 pm 
Offline
Cacti Guru User

Joined: Sun Aug 27, 2017 12:05 am
Posts: 2499
You have a permission problem because RC is trying to remove the old config, but cant hence the message.

_________________
Official Cacti Developer

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation

My resources:
How to submit Pull Requests
Development Wiki and How To's
Updated NetSNMP Memory template for Cacti 1.x
Cisco SFP template for Cacti 0.8.8


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group