Router Configs Plugin

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
User avatar
bkbristlin
Cacti User
Posts: 79
Joined: Fri Jan 14, 2011 3:28 pm
Location: Lincoln, NE

Router Configs Plugin

Post by bkbristlin »

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.
Brian
CCNA, MCDST, MCP, A+
JJX
Cacti User
Posts: 402
Joined: Thu Oct 06, 2005 5:03 am

Re: Router Configs Plugin

Post by JJX »

use tftp and archive command in your router ;)
cacti rulez!
User avatar
bkbristlin
Cacti User
Posts: 79
Joined: Fri Jan 14, 2011 3:28 pm
Location: Lincoln, NE

Re: Router Configs Plugin

Post by bkbristlin »

This plugin does that already. It just doesn't follow the schedule it is supposed to.
Brian
CCNA, MCDST, MCP, A+
SQYIVU
Posts: 5
Joined: Mon Jun 09, 2014 8:54 pm

Re: Router Configs Plugin

Post by SQYIVU »

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;
}
SQYIVU
Posts: 5
Joined: Mon Jun 09, 2014 8:54 pm

Re: Router Configs Plugin

Post by SQYIVU »

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
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests