LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 08-25-2018, 06:56 PM   #1
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162
Monitoring changes in configuration backup files


What is an appropriate tool?

At work I have to start monitoring dozens of embedded devices. I need to discern changes in daily configuration backups. The backup files are text files.

Basically I want to create a change log for each device.

I want to automate the monitoring and send differences in daily email reports. I am monitoring only meaningful changes in the backup files. The backup files will be stored on a traditional Linux server.

I am not monitoring changes in a single file but differences between files.

Fundamentally all I need is a diff of changes. I can script that myself using the diff command, but do other tools exist and I am reinventing the wheel?

Other Thoughts

If version or revision control is a candidate, I do not need to track metadata, merges, commit messages, branches, etc.

The backup filenames contain the date and time. Thus each backup file does not overwrite any previous backup.

The date and time also are part of the backup file content. Technically then, each file is different although the configuration might not have otherwise changed. Ideally I do not want to be notified if that is the only difference and do not want anything added to the automated change log.

This thread is related to a previous post, but I thought best to start a new thread rather than continue the older thread.

Thanks again.
 
Old 08-25-2018, 07:16 PM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
(r)syslog
and/or
Monitor System Logs with Logwatch
 
Old 08-25-2018, 10:01 PM   #3
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162
I probably skipped school on that day. Possibly I am missing the big picture, but I want to monitor differences between two downloaded files, not monitor logs.
 
Old 08-26-2018, 01:22 AM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,745

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
diff, yes. And yes, you'll probably need to do some scripting to fine-tune what you want to see.
 
Old 08-26-2018, 10:35 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by upnort View Post
I probably skipped school on that day.
That's OK, google was in attendance!
How To Compare Two Text Files Using Linux
 
Old 08-26-2018, 11:15 AM   #6
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162
Quote:
That's OK, google was in attendance!
OK, I'm still not the brightest bulb in the pack, but in my original post I wrote:

I can script that myself using the diff command, but do other tools exist and I am reinventing the wheel?

I thought with that sentence I was declaring I knew how to use the diff command and I could build a script wrapper to diff to compare the files. I am looking for something more broader.

I might have discovered something close: Oxidized, RANCID, rConfig, Unimus.

Looks like Oxidized and RANCID are free/libre. rConfig seems built only for CentOS, and Unimus looks commercial/proprietary. The lead developer with Oxidized is looking for maintainer help, which does not bode well for the future. RANCID requires the expect command, which seems a tad clunky to me (been there done that). Unimus does not seem to support a wide variety of devices yet. Overall, these tools seem somewhat complicated for just downloading and comparing two files.

I found something called cbackup, but after browsing the docs I did not feel warm and fuzzy.

I'll need to dig deeper.
 
Old 08-26-2018, 11:59 AM   #7
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,157

Rep: Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266
You could use git to track changes, take snapshots of specific configurations, and compare differences or deploy specific configurations.
 
Old 09-04-2018, 11:44 AM   #8
ccj4467
Member
 
Registered: Jan 2009
Posts: 38

Rep: Reputation: 6
If you are talking about config files in /etc there is a tool called etckeeper.

https://etckeeper.branchable.com/
 
Old 09-04-2018, 12:18 PM   #9
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
this reminds me of a failed (!) undertaking of mine:
http://dt.iki.fi/dotfiles
 
Old 09-04-2018, 01:23 PM   #10
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Why not simplify and just use rsync on /etc/* ???
 
Old 09-04-2018, 02:36 PM   #11
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162
Quote:
If you are talking about config files in /etc there is a tool called etckeeper.
Quote:
Why not simplify and just use rsync on /etc/* ???
These are embedded devices. They do not have a traditional FHS tree. Think routers, APs, and the like.

As these are text file dumps, the best I have at the moment is grabbing the most recent two backup files and diff them. Doable but I'm wondering if there are tools that already cater to that kind of monitoring. I found something called graylog, but have not dug deep into that.

Not related but I am using etckeeper on my personal systems.
 
Old 09-05-2018, 12:37 AM   #12
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,351
Blog Entries: 3

Rep: Reputation: 3766Reputation: 3766Reputation: 3766Reputation: 3766Reputation: 3766Reputation: 3766Reputation: 3766Reputation: 3766Reputation: 3766Reputation: 3766Reputation: 3766
smallpond suggested a version control system, specifically git, but if you are more familiar with CVS, SVN, or BZR those would work too. Their very reason for existence is to track changes to text files. Configuration files certainly fit that bill at least until some future version of systemd does them in by making them binary. A way to do tracking would be to keep a central repository where they are all stored. The question would be whether to check out / in the files directly to / from the embedded systems or not. I guess that would depend on the complexity of the systems. You could just as well check in and out from a staging machine instead. I've done something similar with CVS back in the day for a server farm of development servers, checking in and out on the servers themselves using CVS, but would probably use git if I were to try that nowadays.

Last edited by Turbocapitalist; 09-05-2018 at 12:38 AM.
 
Old 09-05-2018, 12:37 PM   #13
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Original Poster
Rep: Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162Reputation: 1162
Okay -- version control system (VCS). I am not familiar with implementing at all. ELI5 please.

For example, on our remote logging server I pull the backup file from an embedded device into something I suppose would be called a holding or staging directory? Then perform some kind of commit to the VCS? Then what?

My goal with these backups is not only quick recovery with a rebuild/replacement. I want to monitor changes. First for hackers and second for in-house changes that were not correctly logged.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to backup of all linux configuration files at once linux.cnf Linux - Server 2 05-21-2018 01:53 PM
[SOLVED] How to use the Backup Tool to backup only files that have been modified, remove deleted and added files scottm7 Linux - Newbie 3 04-17-2017 11:07 AM
LXer: Use Git to take Backup of Configuration files on Linux LXer Syndicated Linux News 0 11-03-2015 08:31 AM
Monitoring Windows Backup with Nagios Penhexy Linux - Software 3 03-01-2012 09:29 PM
rsync backup monitoring tsaravan Linux - Newbie 3 02-15-2008 03:31 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 05:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration