Router Configs backup how many time for week?

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
apereira
Posts: 22
Joined: Mon Sep 29, 2008 9:58 am

Router Configs backup how many time for week?

Post by apereira »

Hello,
I have installed the RouterConfigs, but I force a back 11th of the last week... now I've checked and still have the same backup, the RouterConfigs dont made none backup automaticly.

What I need to configure to run the backups 1 time for day? Like all days at 00 hours?

If is a crontab configuration, what is the command line to backup all actives devices?


Thanks,
Anderson.
jailander1982
Posts: 3
Joined: Fri Jun 10, 2011 5:40 am

Re: Router Configs backup how many time for week?

Post by jailander1982 »

Has anyone managed to run routerconfigs plugin automatically?
I am stuck on this problem and I havent seen any answer... When I force a backup manually, I get the plugin running properly, but never automatically. Should I configure something manually in the cron? (like php /cacti/plugins/routerconfigs/router-download.php ???)

Thanks in advance!
hid3
Cacti User
Posts: 63
Joined: Sat Jun 14, 2008 1:59 am

Re: Router Configs backup how many time for week?

Post by hid3 »

Anyone ever figured out that? No automatic backups.

It would be nice if I could run the backuping script automatically, either a) on scheduled time, say nightly; or b) each time a configuration change is detected.


Thanks!
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Router Configs backup how many time for week?

Post by noname »

hid3
Cacti User
Posts: 63
Joined: Sat Jun 14, 2008 1:59 am

Re: Router Configs backup how many time for week?

Post by hid3 »

Thanks, this solved the problem. However, it still seems that it's something wrong with the plugin itself. It doesn't make any entries in log file; neither cacti.log nor syslog. (I checked both but I use cacti.log).
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Router Configs backup how many time for week?

Post by noname »

It seems the recording status during scheduled backup is dependent on Cacti's logging level.
See 'Settings -> Poller Logging Level'.
hid3
Cacti User
Posts: 63
Joined: Sat Jun 14, 2008 1:59 am

Re: Router Configs backup how many time for week?

Post by hid3 »

My logging level is set to LOW - Statistics and Errors. I dunno why but I still expected it to save at least a few information lines about the plugin.

However, it seems that running the update command mentioned in another thread corrects the problem only once:

Code: Select all

UPDATE `settings` SET `value` = 0 WHERE `name` = 'plugin_routerconfigs_running';
After RouterConfigs makes one backup cycle the plugin_routerconfigs_running value stays at '1' and I need to manuallu update the MySQL again. Any ideas about how to set the value back to 0 after backups were made so it will make the 2nd, 3rd, ... Nth backup again?

Thanks!
TikPov
Posts: 3
Joined: Fri Jul 22, 2011 6:31 am

Re: Router Configs backup how many time for week?

Post by TikPov »

Does anyone found solution for problem of not running automatically jet?
acleech
Posts: 6
Joined: Thu Sep 20, 2007 10:09 am
Location: San Angelo, TX

Re: Router Configs backup how many time for week?

Post by acleech »

We too are experiencing a problem with the automatic backups. The plugin_routerconfigs_running keeps getting set to 1 and once that gets stuck, no more backups will occur. I found the bug and fix at http://209.189.228.151/bugs/print_bug_p ... bug_id=137 - I implemented the change and have to wait until tomorrow to see if it fixes the issue.

I found the original post on the guy's blog at http://abdulet.net/?p=140. I had to translate it to English to figure out what it was talking about - but it makes sense and I'm hoping this resolves the issue once and for all.
Cacti Version - 1.2.6
Poller Type - SPINE 1.2.6
Server Info - CentOS7
Database - MariaDB 10.3.17
Web Server - Apache 2.4.6
SNMP - NET-SNMP 5.7.2
RRDTool - Version 1.4.8
PHP - 7.3.9
SQYIVU
Posts: 5
Joined: Mon Jun 09, 2014 8:54 pm

Re: Router Configs backup how many time for week?

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 backup how many time for week?

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