Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
external-header-nav
keyboard_arrow_up
close
keyboard_arrow_left
NorthStar Planner User Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Running External Compliance Assessment Scripts

date_range 09-Nov-23

An external script can also be called by the conformance template. Any programming language can be used to write the script as long as it can be called from the command line. In order to display the script results in the Compliance Assessment window’s Detailed Results tab, the script’s output should be comma-separated, including the following details on each line:

content_copy zoom_out_map
Message,Severity,Hostname,Config File,Block,Lines,Template,Rule,Template
Lines,Template Line,Template Line #,Category,Vendor,OS,Version

(Alternatively, the output could also be redirected to a separate file, rather than appended to the Detailed Results tab, in which case it could be in any format.)

In the following example, the perl script myscript.pl would be executed using the specification file as one of its inputs. This perl script checks to see if links of a given trunk type have the recommended ISIS metric for that trunk type. The perl script’s output is then appended to the Detailed Results table.

content_copy zoom_out_map
#conform type cisco ios
@define external isis_metric_check output=append
./external/edit_check_isis_metric.pl ./spec/spec.auto

To see the example perl script used in this example, refer to IP Manipulation. Note that this particular script parses link information from the bblink file. At the end of the script, the print statement outputs to the CSV format with the appropriate fields to append to the compliance assessment detailed results table:

content_copy zoom_out_map
print "$msg,$severity,$node,$source,,,external,$rule_name,,,\n".

For further information on external scripts, see Building Templates.

external-footer-nav