Server Monitoring problem

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
goldenpioche
Posts: 6
Joined: Tue Nov 27, 2018 2:26 pm

Server Monitoring problem

Post by goldenpioche »

Hello !

I am really new with Zimbra. I just installed the free version on my OVH VPS server and all seems working fine. I am able to create domain, user, send and receive e-mail from the webmail and from Zimbra Desktop.
What is strange is when I am in admin console of Zimbra, under Monitor -> Server Status, all services associated with my server are in red... How can I solve this bug ? In addition to this, when I go under "Monitor -> Message count" all counters are at 0 and this is not true.

Thank you for your help
User avatar
L. Mark Stone
Ambassador
Ambassador
Posts: 2796
Joined: Wed Oct 09, 2013 11:35 am
Location: Portland, Maine, US
ZCS/ZD Version: 10.0.6 Network Edition
Contact:

Re: Server Monitoring problem

Post by L. Mark Stone »

If running "zmcontrol status" as the zimbra user from the command prompt shows everything as running, then the red "X's" in the Home > Monitor page of the Admin Console almost always means you need to set up Zimbra's syslogging correctly.

The Installation Guide has some post-install tasks, one of which is configuring syslogging.

Hope that helps,
Mark
___________________________________
L. Mark Stone
Mission Critical Email - Zimbra VAR/BSP/Training Partner https://www.missioncriticalemail.com/
AWS Certified Solutions Architect-Associate
goldenpioche
Posts: 6
Joined: Tue Nov 27, 2018 2:26 pm

Re: Server Monitoring problem

Post by goldenpioche »

Hello Mark Stone and thank you for your reply. all my services seems running yes.

Code: Select all

zmcontrol status
Host vpsxxxxxx.ovh.net
        amavis                  Running
        antispam                Running
        antivirus               Running
        dnscache                Running
        ldap                    Running
        logger                  Running
        mailbox                 Running
        memcached               Running
        mta                     Running
        opendkim                Running
        proxy                   Running
        service webapp          Running
        snmp                    Running
        spell                   Running
        stats                   Running
        zimbra webapp           Running
        zimbraAdmin webapp      Running
        zimlet webapp           Running
        zmconfigd               Running
I will check the post-install task and come back here with my feedback. BR
goldenpioche
Posts: 6
Joined: Tue Nov 27, 2018 2:26 pm

Re: Server Monitoring problem

Post by goldenpioche »

Hello.

Using the Final Set-Up guide, I ran the following commands.

Code: Select all

root@vpsXXXX:~# /opt/zimbra/libexec/zmsyslogsetup 
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(^destination mail { <-- HERE  file\("/var/log/mail"\); };)/ at /opt/zimbra/libexec/zmsyslogsetup line 190.
updateRsyslogd: Updating /etc/rsyslog.d/50-default.conf...done.

root@vpsXXXX:~# nano /etc/default/rsyslog
  GNU nano 2.5.3                                                 File: /etc/default/rsyslog                                                                                                         

# Options for rsyslogd
# -x disables DNS lookups for remote messages
# See rsyslogd(8) for more details
RSYSLOGD_OPTIONS="-r -m0"

root@vpsXXXX:~# service rsyslog stop
root@vpsXXXX:~# service rsyslog start
root@vpsXXXX:~# service rsyslog status
● rsyslog.service - System Logging Service
   Loaded: loaded (/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-11-30 08:31:31 CET; 4s ago
     Docs: man:rsyslogd(8)
           http://www.rsyslog.com/doc/
 Main PID: 1991 (rsyslogd)
    Tasks: 4
   Memory: 548.0K
      CPU: 4ms
   CGroup: /system.slice/rsyslog.service
           └─1991 /usr/sbin/rsyslogd -n

Nov 30 08:31:31 vps618405 systemd[1]: Starting System Logging Service...
Nov 30 08:31:31 vps618405 systemd[1]: Started System Logging Service.
I still have all my services with the red cross in "Monitor -> Server status
goldenpioche
Posts: 6
Joined: Tue Nov 27, 2018 2:26 pm

Re: Server Monitoring problem

Post by goldenpioche »

Someone has an idea ?
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 889
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 9.0.0_P39 NETWORK Edition

Re: Server Monitoring problem

Post by JDunphy »

If you run zmstatuslog as the zimbra user, you should see STATUS lines in /var/log/zimbra-stats.log. This is run from cron like this.

Code: Select all

# su - zimbra
% crontab -l |grep /opt/zimbra/libexec/zmstatuslog
*/2 * * * * /opt/zimbra/libexec/zmstatuslog > /dev/null 2>&1
% /opt/zimbra/libexec/zmstatuslog
% grep STATUS /var/log/zimbra-stats.log
If you do not, it is syslog related or cron isn't running... if you do see STATUS, the first line that is returned by

Code: Select all

su - zimbra
% zmcontrol status
Host mail.example.com
...
..
That Host line is parsed and is where syslog messages are being sent. That in a nutshell is how the gui works. It requires those STATUS lines from /var/log/zimbra-stats.log after running zmcontrol status.
goldenpioche
Posts: 6
Joined: Tue Nov 27, 2018 2:26 pm

Re: Server Monitoring problem

Post by goldenpioche »

Hello JDunphy and thank you for your answer.

It seems that I have not contab configured correctly because I have the following error

Code: Select all

zimbra@vps618405:/root$ crontab -l | grep /opt/zimbra/libexec/zmstatuslog
no crontab for zimbra
I added manually the line as root

Code: Select all

*/2 * * * * /opt/zimbra/libexec/zmstatuslog > /dev/null 2>&1
in contab and reloaded the service without error but it changes nothing. Here is what I have the the log

Code: Select all

zimbra@vps618405:/root$ grep STATUS /var/log/zimbra-stats.log
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: amavis: Running
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: antispam: Running
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: antivirus: Running
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: dnscache: Running
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: ldap: Running
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: logger: Running
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: mailbox: Running
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: memcached: Running
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: mta: Running
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: opendkim: Running
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: proxy: Running
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: service: Running
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: snmp: Running
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: spell: Running
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: stats: Running
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: zimbra: Running
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: zimbraAdmin: Running
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: zimlet: Running
Dec  4 07:04:56 vps618405 zimbramon[10719]: 10719:info: 2018-12-04 07:04:49, STATUS: vps618405.ovh.net: zmconfigd: Running
When I run

Code: Select all

zmcontrol status
the host value is vps618405.ovh.net (my localhost) but when I try to ping it, it resolve the public IP. maybe this is the problem ? should I add a local dns entry in my /etc/hosts ?
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 889
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 9.0.0_P39 NETWORK Edition

Re: Server Monitoring problem

Post by JDunphy »

A few things. If you don't have any crontab for zimbra you could be missing some more stuff. During the install, you should have had a fairly loaded crontab for the zimbra user.
Take a look at /opt/zimbra/conf/crontabs to re-create if you are missing other pieces. This isn't related to this specific question about monitoring but could help in other sections like load, performance graphs, etc.

As for the host name, if you are seeing those STATUS lines in /var/log/zimbra-stats.log then zmstatuslog (perl script) is able to connect and write to your host which is the syslog host. It does take a few minutes before the gui will notice the lines and you need a few more time intervals of STATUS present. Are you continuing to see STATUS lines in /var/log/zimbra-stats.log? if you are not seeing more STATUS lines then double check that cron is running.

Code: Select all

ps auxw |grep cron
root      1176  0.0  0.0 116896  1456 ?        Ss   Nov04   0:17 crond
Given that you are missing your crontab entries, I would also be looking to make sure sudoers was installed correctly. Observe.

Code: Select all

mail:~:41> cd /etc/sudoers.d
mail:/etc/sudoers.d:42> ls
01_zimbra       02_zimbra-ldap  02_zimbra-proxy
02_zimbra-core  02_zimbra-mta   02_zimbra-store
goldenpioche
Posts: 6
Joined: Tue Nov 27, 2018 2:26 pm

Re: Server Monitoring problem

Post by goldenpioche »

Hello and thank you for your answer.

Can just explain me the best way to reinstall the crontab present in /opt/zimbra/conf/crontabs ?
In /var/log/zimbra-stats.log I see some stats now. Below an example

Code: Select all

Dec  5 06:26:40 vps618405 zimbramon[15204]: 15204:info: zmstat mtaqueue.csv: timestamp, KBytes, requests:: 12/05/2018 06:26:40, 0, 0
qDec  5 06:26:42 vps618405 zimbramon[15717]: 15717:info: zmstat fd.csv: timestamp, fd_count, mailboxd_fd_count:: 12/05/2018 06:26:42, 3552, 580
Dec  5 06:26:43 vps618405 zimbramon[15206]: 15206:info: zmstat nginx.csv: timestamp, utime, stime, cputime, rchar, wchar, read_bytes, write_bytes, rss, processes, threads:: 12/05/2018 06:26:42, 0, 1, 1, 645, 931, 0, 4096, 31100, 5, 5
My crond process is running

Code: Select all

root@vps618405:~# ps auxw | grep cron
root      1291  0.0  0.0  27728  2628 ?        Ss   Nov26   0:04 /usr/sbin/cron -f
Sudoes seems installed correctly

Code: Select all

root@vps618405:~# ls -al /etc/sudoers.d/
total 44
drwxr-x---  2 root root 4096 Nov 26 11:06 .
drwxr-xr-x 98 root root 4096 Dec  4 07:10 ..
-r--r-----  1 root root   28 Sep 28 17:55 01_zimbra
-r--r-----  1 root root   53 Sep 28 17:55 02_zimbra-core
-r--r-----  1 root root   91 Sep 28 17:55 02_zimbra-dnscache
-r--r-----  1 root root   49 Sep 28 17:55 02_zimbra-ldap
-r--r-----  1 root root  482 Sep 28 17:55 02_zimbra-mta
-r--r-----  1 root root   51 Sep 28 17:57 02_zimbra-proxy
-r--r-----  1 root root   55 Sep 28 17:55 02_zimbra-store
-r--r-----  1 root root  139 Nov 25 13:13 90-cloud-init-users
-r--r-----  1 root root  958 Mar 30  2016 README
thank for your help
User avatar
JDunphy
Outstanding Member
Outstanding Member
Posts: 889
Joined: Fri Sep 12, 2014 11:18 pm
Location: Victoria, BC
ZCS/ZD Version: 9.0.0_P39 NETWORK Edition

Re: Server Monitoring problem

Post by JDunphy »

I am not sure you answered my question... When you run this command, do you see entries very 2 mins?

Code: Select all

# su - zimbra
% grep STATUS /var/log/zimbra-stats.log
Dec  5 05:54:06 relay3 zimbramon[28308]: 28308:info: 2018-12-05 05:54:01, STATUS: mail.zanfel.org: zimbra: Running
Dec  5 05:54:06 relay3 zimbramon[28308]: 28308:info: 2018-12-05 05:54:01, STATUS: mail.zanfel.org: zimbraAdmin: Running
Dec  5 05:54:06 relay3 zimbramon[28308]: 28308:info: 2018-12-05 05:54:01, STATUS: mail.zanfel.org: zimlet: Running
Dec  5 05:54:06 relay3 zimbramon[28308]: 28308:info: 2018-12-05 05:54:01, STATUS: mail.zanfel.org: zmconfigd: Running
...
...
Dec  5 05:56:06 relay3 zimbramon[28842]: 28842:info: 2018-12-05 05:56:01, STATUS: mail.zanfel.org: amavis: Running
Dec  5 05:56:06 relay3 zimbramon[28842]: 28842:info: 2018-12-05 05:56:01, STATUS: mail.zanfel.org: antispam: Running
Dec  5 05:56:06 relay3 zimbramon[28842]: 28842:info: 2018-12-05 05:56:01, STATUS: mail.zanfel.org: antivirus: Running
....
If you don't have those STATUS lines, cron isn't working for you. To prove to yourself, you could run /opt/zimbra/libexec/zmstatuslog in a loop every 2 minutes to simulate what cron is doing and prove that your admin interface now shows all the services as up. ie.

Code: Select all

#!/bin/bash
        for i in `seq 1 10`;
        do
                echo $i
                /opt/zimbra/libexec/zmstatuslog
                sleep 120
        done   


Here is the code that generates the crontab from utilfunc.sh but now at: /opt/zimbra/libexec/installer/util/utilfunc.sh

Code: Select all

setupCrontab() {
  crontab -u zimbra -l > /tmp/crontab.zimbra.orig
  grep ZIMBRASTART /tmp/crontab.zimbra.orig > /dev/null 2>&1
  if [ $? != 0 ]; then
    cat /dev/null > /tmp/crontab.zimbra.orig
  fi
  grep ZIMBRAEND /tmp/crontab.zimbra.orig > /dev/null 2>&1
  if [ $? != 0 ]; then
    cat /dev/null > /tmp/crontab.zimbra.orig
  fi
  cat /tmp/crontab.zimbra.orig | sed -e '/# ZIMBRASTART/,/# ZIMBRAEND/d' > \
    /tmp/crontab.zimbra.proc
  cp -f /opt/zimbra/conf/crontabs/crontab /tmp/crontab.zimbra

  isInstalled zimbra-store
  if [ x$PKGINSTALLED != "x" ]; then
    cat /opt/zimbra/conf/crontabs/crontab.store >> /tmp/crontab.zimbra
  fi

  isInstalled zimbra-logger
  if [ x$PKGINSTALLED != "x" ]; then
    cat /opt/zimbra/conf/crontabs/crontab.logger >> /tmp/crontab.zimbra
  fi

  echo "# ZIMBRAEND -- DO NOT EDIT ANYTHING BETWEEN THIS LINE AND ZIMBRASTART" >> /tmp/crontab.zimbra
  cat /tmp/crontab.zimbra.proc >> /tmp/crontab.zimbra

  crontab -u zimbra /tmp/crontab.zimbra
}
Note: As for cron, make sure you are using the supplied tools to update the entries. Given there are so many versions of cron available, I don't know how to help you further as I am running centos ... In my environment, I use crontab -e to make changes, crontab -l to list, etc, etc.
Post Reply