routerconfigs automatic backup not running?

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

SQYIVU
Posts: 5
Joined: Mon Jun 09, 2014 8:54 pm

Re: routerconfigs automatic backup not running?

Post by SQYIVU »

mysql> update settings set value=0 where name='plugin_routerconfigs_running';


ERROR 1046 (3D000): No database selected

PLEASE HELP!
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: routerconfigs automatic backup not running?

Post by cigamit »

If you are running mysql queries via the command line, you need to tell it what database to use
http://bit.ly/1iqM0X7
Viperbmw69
Posts: 2
Joined: Wed Dec 23, 2015 11:58 am

Re: routerconfigs automatic backup not running?

Post by Viperbmw69 »

kmtasc wrote:Based on grady's analysis, I think the problem maybe in /var/www/html/plugins/routerconfigs/router-download.php

Information of my cacti system:
Cacti Version 0.8.8a
Routerconfigs 0.3

I modified router-download.php

Code: Select all

root@localhost routerconfigs]# diff -u router-download.php router-download.php.old 
--- router-download.php 2012-09-25 14:45:45.000000000 +0800
+++ router-download.php.old     2012-09-24 15:06:59.000000000 +0800
@@ -45,7 +45,7 @@
 db_execute("REPLACE INTO settings (name, value) VALUES ('plugin_routerconfigs_running', 1)");
 
 $t = $stime = time();
-$devices = db_fetch_assoc("SELECT * FROM plugin_routerconfigs_devices WHERE enabled = 'on' AND ($t - (schedule * 86400)) + 3600 > lastbackup");
+$devices = db_fetch_assoc("SELECT * FROM plugin_routerconfigs_devices WHERE enabled = 'on' AND ($t - (schedule * 86400)) - 3600 > lastbackup");
 $failed = array();
 if (!empty($devices)) {
        foreach ($devices as $device) {
@@ -62,7 +62,6 @@
                sleep(10);
        }
 } else {
-        db_execute("REPLACE INTO settings (name, value) VALUES ('plugin_routerconfigs_running', 0)");
        return;
 }
 $success = count($devices) - count($failed);
[root@localhost routerconfigs]# 

Code: Select all

mysql> update settings set value=0 where name='plugin_routerconfigs_running';
It works well in my test system.

Can you please post the complete router-download.php?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests