franktonjes wrote:
Hi All,
I've been looking at the /connect API and been wondering if anyone has managed to automate adding response tests at all?
It seems to be possible but I think there are many models with children and not sure how these are linked. I need to create a mesh of tests (ICMP) and doing it manually can take some time since each device needs to do an ICMP test to each other device. with 40+ devices that is a lot of tests!
Anyone have any ideas how this can be done, or perhaps have already ventured down this road?
Regards,
Frank
Frank, I've not used the API, but I've done bulk creation of SPM tests with CLI before.
I had a SystemEDGE server but you should be able to sub in your relevant source IPs.
Here's a write-up:
The following example describes how to use a spreadsheet program to generate a set of CLI commands to create SPM tests.
The example is for a DNS lookup test; different tests will have different fields, but the concepts should be similar.
The Spectrum attributes shown are the minimum attributes required in order to create a DNS lookup test with the CLI.
1.
Create an Excel spreadsheet with the following columns:
A – Destination Name – this is the name of the server or device to test
B – Test Type – for DNS lookup tests, the test type is 4
C – Source IP – this is the IP address of your SystemEDGE server, which will run the tests
D – Destination IP – This is the target IP address for the host in column A
E – Lookup Address – this is the DNS lookup to be performed
F – Latency Timeout (ms) – enter a value in milliseconds for the test to timeout
G – Schedule State – enter 1 to enable the test to run on the default 24/7 schedule
H – Repeat Interval (s) – enter a value in seconds for the test to repeat
I – Command – this column will build the CLI commands using a formula
J – Model Handle – this column will hold the created test model handles
2.
Populate cells in columns A,B,C,D,E,F,G,H with test values, starting in row 2.
3.
In cell I2, add the formula shown (the formula should be entered on a single line, with all double-quote characters entered exactly as shown):
=CONCATENATE( "create model mth=0x4560000
attr=0x1006e,val=""", A2, "_Internal DNS Lookup""
attr=0x4560005,val=", B2, " attr=0x4560006,val=", C2,
" attr=0x456001f,val=", D2, " attr=0x456000a,val=", E2,
" attr=0x4560025,val=", F2, " attr=0x4560022,val=", G2,
" attr=0x4560014,val=", H2, " >> TestCreation.log"
4.
Fill down the column. This creates the CLI commands that will be required to create the tests in bulk.
create model mth=0x4560000
attr=0x1006e,val="server1_Internal DNS Lookup"
attr=0x4560005,val=4 attr=0x4560006,val=10.120.16.25
attr=0x456001f,val=10.64.8.63 attr=0x456000a,val=www.url.com
attr=0x4560025,val=10000 attr=0x4560022,val=1
attr=0x4560014,val=600 >> TestCreation.log
5.
Copy column I to a CLI script; ensure that you enclose all the create commands within connect and disconnect commands.
6.
Execute the CLI script
7.
Paste the contents of TestCreation.log in column J, and save the spreadsheet for your records.
HTH,
--Mark S
Mark Serencha – Inforonics Global Services, LLC – (m) +1-781-439-0519 – Mark.Serencha_AT_inforonics.com