This custom trigger function is used to find the validity of host certificate(s) installed in JSCAPE MFT Server. This function use number of days as a parameter where the number of days say "n" is used to check the validity of the certificate prior (n days) to the expiry date.
See How to Create Custom Trigger Functions for details on installation.
How to validate a Host Certificates using IsCertificateValid Function
Let me now show you how to implement that.
1. Make sure you have IsCertificateValid function installed
Before creating a custom trigger using function IsCertificateValid, you need to have build installed in the server where JSCAPE MFT Server is running.
2. Create a Trigger to Validate Certificate
Login into admin console of JSCAPE MFT Server > Triggers and Click Add to create a Trigger
Give the trigger a Name and then select the Current Time event type from the drop-down list.
Click Next to Step 2 where a condition can be set to execute the trigger. Now Click Functions button to
select the IsCertificateValid function.
IsCertificateValid function has the below method signature
- IsCertificateValid (days)
This method signature is used to validate the certificate(s) prior to expiry date.
For example; Consider that you want to validate the certificate expiry before 30 days. Pass the argument as 30 to the function.
Since the event type is Current Time, on what time the trigger should be executed should be also set along with the IsCertificateValid function.
If the Trigger need to run on every day 10 PM add the condition Hour=22 along with IsCertificateValid function as shown below.
If the certficate(s) are to be validated before 30 days use the expression as;
Hour=22 And IsCertificateValid (30)=false
If the certficate(s) are about to expire the function will return false.
On Step 3 an action has to be added, in order to add an action click Add button and select the action "Send Email" from drop down list and Click OK
On OK to add and input the required parameters.
Enter all necessary parameters for sending that email notification, including the hostname of your SMTP server, the port number, connection type, etc. In the Body text box, enter the message you want to relay.
Click Ok to save the settings.
That's it. Now you know how to use the custom function IsCertificateValid and send an alert if certificate(s) are not valid.