Unix/Linux Go Back    


Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Script to update rsyslog.conf and auditd.conf

Shell Programming and Scripting


Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 1 Week Ago
Mide Mide is offline
Registered User
 
Join Date: May 2017
Last Activity: 24 May 2017, 1:29 AM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Unix or Linux Question Script to update rsyslog.conf and auditd.conf

Hello all,

Newbie here.

I'm currently tasked with updating rsyslog.conf and auditd.conf on a large set of servers. I know the exact logging configurations that I want to enable. I have updated both files on on a server and hope to use the updated files as a template for the rest of the servers. I reckon that a script which will :
reference the "templates"
copy/replace the existing rsyslog.conf and auditd.conf
restart rsyslog service

will suffice.However, I have not really played around with any form of scripting at least in *NIX. The set of servers are a mix of Redhat, Amazon Linux, Suse, and Ubuntu with Redhat 6 the majority. I figured that I can at least make it work on Redhat and modify as needed for the others.Can you please help me out?

Regards,

Mide.
Sponsored Links
    #2  
Old Unix and Linux 1 Week Ago
RudiC RudiC is offline Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 29 May 2017, 6:37 AM EDT
Location: Aachen, Germany
Posts: 10,830
Thanks: 272
Thanked 3,324 Times in 3,061 Posts
I definitely wouldn't bluntly copy the new files over, but first check if the original conf both for the source and the target server are identical, and if differences should persist, should they exist.
Which copy tool do you have at hand? scp?
Sponsored Links
    #3  
Old Unix and Linux 1 Week Ago
Mide Mide is offline
Registered User
 
Join Date: May 2017
Last Activity: 24 May 2017, 1:29 AM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for the reply RudiC. You are correct, it will be madness to just replace given there is a good chance there is current setting that can be broken. So, instead of just the replacing of both files, comparing and adding the updates.

We are looking to possibly leverage the script via a configuration management tool(puppet, chef) for our cloud servers also. So, I need a script that is "tool independent" and more Linux native.

Regards,

Mide.
    #4  
Old Unix and Linux 1 Week Ago
stomp stomp is online now
Registered User
 
Join Date: May 2016
Last Activity: 29 May 2017, 7:39 AM EDT
Posts: 191
Thanks: 10
Thanked 66 Times in 61 Posts
An (Automation-)Tool-independent script won't likely exist because those scripts are the main task of an automation tool. So those scripts are always tool-specific, if you want to take the advantage of using those tools.

If you do not use the specific features of your automation tool you'll effectively end up writing your own.

The normal way in Chef is to use the file or cookbookfile Resource, which simply just replaces files with fixed content or based templates, how you wish them to be and gives you possibilities to define, what is done when and if changes are made(e. g. restart special services). Pretty basic stuff. A good automation suites enables you to define your actions from a general default with use-case groups and deviations down to groups and single special cases.

Do you have an automation tool already in production? If that is so, I suggest to use it. Your automation tool should have been chosen to support all devices/servers you are running within your organization.

In general testing is badly needed for automation which only makes sense, if you have a lot of similar or identical setups. If not you have very much work with testing for every used platform.

So the first questions would be:
  • Are automation tools already used?
  • If yes, is that tool suited to your task(probably yes)?
  • If not should you decide to integrate such a tool in your organization? (Quite a different sized task)

Last edited by stomp; 1 Week Ago at 08:51 AM..
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Configure resolv.conf and nsswitch.conf flexihopper18 Solaris 0 3 Weeks Ago 03:43 AM
basic question on sd.conf and lpc.conf file mokkan Solaris 4 08-14-2009 02:29 PM
SD.conf and LPFC.conf soupbone38 Red Hat 1 07-08-2009 03:47 PM
Configuring snmpd.conf and snmptrapd.conf jagdish.machhi@ UNIX for Advanced & Expert Users 2 04-17-2008 03:01 PM
Script for turning processes in etc/inetd.conf on and off thomi39 Solaris 0 03-18-2008 10:48 PM



All times are GMT -4. The time now is 07:42 AM.