Today I was able to test the script, but unfortunately it does not work as expected.
I put it directly on the management server itself, however, it throws a KeyError each time I try to execute it.
The output below shows what I enter and also the error code which is shown afterwards. Please notice that I changed the input by removing the IP address as well as the username and the rulebase name. Those parameters shouldn't be the cause of my issue, as the login appears to fine & the rulebase that I want to export as a csv can be found (I verified this by entering a wrong rule base name and received a different error which said that the rule base could not be found).
./rulebasecsv.py -o test.csv -u [MYUSERNAME] -t access -m [MGMT_SERVER_IP] -i [MY_RULEBASE_NAME]
Enter password:
Traceback (most recent call last):
File "./rulebasecsv.py", line 392, in <module>
main()
File "./rulebasecsv.py", line 68, in main
elif args.type[0] == "access": print_access_control_rulebase_csv(rulebase, session, args.output[0])
File "./rulebasecsv.py", line 252, in print_access_control_rulebase_csv
access_control_rulebase_csv(get_rulebase("access", rulebase, session), session, output_file)
File "./rulebasecsv.py", line 260, in access_control_rulebase_csv
print(print_access_rule(rule, parent_prefix=parent_prefix, enabled=enabled), file=outputfile)
File "./rulebasecsv.py", line 267, in print_access_rule
string += print_field_csv(rule["rule-number"], parent_prefix=parent_prefix, enabled=(enabled and rule["enabled"]))
KeyError: 'rule-number'
I tried several rule bases but the "KeyError: 'rule-number' is shown for each one. I also tried to change the IP address to 127.0.0.1 instead of the actual IP of the servers interface (as I am running this script locally from the management server), but this does not change anything as well. The management server runs version 80.10 and Python version 2.7.
Hopefully somebody experienced this issue before and can help me.
Thanks in advance for any advice!
Regards,
Maik