2
Smartermail queue monitor with Zabbix
Question asked by Alex Johnson - 12/20/2017 at 6:59 AM
Answered
We have an email server with Smartermail 15.x and sometimes emails get stuck in the spool for various reasons and there is no way of finding out about this unless somebody checks the spool manually.
 
I'd really like to be able to monitor the spool email counts remotely via our monitor server (Zabbix) or even with a set of PHP scripts like this ( https://exchange.nagios.org/directory/Plugins/Email-and-Groupware/Others/Check-SmarterMail-Queue--2D-check_queue_sm/details )
 
The documentation of API is available here ( https://mail.smartertools.com/Services/svcServerAdmin.asmx?op=GetSpoolMessageCount ) but I don't know how to implement it.

5 Replies

Reply to Thread
0
Employee Replied
Employee Post Marked As Answer
Alex,
 
The script provided looks fairly straight forward:
 
define command { 
command_name check_queue_sm 
command_line $USER1$/check_queue_sm -H=$HOSTADDRESS$ -P=$ARG1$ -p=$ARG2$ -w=$ARG3$ -c=$ARG4$ 
 
You'll just need to modify the variables. $USER1$ should be the primary system administrator account for SmarterMail, by default this is 'Admin'
 
$HOSTADDRESS$ is referring to the host address of your smartermail server, for example mail.domain.com
 
$ARG1$ appears to be the port used to access the SmarterMail web interface, I'm unaware if this script supports HTTPS calls
 
$ARG2$ appears to be the password for the systems administrator account
 
$ARG3$ appears to be the warning limit for Zabbix, if this is set to 200, a warning will be thrown when the spool backs up to 200 messages
 
$ARG4$ appears to be the critical error limit for Zabbix. 
 
Fully configured the script should resemble the following:
 
define command { 
command_name check_queue_sm 
command_line Admin/check_queue_sm -H=mail.smartertools.com -P=PassWordForAdmin -p=80 -w=200 -c=400
 
This appears to be a very primitive script that just tracks the spool count. What you may actually be interested in is a WMI sensor that can monitor file counts and the oldest file in the folder, this way you can set a trigger if any message resides in the spool for longer than X days, hours, minutes, etc. I'm unsure if Zabbix offers this functionality. This functionality does exist in monitoring platforms such as PRTG and SolarWinds. 
 
I hope this helps.
0
Alex Johnson Replied
Thank you for the reply.

The script you have mentioned belongs to Nagios and it does not work under Zabbix. I've tried to call the PHP script directly but it gave me an error about "mx_wsdl.php" file which is "SmarterMail Webservice Library".

Zabbix supports WMI queries "https://www.zabbix.com/documentation/3.2/manual/config/items/itemtypes/zabbix_agent/win_keys" but I don't know which folder inside the spool directory do I have to monitor.
0
Employee Replied
Employee Post
Please note the mx_wsdl.php file is not a file that's included with SmarterMail, as SM does not leverage PHP in any of its code. I believe the SmarterMail WebService Library is referring to the WSDL listing for the desired web service.

For example: https://mail.smartertools.com/Services/svcServerAdmin.asmx?WSDL

You would just need to point the URL to your SmarterMail server.

Regarding the Zabbix WMI query, I would recommend configuring a monitor for each of the SubSpool folders as these folders will contain the EML and HDR files that will need to be monitored.

I hope this helps.
0
Alex Johnson Replied
Thank you.
0
s k Replied
Can you provide the steps to monitor smartermail queue in zabbix

Reply to Thread