What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Threshold Trigger more than once

Votes:

0

Hello,

i need to monitor a mailbox via IMAP and trigger notifications whenever a new mail comes in. So i added a IMAP Sensor and its working fine monitoring the amount of new mails in the inbox.

But i only get a notification once. When the value increases i dont get a notification anymore because the system triggered a notification before. I tried to use a threshold trigger whenever amount of mails in inbox is above 0. Also i changed the upper threshold for errors in the channel and set a state trigger whenever sensor is in a error state.

So what i want is a notification everytime the value increases.

Kind regards

imap notification prtg state threshold

Created on Nov 18, 2021 9:55:38 AM



Best Answer

Accepted Answer

Votes:

1

Hello Jonathan,

unfortunately when the imap sensor goes down-state, it stays in down state and triggers a notification once. Or the nearest to get is to consider only include recent emails younger than 1 hour. So the Sensor would be OK again after 1 hour if no new email for the configured filter is received. I need to be informed for every email received separately.

So how i solved it was following: 1. Set IMAP Sensor to "Count Emails" and "Save Sensor Output" as a file. 2. New EXE-Sensor / Powershell:

####################
param(
    $sensorids="1234,5678"
)

$sensorids=$sensorids -split ','
[int]$totalamount_Mails=0
[string]$totalamountMailsString

foreach ($sensorid in $sensorids) {
$filepath="C:\ProgramData\Paessler\PRTG Network Monitor\Logs\sensors\Result of Sensor $($sensorid).txt"
$filecontent=Get-Content $filepath 
$amountMailsString=$filecontent -match "Mails in mailbox: "
$amountMailsInteger=$amountMailsString -replace "[^0-9]"
$totalamount_Mails+=$($amountMailsInteger)
}
[string]$outputcode=":OK"
Write-Output "$totalamount_Mails$outputcode"
#####################

3. Set Parameters of Exe-Sensor: "-sensorids 1234,5678" and set "Change Trigger"

Now with this workaround i have a change trigger for every prtg-sensor which has no change trigger. This solved my problem.

Created on Dec 6, 2021 3:47:36 PM



4 Replies

Votes:

0

Perhaps instead of using a State trigger you can use a change trigger, this would notify when there is a change. If you dont see this option you can contact us directly so we can check better with some screenshots. At [email protected]

Created on Nov 23, 2021 12:02:20 AM by  Jonathan Mena [Paessler Technical Support]



Votes:

0

@Jonathan Mena

The IMAP Sensor does not have a change trigger, unfortunately.

Created on Nov 23, 2021 7:46:43 AM



Votes:

0

If the emails usually come with the same subject you can create filters in the sensor so that a message with that subject sets the sensor as down and then create a state trigger to alert for each message that comes. You can check the filter settings in the IMAP sensor manual

Created on Nov 24, 2021 11:18:13 PM by  Jonathan Mena [Paessler Technical Support]



Accepted Answer

Votes:

1

Hello Jonathan,

unfortunately when the imap sensor goes down-state, it stays in down state and triggers a notification once. Or the nearest to get is to consider only include recent emails younger than 1 hour. So the Sensor would be OK again after 1 hour if no new email for the configured filter is received. I need to be informed for every email received separately.

So how i solved it was following: 1. Set IMAP Sensor to "Count Emails" and "Save Sensor Output" as a file. 2. New EXE-Sensor / Powershell:

####################
param(
    $sensorids="1234,5678"
)

$sensorids=$sensorids -split ','
[int]$totalamount_Mails=0
[string]$totalamountMailsString

foreach ($sensorid in $sensorids) {
$filepath="C:\ProgramData\Paessler\PRTG Network Monitor\Logs\sensors\Result of Sensor $($sensorid).txt"
$filecontent=Get-Content $filepath 
$amountMailsString=$filecontent -match "Mails in mailbox: "
$amountMailsInteger=$amountMailsString -replace "[^0-9]"
$totalamount_Mails+=$($amountMailsInteger)
}
[string]$outputcode=":OK"
Write-Output "$totalamount_Mails$outputcode"
#####################

3. Set Parameters of Exe-Sensor: "-sensorids 1234,5678" and set "Change Trigger"

Now with this workaround i have a change trigger for every prtg-sensor which has no change trigger. This solved my problem.

Created on Dec 6, 2021 3:47:36 PM




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.