/etc/syslog.conf file and warnings


 
Thread Tools Search this Thread
Operating Systems AIX /etc/syslog.conf file and warnings
# 1  
Old 06-30-2008
/etc/syslog.conf file and warnings

Hi All,

I am working on a server which has an /etc/syslog.conf file with the following entries (example):

local6.debug /dplogs/uss1udp001.log rotate size 1500m time 1d files 14
local7.debug /dplogs/uss1udp002.log rotate size 1500m time 1d files 14

-----------------------------
Basically this config file is taking system messages from Tivoli, which are at the 'debug' level, and sending them to logfiles in the /dplogs directory.
It rotates 14 of them based on 1 day or 1500m size.

This is all well and good. However, what I need to do is execute a UNIX script every time an entry gets dropped into one of these files.

Does anyone know a way that you can use /etc/syslog.conf to, instead of dropping the message into a directory, execute a file instead?

The entry would be something like (in this example)

local6.debug /dplogs/runit # every time a debug entry, kick off script, no matter when


Possible? Anyone done something like this before. Thanks much for any advice.

jeffpas
# 2  
Old 06-30-2008
Smilie

The only thing I can think of to do is run the script via crontab, every minute of every day, such as this:

* * * * * /usr/bin/myscript

But this project manager wants the script to run 'realtime', meaning every time a log message writes from syslogd.

There does not seem to be any way to trigger a script to run through syslogd..........
# 3  
Old 06-30-2008
I have not tried this, it is not tested, but an idea you could pursue:

syslogd can send messages either to a file (this is the common case), to another host or to a users terminal. For instance: to send all mail and daemon messages of priority crit and above to user xxx enter the following line into /etc/syslog.conf:

Code:
mail,daemon.crit xxx

You could probably create an user account, have it run some script which waits for terminal input and does something according to the sort of input it receives. The create an entry in /etc/syslog.conf to have this user receive all the messages you want to track.

i don't know if you could specify several destinations so maybe your script will have to do the log writing syslog normally does by itself.

In any case i would be intereseted to hear your solution.

bakunin
# 4  
Old 07-14-2008
bakunin,

This appears to be a question that will never die.

I have since found a way (by creating a daemon that checks the logfile for any changes, every 20 seconds or so) to rig a solution, but everyone involved in the project keeps bringing up this trigger mechanism again and again.
It seems they are determined that I do it that way.

All I can say is one of the techs played around with this briefly and suggested creating a fifo pipe file. This is something I have never done, or been told to do, in about a decade and a half of UNIXing. Sorry, it just has never come up.

Apparently it works something like this:

#!/usr/bin/sh
exec 0 < log_pipe #log_pipe is a pipe made using the mkfifo cmd
while :
do
while read LINE
sleep 1
done


The only thing I can possibly understand about a fifo file is that it simply sits with the contents of one action and waits for another, such as:

ls | pg

you can mkfifo pipe_listing then:

ls > pipe_listing

then pg < pipe_listing sometime later.

Any of this make any sense?

Everyone says that they can't understand why I am not going htis route, but no one can say how................can't figure it out for anything................

SmilieSmilieSmilieSmilieSmilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Which are the available entries to forward syslog in syslog.conf?

Hi Community Which are the available entries to forward syslog in syslog.conf i have put *.err;kern.debug;daemon.notice;mail.crit;user.alert;user.emerg;kern.notice;auth.notice;kern.warning @172.16.200.50 and it's not going through.giving error message like below: syslogd:... (2 Replies)
Discussion started by: bentech4u
2 Replies

2. Red Hat

Configuring syslog.conf

Hi, I would like to configure syslog linux client, syslog server is windows server. so adding on linux client in /etc/syslog.conf @hostname will work in the place of directory location. example of /etc/syslog.conf # Log all kernel messages to the console. # Logging much else clutters up... (2 Replies)
Discussion started by: manoj.solaris
2 Replies

3. Shell Programming and Scripting

syslog.conf

How can i configure messages with warn priority to be logged in /var/log/mywarnings.log ? (1 Reply)
Discussion started by: g0dlik3
1 Replies

4. Shell Programming and Scripting

how to parse /etc/syslog.conf file

Hello there, Guys I've got an issue and I need a hint...I have to parse /etc/syslog.conf file (under solaris) and need to get all path accordingly to all logs configured in there. Bellow it's my syslog.conf file. If anybody knows more about this please let me know. Thanks . #ident ... (2 Replies)
Discussion started by: catalint
2 Replies

5. UNIX for Dummies Questions & Answers

Solaris 10 question on syslog.conf file

Hi, I have a question on /etc/syslog.conf file in Solaris 10. Below is a line taken from /etc/syslog.conf file and I know that the last field (operator) is where the logs gets outputted but how do I find out what the output file name format is going to be and which directory it gets outputted... (1 Reply)
Discussion started by: stevefox
1 Replies

6. 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

7. Shell Programming and Scripting

prevent errors/warnings from being written to log file

i have this script which works fine but shows errors when it runs..these are more like warnings and the script runs fine.. i am on a sun machine.. i know it writes all the error messages to a master log file.. is there any way i can turn off these warnings/error messages and prevent them from being... (2 Replies)
Discussion started by: npatwardhan
2 Replies

8. Solaris

syslog-ng.conf

Has anyone here configured a central syslog server using syslog-ng ? I have set one up and I'm trying to tune the syslog-ng.conf file, both for the server and the client. I have found lots of linux example files, but not much on Solaris which is slightly different. So if you have a Solaris... (5 Replies)
Discussion started by: Tornado
5 Replies

9. Red Hat

syslog.conf

Hi all I have a RedHat Linux AS2.1 server that keep crashing/rebooting and there are no messages in the /var/log/messages file pointing to any problems. I had a look at the /etc/syslog.conf file to see what gets logged to /var/log/messages, but I don't know what else to add. Can anyone tell me... (1 Reply)
Discussion started by: soliberus
1 Replies

10. UNIX for Dummies Questions & Answers

syslog.conf file and syslogd daemon

Hello, I need a few information/explanation about system messages, syslog.conf file and syslogd daemon. My problem is the following: I would like to log all system messages related to hardware problems into a particular file. For that, i have to add an entry in the syslog.conf file. I know... (1 Reply)
Discussion started by: VeroL
1 Replies
Login or Register to Ask a Question