sxmaint doesn't seem to do anything

Discuss the Scalix Server software

Moderators: ScalixSupport, admin

wrightbyname

sxmaint doesn't seem to do anything

Postby wrightbyname » Sat Mar 22, 2008 7:15 am

I've been having fun getting Scalix working on a modest 1GB RAM OpenVZ VPS. So far so good! I've just tried to get sxmaint working without success: I don't get any notification email, no backups are created, and no log file is created in /tmp.

I created /etc/opt/scalix/sxmaint.cfg which has these entries:

MAIL_REPORTS="<my email address - tried a couple here>"
BACKUP_DEVICE=/usr/backup/scalix
SX_BIN_DIR=/opt/scalix/bin
OMRP=/opt/scalix/bin/omrealpath
OMCK=/opt/scalix/bin/omcheckgc
OMSCAN_OPTS="-a"
LOG_HIST_MINS=1440
SHOWLOG_LEVEL=99
DISK_WARN_PERCENT=80
INODE_WARN_PERCENT=80
DF_FSTYPE_OPTS="-t ext3 -t ext2 -t reiserfs -t jfs -t xfs"
PORTCHECK_TIMEOUT=10

I'm on CentOS 5.

Can anyone help me to see what happens with sxmaint?

les
Scalix Star
Scalix Star
Posts: 819
Joined: Thu Feb 23, 2006 10:18 am
Location: Sydney, Australia

Re: sxmaint doesn't seem to do anything

Postby les » Sat Mar 22, 2008 6:40 pm

wrightbyname wrote:I've been having fun getting Scalix working on a modest 1GB RAM OpenVZ VPS. So far so good! I've just tried to get sxmaint working without success: I don't get any notification email, no backups are created, and no log file is created in /tmp.

I created /etc/opt/scalix/sxmaint.cfg which has these entries:

MAIL_REPORTS="<my email address - tried a couple here>"
BACKUP_DEVICE=/usr/backup/scalix
SX_BIN_DIR=/opt/scalix/bin
OMRP=/opt/scalix/bin/omrealpath
OMCK=/opt/scalix/bin/omcheckgc
OMSCAN_OPTS="-a"
LOG_HIST_MINS=1440
SHOWLOG_LEVEL=99
DISK_WARN_PERCENT=80
INODE_WARN_PERCENT=80
DF_FSTYPE_OPTS="-t ext3 -t ext2 -t reiserfs -t jfs -t xfs"
PORTCHECK_TIMEOUT=10

I'm on CentOS 5.

Can anyone help me to see what happens with sxmaint?



assume you scheduled via cron.....check root mail.

there is a bug with the sxmaint script when it looks for the existence of /etc/opt/scalix/sxmaint.cfg.
The sxmaint.cfg has to have the execute bit set. The test only looks for a file that is executable, if it doesn't find one it uses defaults in the sxmaint script itself (i.e. mail to root etc).

I created a bug a while back for this, requesting that the test on that file just be a "does file exist" test (i.e. -f) instead of -x. I assume this will be fixed in 11.4 as its an easy fix.

Make sure you chmod 755 /etc/opt/scalix/sxmaint.cfg
Regards,

Les Stott

wrightbyname

sxmaint

Postby wrightbyname » Sat Mar 22, 2008 11:28 pm

Thanks. Yes, I had set the execute bit, and checked root mail (as well as the other accounts I set in the config file for different attempts). I ran sxmaint through cron and from the command line as root. I get my command prompt back after a couple of seconds, and can't see any evidence of activity. Would love to get this working! As no logs appear in /tmp, would anything else log what it does?

les
Scalix Star
Scalix Star
Posts: 819
Joined: Thu Feb 23, 2006 10:18 am
Location: Sydney, Australia

Re: sxmaint

Postby les » Sun Mar 23, 2008 5:44 am

wrightbyname wrote:Thanks. Yes, I had set the execute bit, and checked root mail (as well as the other accounts I set in the config file for different attempts). I ran sxmaint through cron and from the command line as root. I get my command prompt back after a couple of seconds, and can't see any evidence of activity. Would love to get this working! As no logs appear in /tmp, would anything else log what it does?


what exact command are you running?

it should be one of.....

/opt/scalix/bin/sxmaint -frequent
/opt/scalix/bin/sxmaint -daily
/opt/scalix/bin/sxmaint -weekly

scheduled via cron like so.....

30 * * * * root /opt/scalix/bin/sxmaint -frequent
01 0 * * * root /opt/scalix/bin/sxmaint -daily
15 2 * * 0 root /opt/scalix/bin/sxmaint -weekly
Regards,

Les Stott

wrightbyname

Postby wrightbyname » Sun Mar 23, 2008 6:43 am

Sorry for providing patchy information!

Yes, that's what I'm doing - the three command examples supplied in the comments have been added to cron, and I tried running them from the command line. Running sxmaint without any option returns the help text explaining about the three flags (USAGE: sxmaint { -frequent | -daily | -weekly }).

Apart from tweaking memory usage for tomcat, the installation is clean, and all installed services and apps are running and things are stable. I followed the directions in man sxmaint and found directions about the execute bit (can't find where this was now, though).

Can I modify sxmaint in any way to produce additional logging?

les
Scalix Star
Scalix Star
Posts: 819
Joined: Thu Feb 23, 2006 10:18 am
Location: Sydney, Australia

Postby les » Sun Mar 23, 2008 9:03 am

wrightbyname wrote:Can I modify sxmaint in any way to produce additional logging?


add at the top....

set -x

then run it via command line to see what its doing.
Regards,

Les Stott

wrightbyname

sxmaint

Postby wrightbyname » Mon Mar 24, 2008 6:27 pm

OK, I've tried it with set -x and got output showing me it's doing something. However, /tmp remains empty and no email is sent. Nothing is added to /var/opt/scalix/<nn>/s/logs/fatal. /var/opt/scalix/js/s/logs/audit.Sun and sxmaint.Sun are empty. Only omscan.out has any content, and that all looks innocuous. It does contain the line 'Current server cycle not started; service reset or delayed.' I can't find a reference to what this means. Is this normal?

I do have one message in the ERROR queue, and so I would expect at least something should be reported, but do you know what else should I expect to see in the logs?

Code: Select all

FREQUENT:

+ MAIL_REPORTS=<my email address>
+ BACKUP_DEVICE=/usr/backup/scalix
+ SX_BIN_DIR=/opt/scalix/bin
+ OMRP=/opt/scalix/bin/omrealpath
+ OMCK=/opt/scalix/bin/omcheckgc
+ OMSCAN_OPTS=-a
+ LOG_HIST_MINS=1440
+ SHOWLOG_LEVEL=99
+ DISK_WARN_PERCENT=80
+ INODE_WARN_PERCENT=80
+ DF_FSTYPE_OPTS='-t ext3 -t ext2 -t reiserfs -t jfs -t xfs'
+ PORTCHECK_TIMEOUT=10
+ '[' -x /etc/opt/scalix/sxmaint.cfg ']'
+ . /etc/opt/scalix/sxmaint.cfg
++ MAIL_REPORTS=<my email address>
++ BACKUP_DEVICE=/usr/backup/scalix
++ SX_BIN_DIR=/opt/scalix/bin
++ OMRP=/opt/scalix/bin/omrealpath
++ OMCK=/opt/scalix/bin/omcheckgc
++ OMSCAN_OPTS=-a
++ LOG_HIST_MINS=1440
++ SHOWLOG_LEVEL=99
++ DISK_WARN_PERCENT=80
++ INODE_WARN_PERCENT=80
++ DF_FSTYPE_OPTS='-t ext3 -t ext2 -t reiserfs -t jfs -t xfs'
++ PORTCHECK_TIMEOUT=10
+ OMSHOWLOG_STD_OPTS='-P -p 1440 -l 99'
++ /opt/scalix/bin/omcheckgc -l
+ for instance in '$($OMCK -l)'
+ export OMCURRENT=jeeves
+ OMCURRENT=jeeves
+ '[' 1 -ne 1 ']'
+ case $1 in
+ sxmaint_frequent
+ MAINTLOG=/tmp/sxmaint.19932
+ STDERR=/tmp/sxmaint.19932.stderr
+ STDOUT=/tmp/sxmaint.19932.stdout
++ /opt/scalix/bin/omrealpath '~/logs/fatal'
+ FATAL_FILE=/var/opt/scalix/js/s/logs/fatal
+ rm -f /tmp/sxmaint.19932 /tmp/sxmaint.19932.stderr /tmp/sxmaint.19932.stdout
+ touch /tmp/sxmaint.19932 /tmp/sxmaint.19932.stderr /tmp/sxmaint.19932.stdout
+ df -P -h -t ext3 -t ext2 -t reiserfs -t jfs -t xfs
+ awk '{if (int($5)>=80) {print $0}}'
+ '[' -s /tmp/sxmaint.19932.stdout ']'
+ df -P -h -i -t ext3 -t ext2 -t reiserfs -t jfs -t xfs
+ awk '{if (int($5)>=80) {print $0}}'
+ '[' -s /tmp/sxmaint.19932.stdout ']'
++ /opt/scalix/bin/sxlicense
++ grep -c '^System Class: Multi-Server'
+ MULTI_SERVER_TRUE=0
+ '[' 0 -gt 0 ']'
+ for queue in ERROR '$S_ERROR'
+ /opt/scalix/bin/omstat -q ERROR
++ cat /tmp/sxmaint.19932.stderr
+ '[' 'omstat : There are no messages on the queue' '!=' 'omstat : There are no messages on the queue' ']'
+ services='service router|local delivery|internet mail gateway|sendmail interface'
+ /opt/scalix/bin/omstat -s
+ grep -Ei 'service router|local delivery|internet mail gateway|sendmail interface'
+ cat /tmp/sxmaint.19932.stdout
+ read line
++ echo Service Router Started 03:22:29 0
++ awk '{NF=NF-3;print $0}'
+ queue='Service Router'
++ echo Service Router Started 03:22:29 0
++ awk '{print $NF}'
+ msgcount=0
+ '[' 0 = - ']'
+ '[' 0 -gt 10 ']'
+ read line
++ echo Local Delivery Started 03:22:29 0
++ awk '{NF=NF-3;print $0}'
+ queue='Local Delivery'
++ echo Local Delivery Started 03:22:29 0
++ awk '{print $NF}'
+ msgcount=0
+ '[' 0 = - ']'
+ '[' 0 -gt 10 ']'
+ read line
++ echo Internet Mail Gateway Started 03:22:29 0
++ awk '{NF=NF-3;print $0}'
+ queue='Internet Mail Gateway'
++ echo Internet Mail Gateway Started 03:22:29 0
++ awk '{print $NF}'
+ msgcount=0
+ '[' 0 = - ']'
+ '[' 0 -gt 10 ']'
+ read line
+ /opt/scalix/bin/omstat -s -j
+ grep -i aborted
+ '[' -s /tmp/sxmaint.19932.stdout ']'
+ /opt/scalix/bin/omstat -a -j
+ grep -i aborted
+ '[' -s /tmp/sxmaint.19932.stdout ']'
+ PERLSCRIPT=./PortCheck.pl
+ '[' '!' -s ./PortCheck.pl ']'
+ echo '#!/usr/bin/perl'
+ echo 'use IO::Socket::INET;'
+ echo ''
+ echo 'eval {'
+ echo 'local $SIG{ALRM} = sub { die "Timed Out"; };'
+ echo 'alarm 10;'
+ echo ''
+ echo '$socket = IO::Socket::INET->new(PeerAddr => $ARGV[0],'
+ echo '                                PeerPort => $ARGV[1],'
+ echo '                                Proto    => "tcp",'
+ echo '                                Type     => SOCK_STREAM)'
+ echo 'or die "Couldnt open port $ARGV[0]:$ARGV[1] : $!\n";'
+ echo ''
+ echo '$answer = <$socket>;'
+ echo 'print $answer;'
+ echo 'close($socket);'
+ echo 'alarm 0;'
+ echo '};'
+ echo 'alarm 0;'
+ echo 'if ($@ =~ /Timed Out/) {'
+ echo '   print "Error: Timeout on port $ARGV[0]:$ARGV[1]\n";'
+ echo '   exit 1;'
+ echo '};'
+ echo 'if ($@ =~ /Couldnt open port/) {'
+ echo '   print "$@";'
+ echo '   exit 0;'
+ echo '};'
+ echo 'if ($@ ne "") {'
+ echo '   exit -1;'
+ echo '}'
+ echo 'exit -2;'
+ chmod +x ./PortCheck.pl
+ echo '--Performing Port Check on localhost:25-----'
++ /opt/scalix/bin/omcheckgc -h
+ ./PortCheck.pl jeeves.wright.ru 25
+ '[' 254 -eq 1 ']'
+ echo '--Performing Port Check on localhost:110---'
++ /opt/scalix/bin/omcheckgc -h
+ ./PortCheck.pl jeeves.wright.ru 110
+ '[' 254 -eq 1 ']'
+ echo '--Performing Port Check on localhost:143-----'
++ /opt/scalix/bin/omcheckgc -h
+ ./PortCheck.pl jeeves.wright.ru 143
+ '[' 254 -eq 1 ']'
+ '[' -s /tmp/sxmaint.19932 ']'
+ rm -f /tmp/sxmaint.19932 /tmp/sxmaint.19932.stderr /tmp/sxmaint.19932.stdout ./PortCheck.pl



DAILY:

+ MAIL_REPORTS=<my email address>
+ BACKUP_DEVICE=/usr/backup/scalix
+ SX_BIN_DIR=/opt/scalix/bin
+ OMRP=/opt/scalix/bin/omrealpath
+ OMCK=/opt/scalix/bin/omcheckgc
+ OMSCAN_OPTS=-a
+ LOG_HIST_MINS=1440
+ SHOWLOG_LEVEL=99
+ DISK_WARN_PERCENT=80
+ INODE_WARN_PERCENT=80
+ DF_FSTYPE_OPTS='-t ext3 -t ext2 -t reiserfs -t jfs -t xfs'
+ PORTCHECK_TIMEOUT=10
+ '[' -x /etc/opt/scalix/sxmaint.cfg ']'
+ . /etc/opt/scalix/sxmaint.cfg
++ MAIL_REPORTS=<my email address>
++ BACKUP_DEVICE=/usr/backup/scalix
++ SX_BIN_DIR=/opt/scalix/bin
++ OMRP=/opt/scalix/bin/omrealpath
++ OMCK=/opt/scalix/bin/omcheckgc
++ OMSCAN_OPTS=-a
++ LOG_HIST_MINS=1440
++ SHOWLOG_LEVEL=99
++ DISK_WARN_PERCENT=80
++ INODE_WARN_PERCENT=80
++ DF_FSTYPE_OPTS='-t ext3 -t ext2 -t reiserfs -t jfs -t xfs'
++ PORTCHECK_TIMEOUT=10
+ OMSHOWLOG_STD_OPTS='-P -p 1440 -l 99'
++ /opt/scalix/bin/omcheckgc -l
+ for instance in '$($OMCK -l)'
+ export OMCURRENT=jeeves
+ OMCURRENT=jeeves
+ '[' 1 -ne 1 ']'
+ case $1 in
+ sxmaint_daily
++ date +%a
+ DAY=Sun
++ /opt/scalix/bin/omrealpath '~/logs/sxmaint.Sun'
+ MAINTLOG=/var/opt/scalix/js/s/logs/sxmaint.Sun
+ rm -f /var/opt/scalix/js/s/logs/sxmaint.Sun
+ touch /var/opt/scalix/js/s/logs/sxmaint.Sun
++ /opt/scalix/bin/omrealpath '~/logs/audit'
+ AUDFIL=/var/opt/scalix/js/s/logs/audit
++ date +%a
+ DAY=Sun
+ SAVFIL=/var/opt/scalix/js/s/logs/audit.Sun
+ rm -f /var/opt/scalix/js/s/logs/audit.Sun
+ mv -f /var/opt/scalix/js/s/logs/audit /var/opt/scalix/js/s/logs/audit.Sun
+ touch /var/opt/scalix/js/s/logs/audit
+ chown scalix /var/opt/scalix/js/s/logs/audit
+ chgrp scalix /var/opt/scalix/js/s/logs/audit
+ chmod 660 /var/opt/scalix/js/s/logs/audit
+ '[' -s /var/opt/scalix/js/s/logs/sxmaint.Sun ']'


WEEKLY:

+ MAIL_REPORTS=<my email address>
+ BACKUP_DEVICE=/usr/backup/scalix
+ SX_BIN_DIR=/opt/scalix/bin
+ OMRP=/opt/scalix/bin/omrealpath
+ OMCK=/opt/scalix/bin/omcheckgc
+ OMSCAN_OPTS=-a
+ LOG_HIST_MINS=1440
+ SHOWLOG_LEVEL=99
+ DISK_WARN_PERCENT=80
+ INODE_WARN_PERCENT=80
+ DF_FSTYPE_OPTS='-t ext3 -t ext2 -t reiserfs -t jfs -t xfs'
+ PORTCHECK_TIMEOUT=10
+ '[' -x /etc/opt/scalix/sxmaint.cfg ']'
+ . /etc/opt/scalix/sxmaint.cfg
++ MAIL_REPORTS=<my email address>
++ BACKUP_DEVICE=/usr/backup/scalix
++ SX_BIN_DIR=/opt/scalix/bin
++ OMRP=/opt/scalix/bin/omrealpath
++ OMCK=/opt/scalix/bin/omcheckgc
++ OMSCAN_OPTS=-a
++ LOG_HIST_MINS=1440
++ SHOWLOG_LEVEL=99
++ DISK_WARN_PERCENT=80
++ INODE_WARN_PERCENT=80
++ DF_FSTYPE_OPTS='-t ext3 -t ext2 -t reiserfs -t jfs -t xfs'
++ PORTCHECK_TIMEOUT=10
+ OMSHOWLOG_STD_OPTS='-P -p 1440 -l 99'
++ /opt/scalix/bin/omcheckgc -l
+ for instance in '$($OMCK -l)'
+ export OMCURRENT=jeeves
+ OMCURRENT=jeeves
+ '[' 1 -ne 1 ']'
+ case $1 in
+ sxmaint_weekly
++ /opt/scalix/bin/omrealpath '~/logs/omscan.out'
+ OMSCAN_FILE=/var/opt/scalix/js/s/logs/omscan.out
+ /opt/scalix/bin/omscan -a
+ sed -e 's/^/ /' /var/opt/scalix/js/s/logs/omscan.out
++ /opt/scalix/bin/omcheckgc -h
+ mail -s 'jeeves.wright.ru - Scalix Weekly Maintenance Report' <my email address>

les
Scalix Star
Scalix Star
Posts: 819
Joined: Thu Feb 23, 2006 10:18 am
Location: Sydney, Australia

Re: sxmaint

Postby les » Tue Mar 25, 2008 9:30 am

[quote="wrightbyname"]OK, I've tried it with set -x and got output showing me it's doing something. However, /tmp remains empty and no email is sent. Nothing is added to /var/opt/scalix/<nn>/s/logs/fatal. /var/opt/scalix/js/s/logs/audit.Sun and sxmaint.Sun are empty. Only omscan.out has any content, and that all looks innocuous. It does contain the line 'Current server cycle not started; service reset or delayed.' I can't find a reference to what this means. Is this normal?

I do have one message in the ERROR queue, and so I would expect at least something should be reported, but do you know what else should I expect to see in the logs?

[code]

the fatal log is not used by sxmaint.

files in /tmp. when created get cleaned up as per the output from "set -x"

-frequent never emails unless there is a problem.
-daily is the same as frequent, and it doesn't do too much unless you uncomment out some code.
-weekly sends reports.

The output of weekly suggests it did send you an email. If you didn't get it then you need to look at mail logs and figure out why. Are you filtering via sendmail? check for spam score etc.

normally a message on the error queue will get detected and an email sent.

do you actually have something on the error queue?

omstat -q error
Regards,

Les Stott

wrightbyname

Working now!

Postby wrightbyname » Tue Mar 25, 2008 1:08 pm

Thanks for your help - this is working now. Oddly, without making any further configuration changes, sxmaint -weekly (from the command line) sent me an email after a server reboot. I've no idea why it wasn't sent before - all services and apps were running, there was no problem with memory etc. One of those mysteries....


Return to “Scalix Server”



Who is online

Users browsing this forum: No registered users and 5 guests

cron