New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


How can I monitor Exim queue length in PRTG?

Votes:

8

Your Vote:

Up

Down

Hi all! I wanted to share a little script I wrote for monitoring the length of an Exim mail queue on a Linux-based server using PRTG:

Step 1 Create a new bash script (named "exim.sh") containing the following:

#!/bin/bash

echo "[`/usr/sbin/exim -bpc`]" > "/public_html/eximqueue.txt"

This simple script queries the current number of messages in the Exim mail queue (exim -bpc), and writes this number to a text file on your web server - in the above example, "/public_html/eximqueue.txt" (Change this location to suite your particular server, but make sure it's a location that's accessible via your web browser)

Step 2 Save/Upload your exim.sh file to your server (i.e. to /var/prtg/scripts) and make sure its executable (CHMOD 755)

Step 3 Create a scheduled task (CRON job) to execute the .sh script at a recurring interval:

29,59 * * * * /var/prtg/scripts/exim.sh

Adding the above line to /var/spool/cron/root will execute the exim.sh script at 29 and 59 minutes past the hour (i.e. every 30 mins) - you can adjust the interval based on how much Exim activity you expect on your server.

Step 4 In your PRTG installation, create a new HTTP Content Sensor named "Exim Queue" with the following settings:

  • Make the "Script URL" the corresponding URL to the path you specified in the bash script in Step 1 - i.e http://yourdomain/eximqueue.txt
  • Set "Value Type" to Integer
  • Set "Number of Channels" to 1
  • Set the "Scanning Interval" to be the same as the interval you specified in your CRON job in Step 3 (there's no point in scanning at a shorter interval than the CRON job on your server is set to run)
  • Once the sensor has been created, you may wish to name the single channel "Queue Length" (or similar)

That's it! - You can now monitor the current status of your server's Exim queue in PRTG!

custom-sensor exim mail

Created on Jun 23, 2015 5:19:19 PM by  GreatMarko (8) 1

Last change on Jun 24, 2015 6:28:24 AM by  Felix Saure [Paessler Support]



1 Reply

Votes:

1

Your Vote:

Up

Down

Hi Marko,

Thank you very much for sharing this guide with the community! We appreciate it very much!

Best regards

Created on Jun 24, 2015 6:30:02 AM by  Felix Saure [Paessler Support]



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.