1826103 Members
4398 Online
109690 Solutions
New Discussion

Configure Syslog.conf

 
SOLVED
Go to solution
Rene Mendez_4
Super Advisor

Configure Syslog.conf

Hello my S.O is hp11i

I need configure syslog.conf for log on console if net cable is disconected.
And information to use (debug, warning, error, information, alert, etc)

Regards
RenÃ
5 REPLIES 5
Brian Bergstrand
Honored Contributor

Re: Configure Syslog.conf

Not quite sure what you are asking, but if a lan link is disconnected/bad then a message will be logged to the console. This is the default behavior.

If this isn't your issue, could you clarify your question further?

HTH
John Poff
Honored Contributor

Re: Configure Syslog.conf

Hi,

Why don't you post the contents of your /etc/syslog.conf file and we'll go from there?

JP
Rene Mendez_4
Super Advisor

Re: Configure Syslog.conf

hi

The syslog.conf configure the log in the console and the syslog.log.

If cable of net is disconnect, i need register in syslog.log and console.
How to configure this ??

/etc/syslog.conf configuration have any selector (information, warinig, error) way configure this.

Regards
Rene

Bill Hassell
Honored Contributor
Solution

Re: Configure Syslog.conf

The file that controls logging of error messages via syslog is syslog.conf and man syslogd explains the format of the file. The problem is trying to determine how the message was sent to syslog. There are several 'facilities' and levels of importance. Essentially, each message is processed based on it's facility and importance through the syslog.conf file. So if the error message was generated using a daemon facility and warning level, any of the rules that match thise 2 conditions will be logged to the destination on the right side of the syslog.conf file.

So there is no way to easily associate a particular message (ie, LAN errors, disk errors, etc) with a given facility or even an importance level. If the LAN messages only shows up in syslog and not the console, the default setting in syslog.conf is *.alert which means any facility with alert of higher messages will go to the console. If the LAN messages don't go to the console that would imply that the logging on the console is occurring at at a lower level than alert (which is the second highest). The list is (sorted highest to lowest):

crit
alert
err
warning
notice
info
debug

So if you chenge the line in syslog.conf that contains /dev/co9nsole from:

*.alert /dev/console
to
*.notice /dev/console

then most likely the message will now also go to the console. The downside is that many more messages may also go to the console too. You can turn on the logging of facility and level information in syslog by changing /etc/rc.config.d/syslogd to start syslog with -v as in:

SYSLOGD_OPTS="-v"

and then restart syslogd using the start/stop script:

/sbin/init.d/syslogd stop
/sbin/init.d/syslogd start

Now you'll have the code for each message logged in syslog.log (see the man page for syslog for the numbers)


Bill Hassell, sysadmin
T G Manikandan
Honored Contributor

Re: Configure Syslog.conf

Net cable getting disconnected is a alert and if you have

*.alert /dev/console

in /etc/syslog.conf

file that should bring the link down messages on the console

Revert