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.
Add comment