[rsyslog-notify] Forum Thread: CentOS 7: rsyslog can't run propertly external script - (Mode 'post')

noreply at adiscon.com noreply at adiscon.com
Fri Jul 1 10:37:17 CEST 2016


User: Genluck 
Forumlink: http://kb.monitorware.com/viewtopic.php?p=26679#p26679

Message: 
----------
Hello everyone.
I have a strange problem with rsyslog in CentOS 7. I did install it via
yum. My problem is that my scrip that is running by rsyslog is working in
strange way. The scrip itself is:
[code:67mod0v4]# Run child process
sudo -u rancid /usr/local/etc/rancid/bin/rancid-run -r $1
# Bellow is testing part
echo "$1" >> /var/log/variables[/code:67mod0v4]
When rsyslog has been running via systemctl the test part worked well but
my child proccess hasn't been execucet. But if I run rsyslog mannually from
a root user (command "/usr/sbin/rsyslogd -n") both parts at my script works
well. Why could this happens? BTW if I'm running rsyslog under root user
just by typing "/usr/sbin/rsyslogd" my script works strange too.

For information:
OS is CentOS Linux release 7.2.1511 (Core)
Configuration of rsyslog.conf:
[code:67mod0v4]$ModLoad imuxsock
$ModLoad imjournal
$ModLoad imudp
$UDPServerRun 514
$WorkDirectory /var/lib/rsyslog
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$IncludeConfig /etc/rsyslog.d/*.conf
$OmitLocalLogging on
$IMJournalStateFile imjournal.state

# Run config backup after change of configuration at the Cisco devices
$template HostIP,"%FROMHOST-IP%"
:msg, contains, "%SYS-5-CONFIG_I: Configured from console by test
on console" ^/home/run-script.sh;HostIP[/code:67mod0v4]
Best Regards.


More information about the rsyslog-notify mailing list