1

Using CentOS 6.4.

Problem is - that messages from kern.* facility doesn't appear on other server.

Tring to send data:

# logger -p kern.warning -t TEST "Test warning for remote host KERNEL"
# logger -p cron.warning -t TEST "Test warning for remote host CRON"
# logger -p mail.warning -t TEST "Test warning for remote host MAIL"

Checking MySQL data:

mysql> select ID,Message from SystemEvents order by ID desc limit 3;
+--------+------------------------------------+
| ID     | Message                            |
+--------+------------------------------------+
| 524007 |  Test warning for remote host MAIL |
| 524006 |  Test warning for remote host CRON |
| 524005 |  Test warning for remote host MAIL |
+--------+------------------------------------+
3 rows in set (0.00 sec)

There is no data from kern facility. Why?

Config on host-recipient:

# cat /etc/rsyslog.conf | egrep -v '^[[:space:]]*$|#'
$ModLoad imudp
$UDPServerRun 514
$ModLoad imtcp
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$IncludeConfig /etc/rsyslog.d/*.conf
kern.*                                                 /var/log/kern.log
syslog.*                                                /var/log/syslog.log
*.info;mail.none;authpriv.none;cron.none;local0.none                /var/log/messages
authpriv.*                                              /var/log/secure
mail.*                                                  -/var/log/maillog
cron.*                                                  /var/log/cron
*.emerg                                                 *
uucp,news.crit                                          /var/log/spooler
local7.*                                                /var/log/boot.log

MySQL config on recipient:

# cat /etc/rsyslog.d/hostname.conf
$ModLoad ommysql
:fromhost, isequal, "hostname" :ommysql:localhost,Syslog,rsyslog,megapass

And host-sender:

# cat /etc/rsyslog.conf | egrep -v '^[[:space:]]*$|#'
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$IncludeConfig /etc/rsyslog.d/*.conf
kern.*                                                  @hostname
syslog.*                                                /var/log/syslog.log
*.info;mail.none;authpriv.none;cron.none                /var/log/messages
authpriv.*                                              /var/log/secure
mail.*                                                  -/var/log/maillog
mail.*                                                  @hostname
cron.*                                                  /var/log/cron
cron.*                                                  @hostname
*.emerg                                                 *
uucp,news.crit                                          /var/log/spooler
local7.*                                                /var/log/boot.log
local4.*                                                /var/log/ldap.log

UPD

Also, I noticed that data doesn't send even to local file:

kern.*                                                  /var/log/kern.log

And:

# logger -p kern.warning -t TEST "Test warning for local host KERNEL"

And:

# tail /var/log/kern.log | grep "TEST"

Return nothing.

So - am I correct if I guess that loggercan't send data "from kernel"? It's sounds logical...

2

From logger man page on facility names:

kern       cannot be generated from user process

Source here: http://man7.org/linux/man-pages/man1/logger.1.html

  • Thanks :-) I even forgot about this issue, but this answer helpfull. – setevoy Feb 19 '15 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.