Re: [asterisk-users] Asterisk Log rotate not working

2013-05-23 Thread Dmitry
You can check whether logrotate sees/understands the asterisk's file in 
/etc/logrotate.d volume by looking through 
 /var/log/logstatus 

You should see names of the files you plan to rotate
Actually you should do 
logrotate -s /var/log/logstatus /etc/logrotate.conf to see these files

hope this helps
Dmitry Pavlenko  



 From: Tzafrir Cohen tzafrir.co...@xorcom.com
To: Asterisk Users Mailing List - Non-Commercial Discussion 
asterisk-users@lists.digium.com 
Sent: Thursday, May 23, 2013 11:25 AM
Subject: Re: [asterisk-users] Asterisk Log rotate not working
 

On Wed, May 22, 2013 at 02:54:46PM -0400, Ahmed Munir wrote:
 Jim,
 
 Cron and Logrotate already installed in my machine and already configured
 as the steps you enlisted. But still logrotate is not running.

How can you tell that the logrotate cron job was run?

At what time it was configured to run? Did you see its output in the
logs?

And please, do make some minimal effort to RTFM and answer questions on
your own. Some tools for your disposal:

  rpm -ql logrotate | grep cron
  grep -i crom /var/log/messages

Cron jobs which have failed and/or had an output send a message to the
user who ran them (root, in your case). Is there a sendmail (sendmail,
postfix, whatever) running on the system? If so, where does root's mail
go to? Read it.

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.co...@xorcom.com
+972-50-7952406           mailto:tzafrir.co...@xorcom.com
http://www.xorcom.com  iax:gu...@local.xorcom.com/tzafrir

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
              http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Asterisk Log rotate not working

2013-05-22 Thread Ahmed Munir
Jim,

Cron and Logrotate already installed in my machine and already configured
as the steps you enlisted. But still logrotate is not running.


Date: Tue, 21 May 2013 12:28:31 -0700
 From: Jim Lucas li...@cmsws.com
 Subject: Re: [asterisk-users] Asterisk Log rotate not working
 To: Asterisk Users Mailing List - Non-Commercial Discussion
 asterisk-users@lists.digium.com
 Message-ID: 519bcadf.1000...@cmsws.com
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed

 On 5/21/2013 11:54 AM, Ahmed Munir wrote:
  Checked in /var/logs/ directory, all logs are not rotating by logrotate.
  Please advise how can I overcome this issue as I'm using CentoOS 5

 Ahmed,

 Proper log rotation depends on a couple things working together
 correctly to get the job done.  First, you need to make sure you have
 the space to rotate the logs.  If you have compression enabled,
 logrotate creates a copy of the file(s) as it compresses them.  You
 could be running out of space???

 Next you need to verify that everything is in place, follow these steps
 to do so.  Keep in mind that I have CentOS 6.4.  So the packages might
 differ a little in the name and surely in the version numbering.

   1) Verify logrotate is installed to your system.
  # yum install logrotate

  if it asks you to install it, do so.

   2) Verify that crond is installed and running.
  Below is the output I get when searching yum to see if crond is
 installed.  If your query returns nothing then crond is not installed.

[root@jim etc]# yum list all | grep ^cron | grep @
cronie.x86_64 1.4.4-7.el6
 @anaconda-CentOS-201303020151.x86_64/6.4
cronie-anacron.x86_64 1.4.4-7.el6
 @anaconda-CentOS-201303020151.x86_64/6.4
crontabs.noarch   1.10-33.el6
 @anaconda-CentOS-201303020151.x86_64/6.4

  If crond is not installed, then you will need to install it.  Once
 you have it installed, move on to the next step.

   3) Make sure crond is setup to start at boot time.

chkconfig crond on

   4) Verify that logrotate is in one of the cron include folders.  Mine
 is located in the cron.daily folder.

[root@jim etc]# find /etc/*/logrotate
/etc/cron.daily/logrotate

If you don't find that the above file exists, you might need to
 re-install logrotate.

 Next I would've had you verify that you have a config file in
 /etc/logrotate.d/ for the asterisk log files.  But it seems you already
 to.  After all this, if it still isn't working, double check all the
 steps above.

 Let us know if this does or doesn't help.

 --
 Jim Lucas






-- 
Regards,

Ahmed Munir Chohan
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Asterisk Log rotate not working

2013-05-22 Thread Tzafrir Cohen
On Wed, May 22, 2013 at 02:54:46PM -0400, Ahmed Munir wrote:
 Jim,
 
 Cron and Logrotate already installed in my machine and already configured
 as the steps you enlisted. But still logrotate is not running.

How can you tell that the logrotate cron job was run?

At what time it was configured to run? Did you see its output in the
logs?

And please, do make some minimal effort to RTFM and answer questions on
your own. Some tools for your disposal:

  rpm -ql logrotate | grep cron
  grep -i crom /var/log/messages

Cron jobs which have failed and/or had an output send a message to the
user who ran them (root, in your case). Is there a sendmail (sendmail,
postfix, whatever) running on the system? If so, where does root's mail
go to? Read it.

-- 
   Tzafrir Cohen
icq#16849755  jabber:tzafrir.co...@xorcom.com
+972-50-7952406   mailto:tzafrir.co...@xorcom.com
http://www.xorcom.com  iax:gu...@local.xorcom.com/tzafrir

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] Asterisk Log rotate not working

2013-05-21 Thread Ahmed Munir
Hi,

Last year, I installed Asterisk 10.4.2 and enabled logrotate on daily basis
which was working perfect. Now in couple of months back, the logrotate
feature is not working at all but simply appending the logs in 'messages'
file. Listing down down the configuration for logrotate below;

/var/log/asterisk/messages {
missingok
rotate 5
daily
postrotate
/usr/sbin/asterisk -rx 'logger reload'  /dev/null 2 /dev/null
endscript
}

As asterisk is running by user: root so no need set asterisk permissions
'create 0640 asterisk asterisk' in above configuration.

Please advise so I can resolve this issue.



-- 
Regards,

Ahmed Munir Chohan
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Asterisk Log rotate not working

2013-05-21 Thread Chris Bagnall
On 21/5/13 4:19 pm, Ahmed Munir wrote: Last year, I installed Asterisk 
10.4.2 and enabled logrotate on daily basis

which was working perfect. Now in couple of months back, the logrotate
feature is not working at all but simply appending the logs in 'messages'
file. Listing down down the configuration for logrotate below;


This sounds more like a Linux/logrotate issue rather than 
asterisk-specific. Are your other system logfiles successfully rotating? 
(e.g. /var/log/messages)


If not, it may be something as simple as logrotate's daemon not running. 
You should be able to fix that in your distro's startup scripts.


On Gentoo, you'd do something like /etc/init.d/logrotate start to 
start it now, and rc-update add logrotate default to add it to your 
default runlevel.


Difficult to advise further without knowing the distro in question.

Kind regards,

Chris
--
This email is made from 100% recycled electrons

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Asterisk Log rotate not working

2013-05-21 Thread Jason Parker

On 05/21/2013 10:19 AM, Ahmed Munir wrote:

Hi,

Last year, I installed Asterisk 10.4.2 and enabled logrotate on daily 
basis which was working perfect. Now in couple of months back, the 
logrotate feature is not working at all but simply appending the logs 
in 'messages' file. Listing down down the configuration for logrotate 
below;


/var/log/asterisk/messages {
missingok
rotate 5
daily
postrotate
/usr/sbin/asterisk -rx 'logger reload'  /dev/null 2 /dev/null
endscript
}

As asterisk is running by user: root so no need set asterisk 
permissions 'create 0640 asterisk asterisk' in above configuration.


Please advise so I can resolve this issue.


I believe you want to execute logger rotate, rather than logger reload.

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Asterisk Log rotate not working

2013-05-21 Thread Tzafrir Cohen
On Tue, May 21, 2013 at 11:29:37AM -0500, Jason Parker wrote:
 On 05/21/2013 10:19 AM, Ahmed Munir wrote:
 Hi,
 
 Last year, I installed Asterisk 10.4.2 and enabled logrotate on
 daily basis which was working perfect. Now in couple of months
 back, the logrotate feature is not working at all but simply
 appending the logs in 'messages' file. Listing down down the
 configuration for logrotate below;
 
 /var/log/asterisk/messages {
 missingok
 rotate 5
 daily
 postrotate
 /usr/sbin/asterisk -rx 'logger reload'  /dev/null 2 /dev/null
 endscript
 }

 I believe you want to execute logger rotate, rather than logger reload.

It is indeed 'logger reload'. logrotate handles the rotation. All it
needs is that Asterisk will re-open the log file to use the new files
after the old ones were moved.

-- 
   Tzafrir Cohen
icq#16849755  jabber:tzafrir.co...@xorcom.com
+972-50-7952406   mailto:tzafrir.co...@xorcom.com
http://www.xorcom.com  iax:gu...@local.xorcom.com/tzafrir

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Asterisk Log rotate not working

2013-05-21 Thread Ahmed Munir
Checked in /var/logs/ directory, all logs are not rotating by logrotate.
Please advise how can I overcome this issue as I'm using CentoOS 5




From: Chris Bagnall aster...@lists.minotaur.cc
 Subject: Re: [asterisk-users] Asterisk Log rotate not working
 To: asterisk-users@lists.digium.com
 Message-ID: 519b9fa6.9000...@lists.minotaur.cc
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed

 On 21/5/13 4:19 pm, Ahmed Munir wrote: Last year, I installed Asterisk
 10.4.2 and enabled logrotate on daily basis
  which was working perfect. Now in couple of months back, the logrotate
  feature is not working at all but simply appending the logs in 'messages'
  file. Listing down down the configuration for logrotate below;

 This sounds more like a Linux/logrotate issue rather than
 asterisk-specific. Are your other system logfiles successfully rotating?
 (e.g. /var/log/messages)

 If not, it may be something as simple as logrotate's daemon not running.
 You should be able to fix that in your distro's startup scripts.

 On Gentoo, you'd do something like /etc/init.d/logrotate start to
 start it now, and rc-update add logrotate default to add it to your
 default runlevel.

 Difficult to advise further without knowing the distro in question.

 Kind regards,

 Chris
 --
 This email is made from 100% recycled electrons





-- 
Regards,

Ahmed Munir Chohan
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Asterisk Log rotate not working

2013-05-21 Thread Jim Lucas

On 5/21/2013 11:54 AM, Ahmed Munir wrote:

Checked in /var/logs/ directory, all logs are not rotating by logrotate.
Please advise how can I overcome this issue as I'm using CentoOS 5


Ahmed,

Proper log rotation depends on a couple things working together 
correctly to get the job done.  First, you need to make sure you have 
the space to rotate the logs.  If you have compression enabled, 
logrotate creates a copy of the file(s) as it compresses them.  You 
could be running out of space???


Next you need to verify that everything is in place, follow these steps 
to do so.  Keep in mind that I have CentOS 6.4.  So the packages might 
differ a little in the name and surely in the version numbering.


 1) Verify logrotate is installed to your system.
# yum install logrotate

if it asks you to install it, do so.

 2) Verify that crond is installed and running.
Below is the output I get when searching yum to see if crond is 
installed.  If your query returns nothing then crond is not installed.


  [root@jim etc]# yum list all | grep ^cron | grep @
  cronie.x86_64 1.4.4-7.el6 
   @anaconda-CentOS-201303020151.x86_64/6.4
  cronie-anacron.x86_64 1.4.4-7.el6 
   @anaconda-CentOS-201303020151.x86_64/6.4
  crontabs.noarch   1.10-33.el6 
   @anaconda-CentOS-201303020151.x86_64/6.4


If crond is not installed, then you will need to install it.  Once 
you have it installed, move on to the next step.


 3) Make sure crond is setup to start at boot time.

  chkconfig crond on

 4) Verify that logrotate is in one of the cron include folders.  Mine 
is located in the cron.daily folder.


  [root@jim etc]# find /etc/*/logrotate
  /etc/cron.daily/logrotate

  If you don't find that the above file exists, you might need to 
re-install logrotate.


Next I would've had you verify that you have a config file in 
/etc/logrotate.d/ for the asterisk log files.  But it seems you already 
to.  After all this, if it still isn't working, double check all the 
steps above.


Let us know if this does or doesn't help.

--
Jim Lucas

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users