How can we use PI AF SDK to create a mail notification when MDB to AF Sync fails?
When ever PI-AF to MDB breaks, it must send email notifications to the users. Please help on this.
You can use of the performance monitor tag PI Base Subsystem > "MDB-AF health tag" for the synchronization status monitoring.
0 - InSync
1 - SyncInProgress.
2 - OutOfSync.
Greater than 2 - Refers to a problem that can be solved by itself or may require an additional action depending on the error code.
Attribute should contains this tag value and you can set Notification trigger condition for this attribute value like "MDB-AF health tag > 0".
Do you want to create this Notification by AFSDK automatically? You can configure it by PI System Explorer.
Thanks for the reply!!
I tried it in the AF explorer but it is not sending the notifications automatically. The conditions are as under:
if 'aps65 pibase subsystem MDB-AF Health' = 0 then send email...
Have you tried enable the notification
Adding Henlo's comments, screen shot's trigger condition syntax shows 'aps65 pibase subsystem MDB-AF Health' = 0. 0 means InSync.
If you want to get the notification when AFLync failes, it should be 'aps65 pibase subsystem MDB-AF Health' > 0.
Or 'aps65 pibase subsystem MDB-AF Health' => 1
Are you testing your notification and that is why your syntax is 'tag' =0?
Please check error message in PI Message logs. Debug option is also helpful.
Thanks a lot!!
It has worked for me after clicking the play button of the notifications section.
Retrieving data ...