Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions nspepi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ The following modules are the prerequisites for using these tools:
- Ply module for Python
- Switch.pm for Perl

If python3 is installed, then please create a symbolic link for python like "ln -s /usr/bin/pytho3 /usr/bin/python".

Commands to install pip, ply and Switch.pm modules in CentOS:
sudo yum install -y perl-Switch
sudo yum install python-pip
sudo yum install python-ply

Commands to install pip, ply and Switch.pm modules in Ubuntu:
sudo apt install libswitch-perl
sudo apt install python-ply
sudo apt install python-pip

## Pre-validation tool for removed or deprecated features in Citrix ADC version 13.1

This is a pre-validation tool to check if any deprecated functionality that is removed from Citrix ADC 13.1 is still used in the configuration for your current release. If the validation result shows usage of a deprecated functionality, then before upgrading your appliance, you must first modify the configuration to the Citrix recommended alternative. You can modify the configuration either manually or using the NSPEPI tool.
Expand Down
52 changes: 44 additions & 8 deletions nspepi/check_invalid_config
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,71 @@ if (!($python_module_list =~ m/\bply==/)) {


my $number_args = $#ARGV + 1;
if ($number_args != 1) {
print "Usage: check_invalid_config <ns_config_file>\n";
if ($number_args > 3) {
tool_usage();
exit;
}

my($buildVersion) ="13.1";
my @allowed_build_versions = ("13.1", "14.1");

if ($number_args == 3) {
if (uc($ARGV[1]) ne "-BUILDVERSION") {
tool_usage();
exit;
}
$buildVersion = $ARGV[2];
if (not grep(/^$buildVersion/, @allowed_build_versions)) {
print "Incorrect build version\n";
exit;
}
} elsif ($number_args > 1) {
print "Incorrect parameters\n";
tool_usage();
exit;
}

my $config_file = $ARGV[0];
if (not -e $config_file) {
print "No such file: $config_file\n";
exit;
}

sub tool_usage() {
print "Usage: check_invalid_config <ns_config_file> -buildVersion <Build version for which invalid or depreacted commands need to check>\n";
}

my($filename, $dir_path) = fileparse($config_file);

my $dirname = dirname(__FILE__);
my $exit_status = system("python $dirname/nspepi2/config_check_main.py -f $config_file");
my $exit_status = system("python $dirname/nspepi2/config_check_main.py -f $config_file -B $buildVersion");
if ($exit_status != 0) {
print "Error in checking config file: $exit_status";
exit;
}
my $invalid_config_file = $dir_path."/issues_".$filename;
my $deprecated_config_file = $dir_path."deprecated_".$filename;

# Checks whether any command is present in the file
if (!(-z $invalid_config_file)) {
print "\nThe following configuration lines will get errors in 13.1 and both they and dependent configuration will be removed from the configuration:\n";
system("cat $invalid_config_file");
print "\nThe nspepi upgrade tool can be useful in converting your configuration - see the documentation at https://docs.citrix.com/en-us/citrix-adc/current-release/appexpert/policies-and-expressions/introduction-to-policies-and-exp/converting-policy-expressions-nspepi-tool.html.\n";
print "\nNOTE: the nspepi tool doesn't convert the following configurations:\n\t1. SureConnect commands\n\t2. PriorityQueuing commands\n\t3. HTTP Denial of Service Protection commands\n\t4. Classic SSL commands\n\t5. HTMLInjection commands.\n";
print "\nThe following configuration lines will get errors in ".$buildVersion." and both they and dependent configuration will be removed from the configuration:\n";
system("cat $invalid_config_file");
print "\nThe nspepi upgrade tool can be useful in converting your configuration - see the documentation at https://docs.citrix.com/en-us/citrix-adc/current-release/appexpert/policies-and-expressions/introduction-to-policies-and-exp/converting-policy-expressions-nspepi-tool.html.\n";
print "\nNOTE: the nspepi tool doesn't convert the following configurations:\n\t1. SureConnect commands\n\t2. PriorityQueuing commands\n\t3. HTTP Denial of Service Protection commands\n\t4. Classic SSL commands\n\t5. HTMLInjection commands.\n";
if (!(-z $deprecated_config_file)) {
print "\nNOTE: some deprecated commands have also been detected in the config file, please check ".$deprecated_config_file." file for the deprecated commands.\n";
} else {
print "\nNOTE: No deprecated commands detected in the configuration.\n";
}
} else {
print "\nNo issue detected with the configuration.\n";
if (!(-z $deprecated_config_file)) {
print "\nThe following configuration lines have been deprecated in ".$buildVersion." and will be removed in future releases:\n";
system("tail -n 10 $deprecated_config_file");
print "\nFor the complete deprecated commands, please see the output of ".$deprecated_config_file." file.\n";
print "\nNo invalid config detected with the configuration.\n";
} else {
print "\nNo invalid or deprecated config detected with the configuration.\n";
}
}
print "\nUse pre-validation tool and nspepi tool available at https://github.com/citrix/ADC-scripts/tree/master/nspepi for the most complete and up-to-date version.\n"
### End check_invalid_config script
Loading