Sponsored Content
Top Forums Shell Programming and Scripting Issue with Bash Audit Command Logger script | Need help to debug this Post 303045625 by Peasant on Saturday 4th of April 2020 08:17:17 AM
Old 04-04-2020
How about using built-in audit systems in Linux and Solaris system ?
Writing scripts can only poorly emulate proper audit system, with easy circumvention.

History file is not audit and can easily be falsified or bypassed completely.

Hope that helps
Regards
Peasant.
This User Gave Thanks to Peasant For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Logger Command

Hi I have a command in a script . /usr/bin/iostat -E I would like to place an entry in /var/adm/messages (via syslog) as a daemon.notice using the logger command but i just cant work out the syntax for this , do I pipe the output of iostat into logger? or is it redirected...can somebody give me... (1 Reply)
Discussion started by: hcclnoodles
1 Replies

2. UNIX for Advanced & Expert Users

Q on <user> of syslog message generated by logger command

Generally(at least on AIX5.3, Solaris9, OS X)'logger' command would create syslog messages which carry <login name> . On Solaris9, I have experienced two circumstances in which 'logname' command fails. In this circumstance I saw the 'logger' command generated syslog messages which carry... (0 Replies)
Discussion started by: masaki
0 Replies

3. Shell Programming and Scripting

Bash script: issue changing directories in script

I am working on a script that checks two arguments at the command line. The first argument is a search pattern, the second can be a file or a directory, if it is a file a second script is called that checks it for the search pattern. If the second argument is a directory, it checks for the search... (5 Replies)
Discussion started by: Breakology
5 Replies

4. AIX

Aix 5.3 Audit issue - not orking properly

Hello Friends, I had enabled the audit and configured for sysadmin user alone in audit config file. but the audit starts logging for root user alone. Attached the conf file. I want the aduit to record only for sysadmin activities.. need your expertise and help in solving the issue. (1 Reply)
Discussion started by: kmvinay
1 Replies

5. Shell Programming and Scripting

login audit bash script

I am a bash beginner and I need to write an script to check my users login time. This has to be in a format of : This script has to work on a server to check all the users. I know that I have to use "last" command but I have no idea how to do it. any assistance is appreciated. Thanks (17 Replies)
Discussion started by: bashily
17 Replies

6. Shell Programming and Scripting

syntax issue with quotes in mysql command for a bash script

i'm trying to write a bash script that executes a mysql statement mysql -sN -e INSERT INTO "$database"."$tableprefix"users (var1, var2,var3) VALUES (123, '1','') i don't know where to put the quotes it doesnt work with this one: ` it seems i can only put double quotes around the... (0 Replies)
Discussion started by: vanessafan99
0 Replies

7. Shell Programming and Scripting

syntax issue mysql in bash script

I'm running mysql in a bash script mysql <<EOF query EOF one query is like this: UPDATE $dbname.$prefix"config" SET value = $var WHERE "$prefix"config.name = 'table colname'; with variable but it's giving an error i'm not sure what to put for "$prefix"config.name the table... (3 Replies)
Discussion started by: vanessafan99
3 Replies

8. Shell Programming and Scripting

bash ls command file issue

ls -l /md01/EL/MarketData/inbound/ststr/INVENTORY* |tail -5 |awk '{ print $5,$6,$7,$8,$9 }'If I run the above from the command line the output to md_email is formatted correctly as 78213497 May 1 12:50 /md01/EL/MarketData/inbound/ststr/INVENTORY.20120430.PINESTREET.CSV.done 77904740 May 2... (3 Replies)
Discussion started by: smenago
3 Replies

9. Shell Programming and Scripting

Piping the "script" command through the logger command.

I use the snippet below in /etc/profile on RHEL Linux to capture command line logging and it all works well and good. Now I'd like to pipe the same output from script through the logger command so it all gets logged to syslog. The only additional code I've added is in bold below (|... (4 Replies)
Discussion started by: woodson2
4 Replies

10. Shell Programming and Scripting

Logger command not working for one script

Hi, On RHEL 7.2, I created below script in cronjob for every minute. If this process is found to be not running, it should record message in /var/adm/xymessages, start it and send email. #!/bin/bash source /export/home/prodadm/.bash_profile if ; then ... (8 Replies)
Discussion started by: ron323232
8 Replies
Logger::Syslog(3pm)					User Contributed Perl Documentation				       Logger::Syslog(3pm)

NAME
Logger::Syslog -- an intuitive wrapper over Syslog for Perl DESCRIPTION
You want to deal with syslog, but you don't want to bother with Sys::Syslog, that module is for you. Logger::Syslog takes care of everything regarding the Syslog communication, all you have to do is to use the function you need to send a message to syslog. Logger::Syslog provides one function per Syslog message level: debug, info, warning, error, notice, critic, alert. NOTES
Logger::Syslog is compliant with mod_perl, all you have to do when using it in such an environement is to call logger_init() at the beginning of your CGI, that will garantee that everything will run smoothly (otherwise, issues with the syslog socket can happen in mod_perl env). SYNOPSIS
use Logger::Syslog; info("Starting at ".localtime()); ... if ($error) { error("An error occured!"); exit 1; } ... notice("There something to notify"); FUNCTIONS
logger_init Call this to explicitly open a Syslog socket. You can optionaly specify a Syslog facility. That function is called when you use the module, if you're not in a mod_perl environement. Examples: # open a syslog socket with default facility (user) logger_init(); # open a syslog socket on the 'local' facility logger_init('local'); logger_close Call this to close the Syslog socket. That function is called automatically when the calling program exits. logger_prefix That function lets you set a string that will be prefixed to every messages sent to syslog. Example: logger_prefix("my program"); info("starting"); ... info("stopping"); logger_set_default_facility(facility) You can choose which facility to use, the default one is "user". Use that function if you want to switch smoothly from a facility to another. That function will close the existing socket and will open a new one with the appropriate facility. Example: logger_set_default_facility("cron"); LOGGING
Logger::Syslog provides one function per Syslog level to let you send messages. If you want to send a debug message, just use debug(), for a warning, use warning() and so on... All those function have the same signature : thay take a string as their only argument, which is the message to send to syslog. Examples: debug("my program starts at ".localtime()); ... warning("some strange stuff occured"); ... error("should not go there !"); ... notice("Here is my notice"); LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. COPYRIGHT
This program is copyright X 2004-2006 Alexis Sukrieh AUTHOR
Alexis Sukrieh <sukria@sukria.net> Very first versions were made at Cegetel (2004-2005) ; Thomas Parmelan gave a hand for the mod_perl support. perl v5.12.4 2006-11-27 Logger::Syslog(3pm)
All times are GMT -4. The time now is 10:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy