Script to update rsyslog.conf and auditd.conf


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to update rsyslog.conf and auditd.conf
# 1  
Old 05-18-2017
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.
# 2  
Old 05-19-2017
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?
# 3  
Old 05-19-2017
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 05-19-2017
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; 05-19-2017 at 09:51 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

Configure resolv.conf and nsswitch.conf

Hi, I've installed Solaris 11.3(live media) and configured DNS. Everytime I reboot the server, resolv.conf got deleted and it created a new nsswitch.conf. I used below to configure both settings: # svccfg -s dns/client svc:/network/dns/client> setprop config/nameserver = (xx.xx.xx.aa... (1 Reply)
Discussion started by: flexihopper18
1 Replies

2. Shell Programming and Scripting

Shell Script to check dhcp conf file

Hi, I have to prepare a script to check the dhcp conf file. The script has to check for a specific parameter called circuit ID. If the Circuit ID is unique it should show the output that it is unique and if it is duplicate it should show that the Circuit ID is duplicate. I have prepared the... (4 Replies)
Discussion started by: Crazy_Nix
4 Replies

3. Shell Programming and Scripting

Change values in .conf file with a script

This is my first time posting here...so be gentle. Suppose I have a test.conf file that contains a value such as a IP. I would like to be able to use the Dialog Utility in Linux to allow me to enter the new IP in a Dialog form...and the results get saved into the test.conf file in the place... (4 Replies)
Discussion started by: calahanp
4 Replies

4. Solaris

basic question on sd.conf and lpc.conf file

Hello Guys, Do we need to configure this file only if we add SAN disk or even if we add local disk, do we need to modify? (4 Replies)
Discussion started by: mokkan
4 Replies

5. Red Hat

SD.conf and LPFC.conf

What would be Redhat RHEL 4.0 equivalent for Solaris sd.conf and lpfc.conf? What are the files called and where are the files located? (1 Reply)
Discussion started by: soupbone38
1 Replies

6. UNIX for Advanced & Expert Users

Configuring snmpd.conf and snmptrapd.conf

HI, I want a help for Configuring snmpd.conf and snmptrapd.conf (i.e Configuring SNMP) for receiving TRAPS in my networks. I am using RHEL4.0 OS. Please tell me How I can configure above two files in a proper way and at an advanced level. Especially I am getting... (2 Replies)
Discussion started by: jagdish.machhi@
2 Replies

7. Solaris

Script for turning processes in etc/inetd.conf on and off

Anyone have a perl script that can be run via a web browser to turn ftp or telnet on and off in etc/inetd.conf ? Believe it or not but I ride a motorcycle a lot in the summer and carry a laptop in my saddlebags to connect from almost anywhere via Verizon alongside the highway. However, have too... (0 Replies)
Discussion started by: thomi39
0 Replies

8. Shell Programming and Scripting

Shell/Perl Script to edit dhcpd.conf

Hi, I need to get a script together to edit the dhcp service configuration file dhcpd.conf. Mac addresses are defined in classes ex. class "HOST1" { match if substring (hardware, 1,18)=00:11:11:FF:FF:FF;} class "HOST2" ... class "HOST3" ... ... followed by allow or deny statements:... (4 Replies)
Discussion started by: sahilb
4 Replies
Login or Register to Ask a Question