This technique uses an HTTPS connection and PRTG’s integer type to keep track of the queue size.
You have to pick a “static” site on your server, ie. one that will never be deleted.
The contents of exim.sh is:
#!/bin/bash echo "[`/usr/sbin/exim -bpc`]" > "/home/domain/public_html/exim/eximqueue.txt"
The CRON required is this:
* * * * * /bin/sh /home/domain/public_html/exim/exim.sh
Now every minute it will count the message and output a text file. For example:
cat eximqueue.txt 
Now in PRTG you can use the HTTP content sensor that looks like this:
When adding the PRTG sensor, specify the path to the website TXT file, e.g. https://domain.com/exim/eximqueue.txt