Anacron job 'cron.daily' logrotate

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
User avatar
tylerhoadley
Posts: 43
Joined: Tue Jul 02, 2013 1:41 pm

Anacron job 'cron.daily' logrotate

Post by tylerhoadley »

seems there is a small issue with /etc/logrotate.d/nagioslogserver. the 2015R2.2 release produces the following errors when the cron runs. Believe this was an issue with the version prior as well.

I receive all root email and this is output.

Code: Select all

/etc/cron.daily/logrotate:

error: nagioslogserver:1 lines must begin with a keyword or a filename (possibly in double quotes)
error: nagioslogserver:2 unexpected text
error: nagioslogserver:3 unexpected text
error: nagioslogserver:4 unexpected text
error: nagioslogserver:5 unexpected text
error: nagioslogserver:6 unexpected text
error: nagioslogserver:7 unexpected text
error: nagioslogserver:8, unexpected text after {
error: nagioslogserver:8 lines must begin with a keyword or a filename (possibly in double quotes)
error: nagioslogserver:9 lines must begin with a keyword or a filename (possibly in double quotes)
error: nagioslogserver:10 lines must begin with a keyword or a filename (possibly in double quotes)
error: nagioslogserver:11 unexpected text
error: nagioslogserver:12 unexpected text
error: nagioslogserver:13 unexpected text
error: nagioslogserver:14 unexpected text
error: nagioslogserver:15 unexpected text
error: nagioslogserver:16 unexpected text
error: nagioslogserver:17, unexpected text after {
error: nagioslogserver:17 lines must begin with a keyword or a filename (possibly in double quotes)
Basically the file is in Windows line ending format instead of unix, there is ways to correct this, however this method below is the quickest way to resolve.

root@localhost:~/# file /etc/logrotate.dnagioslogserver
nagioslogserver: ASCII text, with CRLF line terminators
root@localhost:~/# yum install dos2unix -y
Loaded plugins: package_upload, product-id, security, subscription-manager
Setting up Install Process
...
Installed:
dos2unix.x86_64 0:3.1-37.el6

Complete!
root@localhost:~/# dos2unix /etc/logrotate.d/nagioslogserver
dos2unix: converting file nagioslogserver to UNIX format ...
root@localhost:~/# file /etc/logrotate.d/nagioslogserver
/etc/logrotate.d/nagioslogserver: ASCII text


Nagios Support, can you file this as a bug and have corrected in the next version so we don't have to keep correcting this after upgrades.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Anacron job 'cron.daily' logrotate

Post by jolson »

Thank you for the feedback - this bug fix will be included in our next release! May I close this thread?
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
User avatar
tylerhoadley
Posts: 43
Joined: Tue Jul 02, 2013 1:41 pm

Re: Anacron job 'cron.daily' logrotate

Post by tylerhoadley »

Yeah, Go ahead.
Locked