Anyone ever had this now follow its schedule and know where I can look?
I have 7 routers setup to be backed up once a week. This never happens. I can do it manual (click check box and select backup) which works fine.
Tried changing one to a daily schedule and it still didn't work. Not sure what else I can do.
Router Configs Plugin
Moderators: Developers, Moderators
- bkbristlin
- Cacti User
- Posts: 79
- Joined: Fri Jan 14, 2011 3:28 pm
- Location: Lincoln, NE
Router Configs Plugin
Brian
CCNA, MCDST, MCP, A+
CCNA, MCDST, MCP, A+
- bkbristlin
- Cacti User
- Posts: 79
- Joined: Fri Jan 14, 2011 3:28 pm
- Location: Lincoln, NE
Re: Router Configs Plugin
This plugin does that already. It just doesn't follow the schedule it is supposed to.
Brian
CCNA, MCDST, MCP, A+
CCNA, MCDST, MCP, A+
Re: Router Configs Plugin
The file in question is the router-download.php, in a return line 66 found himself inside a else as well
If (! Empty ($devices)) {
.
.
.
} else {
Return;
}
To solve the problem the else should be the other way
} else {
DB _ execute ("replace into settings (name, value) values ('plugin _ routerconfigs _ running', 0));
Return;
}
If (! Empty ($devices)) {
.
.
.
} else {
Return;
}
To solve the problem the else should be the other way
} else {
DB _ execute ("replace into settings (name, value) values ('plugin _ routerconfigs _ running', 0));
Return;
}
Re: Router Configs Plugin
1、 modified router-download.php
Code:
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);
2、mysql> use cacti;
mysql> update settings set value=0 where name='plugin_routerconfigs_running';
I have tested,it's ok
Code:
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);
2、mysql> use cacti;
mysql> update settings set value=0 where name='plugin_routerconfigs_running';
I have tested,it's ok
Who is online
Users browsing this forum: No registered users and 2 guests