# Automated Class-List on AX series

**URL:** <https://community.a10networks.com/t/automated-class-list-on-ax-series/314>\
**Category:** ADC - Application Delivery\
**Tags:** class-list\
**Created:** [February 25, 2015, 1:08pm UTC](https://community.a10networks.com/t/automated-class-list-on-ax-series/314 "2015-02-25T13:08:33Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![igb](https://avatars.discourse-cdn.com/v4/letter/i/9fc29f/32.png) [@igb](https://community.a10networks.com/u/igb)\
**Post date:** [February 25, 2015, 1:08pm UTC](https://community.a10networks.com/t/automated-class-list-on-ax-series/314/1 "2015-02-25T13:08:33Z")

</div>

I want to maintain Class-Lists by automated scripts on our AX 1030. As far as I know, this isn’t possible (yet) by aXapi, so I made an attempt through some PowerShell scripting. What I’m trying to do, is scripting a SSH session to the device and exporting the class-list to an external location where we can edit the list. After editing I want to put it back on AX 1030 again.

As long as I’m using a CLI and manually give some commands to the AX’s shell, everything works fine. But when I’m trying to put commands through a script to the AX’s shell, it will always give this error: /a10/bin/rimacli: invalid option — c, no matter what command is given. Besides PowerShell I tried the same thing by a bash script from a linux based system, but it returns the same error on every command as well.

Why am I getting this error and why do the same commands work fine when entered manually?

If there’s an other (easier) method to achieve this, please be my guest! We really need to automate Class-Lists on our device.

---

<div class="post-metadata">

**Author:** ![dshin](https://avatars.discourse-cdn.com/v4/letter/d/f05b48/32.png) [@dshin](https://community.a10networks.com/u/dshin)\
**Post date:** [February 25, 2015, 6:15pm UTC](https://community.a10networks.com/t/automated-class-list-on-ax-series/314/2 "2015-02-25T18:15:54Z")

</div>

I understand the use case and I can recommend a solution to automate and maintain the class script. However, before I provide a solution I would like to explain why you are constantly getting the /a10/bin/rimacli/ invalid option error. The reason is because when you issue the command script you have no access rights to the ACOS shell. Hence, any commands issued are invalid and denied. The ACOS shell is secured and only used for A10 Support to debug problems.

```auto
So as a solution to your problem you can execute the following commands by using an import class-list command and this can be configurable based on periodic intervals(secs) ranging from . 

Command for 2.7.1 Px to 2.7.2 Px
ACOS(config)\#import class-list xyz scp://root@example.com/dir period 60

```

With the assumption that the ACOS build that you are using is on build 2.7.x or higher. If you are using 4.0 build then the CLI commands change but the application is the same. So the command for 4.0 will be “import-periodic class-list”

Any issues please let me know.

Genard

---

<div class="post-metadata">

**Author:** ![igb](https://avatars.discourse-cdn.com/v4/letter/i/9fc29f/32.png) [@igb](https://community.a10networks.com/u/igb)\
**Post date:** [February 26, 2015, 8:01am UTC](https://community.a10networks.com/t/automated-class-list-on-ax-series/314/3 "2015-02-26T08:01:55Z")

</div>

That sounds like a nice solution to me! We’re on 2.7.2 P3, so I should give it a try. Thanks for the answer and I will keep the results posted in this topic.

---

<div class="post-metadata">

**Author:** ![igb](https://avatars.discourse-cdn.com/v4/letter/i/9fc29f/32.png) [@igb](https://community.a10networks.com/u/igb)\
**Post date:** [February 27, 2015, 12:09pm UTC](https://community.a10networks.com/t/automated-class-list-on-ax-series/314/4 "2015-02-27T12:09:54Z")

</div>

It almost worked out for me, but I’m stuck at another issue right now. When I schedule the import through the CLI it will directly import the class-list one time, which results in the following log: Imported file xyz from \*\*\* using scp. So everything seems te bo fine.

But all the next attempts by the given period will result in:  
Failed to copy /a10data/tmp/class-list/xyz from \*\*\* ,errno: 1, block size: 0  
There isn’t even a connectionattempt on our external server.

What is going wrong, or where can I find some additional info on errno: 1?

Another question:  
How can I disable a schedule? I tried period 0, period -1, stop, off. I scheduled it by the max value for now.

---

<div class="post-metadata">

**Author:** ![igb](https://avatars.discourse-cdn.com/v4/letter/i/9fc29f/32.png) [@igb](https://community.a10networks.com/u/igb)\
**Post date:** [March 4, 2015, 10:12am UTC](https://community.a10networks.com/t/automated-class-list-on-ax-series/314/5 "2015-03-04T10:12:45Z")

</div>

Does anyone have a suggestion? I’m still struggling with this issue.

---

<div class="post-metadata">

**Author:** ![dshin](https://avatars.discourse-cdn.com/v4/letter/d/f05b48/32.png) [@dshin](https://community.a10networks.com/u/dshin)\
**Post date:** [March 5, 2015, 3:20am UTC](https://community.a10networks.com/t/automated-class-list-on-ax-series/314/6 "2015-03-05T03:20:16Z")

</div>

So this is the command used on the test lab and it works.

import-periodic class-list test\_cl tftp://10.100.2.x/test\_cl period 60  
Can you please provide your class-list data so I can try on my lab?

---

<div class="post-metadata">

**Author:** ![igb](https://avatars.discourse-cdn.com/v4/letter/i/9fc29f/32.png) [@igb](https://community.a10networks.com/u/igb)\
**Post date:** [March 5, 2015, 8:17am UTC](https://community.a10networks.com/t/automated-class-list-on-ax-series/314/7 "2015-03-05T08:17:39Z")

</div>

Your command is unrecognized on our device. It doesn’t recognize “import-periodic”. I use the following command: “import class-list igb scp://user:pass@address:port/igb period 60”

The class-list is exported through scp as well and contains the following content:  
; class-list-type string  
; Class list - igb

; String (Total: 2)  
str 54321 54321  
str 12345 12345

As I said before, the first attempt on importing the class-list will run directly on the CLI and succeeds, but all next attempts by de schedule wil fail in: Failed to copy /a10data/tmp/class-list/igb from \*\*\* ,errno: 1, block size: 0.  
Thanks in advance for testing.

---

<div class="post-metadata">

**Author:** ![dshin](https://avatars.discourse-cdn.com/v4/letter/d/f05b48/32.png) [@dshin](https://community.a10networks.com/u/dshin)\
**Post date:** [March 5, 2015, 6:31pm UTC](https://community.a10networks.com/t/automated-class-list-on-ax-series/314/8 "2015-03-05T18:31:44Z")

</div>

I did an actual test on my lab and here’s the results using the following command string(provided). It works on my setup based on 2.7.2 code. Protocol used should not make a difference SCP, SFTP, TFTP or FTP.

“import class-list genard tftp://10.6.4.22/genard period 60”

AX1030(config)#show class-list genard  
Name: genard  
Total String: 3  
Content:  
&nbsp;&nbsp;&nbsp;&nbsp;str 54321 54321  
&nbsp;&nbsp;&nbsp;&nbsp;str 12346 12346  
&nbsp;&nbsp;&nbsp;&nbsp;str 12345 12345  
AX1030(config)#  
In the interest of time, I suggest that you open a support case with our A10 TAC and we can resolve the problem ASAP. I hate to delay a solution further.

Genard

---

<div class="post-metadata">

**Author:** ![igb](https://avatars.discourse-cdn.com/v4/letter/i/9fc29f/32.png) [@igb](https://community.a10networks.com/u/igb)\
**Post date:** [March 6, 2015, 2:49pm UTC](https://community.a10networks.com/t/automated-class-list-on-ax-series/314/9 "2015-03-06T14:49:24Z")

</div>

I noticed there are some aXapi methods to maintain class-lists I didn’t know about.  
These methods are

```auto
- slb.class\_list.string.create
- slb.class\_list.string.update
- slb.class\_list.string.delete

```

I’ll have a look on those first, because I prefer aXapi above the period schedule.

---

<div class="post-metadata">

**Author:** ![dshin](https://avatars.discourse-cdn.com/v4/letter/d/f05b48/32.png) [@dshin](https://community.a10networks.com/u/dshin)\
**Post date:** [March 6, 2015, 4:00pm UTC](https://community.a10networks.com/t/automated-class-list-on-ax-series/314/10 "2015-03-06T16:00:24Z")

</div>

```auto
Perfect! See the samples below and this should support 2.7.2 P3. 

http(s)://(IP):[Port:]/services/rest/V2.1/?session\_id=[SESSION\_ID]&format=jason&method=slb.class\_list.string.create
http(s)://(IP):[Port:]/services/rest/V2.1/?session\_id=[SESSION\_ID]&format=jason&method=slb.class\_list.string.update
http(s)://(IP):[Port:]/services/rest/V2.1/?session\_id=[SESSION\_ID]&format=jason&method=slb.class\_list.string.delete

```

---

<div class="post-metadata">

**Author:** ![igb](https://avatars.discourse-cdn.com/v4/letter/i/9fc29f/32.png) [@igb](https://community.a10networks.com/u/igb)\
**Post date:** [March 19, 2015, 4:03pm UTC](https://community.a10networks.com/t/automated-class-list-on-ax-series/314/11 "2015-03-19T16:03:04Z")

</div>

I forgot to reply on this topic, but these methods work like a charm on aXapi.
