LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-22-2023, 05:34 PM   #1
james000
Member
 
Registered: Sep 2018
Posts: 143

Rep: Reputation: 2
logger command is not sending logs to /var/log/messages


I have this Centos 7 server and I have one script, which is supposed to send logs output to /var/log/messages via logger
Code:
[root@serv3 ~]# cat /export/home/splunk/splunk/etc/apps/app_customalertactions/bin/sendSyslogAlarm.sh | grep logger
export logging_agent="/usr/bin/logger"
[root@serv3 ~]#
As this was not working, I tested logger command and it looks like it is not working as expected.
rsyslog.service is running
Code:
[root@serv3 ~]# logger "This is a logging test"
[root@serv3 ~]# logger -p daemon.error "This is a logging error test"
[root@serv3 ~]# logger -t logtester -p daemon.error "This is a logging error test"
[root@serv3 ~]# journalctl --no-pager | grep -i test
[root@serv3 ~]# cat /var/log/messages | grep -i test
[root@serv3 ~]#
Please advice, what I am missing here.
Thanks
 
Old 09-22-2023, 07:01 PM   #2
james000
Member
 
Registered: Sep 2018
Posts: 143

Original Poster
Rep: Reputation: 2
I am able to fix it. strace was showing
Code:
79712 23:16:35.718227 connect(3<socket:[1649798909]>, {sa_family=AF_UNIX, sun_path="/dev/log"}, 110) = -1 ENOENT (No such file or directory) <0.000010>
So, I had to create /dev/log and it is all good now
 
  


Reply

Tags
logger, rsyslog



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] iptables troubleshooting icmp and best place to log /var/log/messages or /var/log/iptables JockVSJock Linux - Security 18 02-12-2016 12:31 AM
[SOLVED] No /var/log/messages , syslog , kern.log -but cat /var/spool/octopussy/octo_fifo masuch Linux - Newbie 4 06-13-2012 08:05 PM
/var/adm/messages vs /var/log/messages gomes1333 Linux - General 1 04-06-2010 04:08 AM
/var/log/messages and /var/log/cron not working sigkill Linux - Software 6 08-09-2008 01:08 PM
System logger & Kernel logger service start twice? quanta Fedora 0 12-07-2007 06:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration