Customize scripted extension points
Customize how license expiration dates for Fortinet devices are stored on CIs by implementing scripted extension points.
Before you begin
Service Graph Connector for Fortinet must be installed. For instructions, see Configure a Fortinet SD-WAN Service Graph Connector.
Role required: tsom_visibility_admin
About this task
By default, Fortinet SGC stores license expiration dates as separate CI key-value pairs for each device, using the naming convention license_expiration_date_*SERVICE\_CODE*. You can customize this behavior using scripted extension points to implement alternative storage logic, such as storing only the earliest expiration date across all devices.
Procedure
Navigate to All > System Scripted Extension Points > Scripted Extension Points.
Search for Fortinet in the Extension Points search field.
From the API Name search results list, select sn_gnc_fortinet.FortinetCustomizedContractParsing.
Select the Create implementation related link.
In the Script field, modify the
buildLicenseAttributesfunction to return an array of{key, value}objects containing the CI key-value pairs you want to store.For example, to store only the earliest expiration date across all devices instead of one key-value pair per device, the script would need to loop through
contractItems, find the minimum date value, and return it as a single object:{ key: "license_expiration_date", value: "<earliest_date>" }.
Contract items parsing implementation interface
Run your implementation before the default by setting the Order field to a value less than
100.The default implementation has an order of 100; implementations with a lower order number execute first and take precedence.
Select Update.
Result
Your custom implementation is saved and active. The next time Fortinet SGCSGC discovers devices, your script runs first and stores the license key-value pairs you defined on the relevant CIs, overriding the default per-device key-value pairs behavior.
Related topics