Page 1 of 1

ERROR: No syslog service found.

Posted: Sun Jun 28, 2020 10:40 am
by jabi27
Hi

Trying to load syslog from Ubuntu 20.04

sudo bash setup-linux.sh -s nagios-server -p 5544

The script i failing and removing set -e from the script, gives this:

Code: Select all

sudo bash setup-linux.sh -s nagios-server -p 5544
Detected rsyslog 
Detected rsyslog work directory /var/spool/rsyslog
ERROR: No syslog service found.
But syslog appears to run:

Code: Select all

systemctl status rsyslog
● rsyslog.service - System Logging Service
     Loaded: loaded (/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2020-06-28 15:24:42 CEST; 2h 8min ago
TriggeredBy: ● syslog.socket
       Docs: man:rsyslogd(8)
             https://www.rsyslog.com/doc/
   Main PID: 7963 (rsyslogd)
      Tasks: 4 (limit: 18985)
     Memory: 1.0M
     CGroup: /system.slice/rsyslog.service
             └─7963 /usr/sbin/rsyslogd -n -iNONE
Any idea ?

Best

/Jan

Re: ERROR: No syslog service found.

Posted: Mon Jun 29, 2020 11:42 am
by cdienger
The script runs this command:

Code: Select all

rsyslogd -v
and then checks the output to make sure it returns a string that matches this regex:

Code: Select all

rsyslogd ([0-9]+\.[0-9]+\.[0-9]+)
If it doesn't find this string then it will fail with the message you are seeing.

What is the output of this command when you run it on the Ubuntu machine:

Code: Select all

rsyslogd -v
?

Re: ERROR: No syslog service found.

Posted: Mon Jun 29, 2020 12:35 pm
by jabi27

Code: Select all

root@barbar:~# rsyslogd -v
rsyslogd  8.2001.0 (aka 2020.01) compiled with:
	PLATFORM:				x86_64-pc-linux-gnu
	PLATFORM (lsb_release -d):		
	FEATURE_REGEXP:				Yes
	GSSAPI Kerberos 5 support:		Yes
	FEATURE_DEBUG (debug build, slow code):	No
	32bit Atomic operations supported:	Yes
	64bit Atomic operations supported:	Yes
	memory allocator:			system default
	Runtime Instrumentation (slow code):	No
	uuid support:				Yes
	systemd support:			Yes
	Config file:				/etc/rsyslog.conf
	PID file:				/run/rsyslogd.pid
	Number of Bits in RainerScript integers: 64

See https://www.rsyslog.com for more information.

Re: ERROR: No syslog service found.

Posted: Mon Jun 29, 2020 3:10 pm
by cdienger
The regex doesn't match because it is only looking for a single space between the "rsyslogd' and version number string. I'll file a bug to update the script to take into account instances like yours were the line contains two spaces between the "rsyslogd" and version strings.

In the meantime you should be able to correct it by editing line 127 of setup-linux.sh and changing it from:

Code: Select all

regex='rsyslogd ([0-9]+\.[0-9]+\.[0-9]+)'
to:

Code: Select all

regex='rsyslogd\s+([0-9]+\.[0-9]+\.[0-9]+)'
You can find the script on the NLS machine at /var/www/html/nagioslogserver/www/scripts/setup-linux.sh.

Re: ERROR: No syslog service found.

Posted: Tue Jun 30, 2020 12:41 am
by jabi27
Thanks

The script now executes to the end.

Code: Select all

 sudo bash setup-linux.sh -s nagios-logserver -p 5544
Detected rsyslog 8.2001.0
Detected rsyslog work directory /var/spool/rsyslog
Destination Log Server: nagios-logserver2.stil.dk:5544
Creating /etc/rsyslog.d/99-nagioslogserver.conf...
getenforce command not found, assuming SELinux is disabled.
rsyslog configuration check passed.
Restarting rsyslog service with 'service'...
Okay.
rsyslog is running with the new configuration.
Visit your Nagios Log Server dashboard to verify that logs are being received.
/Jan

Re: ERROR: No syslog service found.

Posted: Tue Jun 30, 2020 8:06 am
by scottwilkerson
jabi27 wrote:Thanks

The script now executes to the end.

Code: Select all

 sudo bash setup-linux.sh -s nagios-logserver -p 5544
Detected rsyslog 8.2001.0
Detected rsyslog work directory /var/spool/rsyslog
Destination Log Server: nagios-logserver2.stil.dk:5544
Creating /etc/rsyslog.d/99-nagioslogserver.conf...
getenforce command not found, assuming SELinux is disabled.
rsyslog configuration check passed.
Restarting rsyslog service with 'service'...
Okay.
rsyslog is running with the new configuration.
Visit your Nagios Log Server dashboard to verify that logs are being received.
/Jan
Great!

Locking thread