---
title: "How to monitor Zimbra MailServer"
description: "Monitoring Zimbra MailServer requires installing a plugin, configuring NRPE, and setting appropriate sudo permissions on the server. This guide provides step-by-step instructions for plugin installation, NRPE setup, and adding the management pack in op5 Monitor."
url: "https://docs.itrsgroup.com/docs/faq/op5/360020055554-op5-monitor-how-to-monitor-zimbra-mailserver/index.html"
---
Articles in the Community-Space are not supported by op5 Support.

## Introduction

This how-to will help you monitor Zimbra 8 MailServer. This "how-to" is tested with the open source version but should work with the other versions as well.

## Prerequisites

Before we start there are a couple of things that needs to be working.

- Working Zimbra installation
- NRPE should be installed on the Zimbra server and allowing connections from the op5 Monitor server.
- You need root access to the Zimbra server

## About

This "how-to" require a plugin to be installed on the server and special sudo permissions.

## Installing plugin

1. Copy [this script](/faq/downloads/op5/360020055554-inline-attachment-1-check_zmstatus.pl) to the folder /opt/plugins/custom on your Zimbra server.
2. Change the permissions to 755 on the script.
3. Modify the sudo permissions with the command *visudo*
   1. Add the following lines to the configuration

      ```
      %zimbra ALL=NOPASSWD:/opt/zimbra/bin/zmcontrolnobody ALL=NOPASSWD:/opt/plugins/custom/check_zmstatus.pl
      ```

      This will allow the zimbra user to execute the zmcontrol command.

   2. Save the configuration

## Configure NRPE

NRPE needs to be updated, either put [this file](/faq/downloads/op5/360020055554-inline-attachment-2-zimbra.cfg) under /opt/nrped.d/ or add the following commands manually

```
command[zimbra_clamd]=/opt/plugins/check_clamd /opt/zimbra/data/clamav/clamav.sockcommand[zimbra_lmtp]=/opt/plugins/check_smtp -H localhost -p 7025command[zimbra_spellcheck]=/opt/plugins/check_http -H localhost -p 7780command[zimbra_dns]=/opt/plugins/check_dns -H google.comcommand[zimbra_cert]=/opt/plugins/check_http -S -H localhost -C 30command[zimbra_submission]=/opt/plugins/check_smtp -H localhost -p 587command[zimbra_imaps]=/opt/plugins/check_imap -H localhost -S -p 993command[zimbra_imap]=/opt/plugins/check_imap -H localhost -p 143command[zimbra_pop]=/opt/plugins/check_pop -H localhostcommand[zimbra_pops]=/opt/plugins/check_pop -H localhost -S -p 995command[zimbra_mailq]=/opt/plugins/check_mailq -w 5 -c 10 -M postfixcommand[zimbra_services]=/usr/bin/sudo /opt/plugins/custom/check_zmstatus.plcommand[zimbra_smtp]=/opt/plugins/check_smtp -H localhost
```

## Modify plugins settings

Edit the file /opt/plugins/utils.pm on the Zimbra server, change the line

```
$PATH_TO_MAILQ   = "";
```

to

```
$PATH_TO_MAILQ   = "/opt/zimbra/postfix-2.11.1.2z/sbin/mailq";
```

Verify the path so that that it corresponds with your Zimbra installation.

This will allow the plugin check\_mailq to find the path to you mail queue folder.

## Add Management Pack

In [this Management Pack](https://cdn.itrsgroup.com/zendesk/download/attachments/12190176/Zimbra%20MailServer.json?version=1&modificationDate=1417442408000&api=v2) all services are defined. Add the management pack using Management pack manager under Configure.

Depending on the services you make available on you Mailserver some services perhaps needs modification.

## Related downloads

- [check_zmstatus.pl](/faq/downloads/op5/360020055554-360029604894-check_zmstatus.pl)
- [zimbra.cfg](/faq/downloads/op5/360020055554-360030421073-zimbra.cfg)


