I have created an Exchange Mailbox (Powershell) sensor which is retrieving the relevant information for my chosen mailbox. I would now like to create a trigger which sends a push notification when the 'Item Count' channel value changes.

I have created a "Change Trigger" on the notification triggers tab for the sensor, but it doesn't send any notification when an email is received into the mailbox even though the count does increment. Have I missed something?

As an alternative way to achieve what I would like to do I have also created an IMAP sensor which returns a count of the number of emails in the mailbox as the "Mailbox Size" channel. However, that sensor doesn't even have the option to create a "Change Trigger".

Is there any way of triggering a notification upon a change of email count in a mailbox? Using either of the above methods or any other way.


Article Comments

Hi there,

I'm afraid "Change Triggers" do not work with these sensors, there are only a few sensors that can be used with change triggers, those have then also a dedicated option for this in their "Settings" to enable change triggers. Of course it is confusing that there is an option to add a change trigger in the exchange sensor although it has no effect, I won't argue with that :)

One option would be to work with classic limits by clicking on the channel and setting limits for warning and/or error combined with a "State Trigger", of course that's not the same as the change trigger approach, but there is simply no sensor for your needs that does this, I'm afraid.

Kind regards,

Erhard


Oct, 2018 - Permalink

As a workaround, you can have your script write the item count to a text file and compare it with each run.

If the count changes, have the sensor return a warning state and use a State Trigger to send the notification


Oct, 2018 - Permalink

Thanks for the replies both. I used PRTGToolsFamily's advice and got this working by doing the following.

1: Set my IMAP email count sensor to write the sensor result to disk.

2: Wrote a powershell script which parsed the email count from the above file as an integer value and appended :OK to the end.

3: Used an EXE/Script sensor to run the above powershell script and set it to trigger a change notification if the value changes.

4: Finally, created a Change Trigger to perform a push notification to a group of users upon sensor change.

Not the most elegant way of doing things, but it seems to work!


Nov, 2018 - Permalink