Hello all,
Just wanted to write some words on AirRecorder usage (or any script for that matter). When running scripts against a production system, it's always good to consider some 'what ifs' and adhere to some best practice before you unleash your creation :smileyhappy:
> test test test... in a lab or anywhere else where it's ok for something to go wrong. Whether it's 3 lines or 300 lines, test it in the lab first, because you surely dont want to find out that the single apboot command actually was a typo for reboot on the controller etc.
> some CLI commands send a request to the AP and wait for a response - radio stats, ap debug cilent-table are examples - what if the network or connection to the APs is not stable ? Perhaps you have seen before when a AP is non responsive say during reboot or upgrade etc, if you try to run a CLI command against it, it will take some time to timeout. What is going to happen to your script if this happens ?
> don't automate lengthy output commands - for example, 'show ap tech-support' is something that would not be desirable to script. Besides, it is but a series of CLI commands itself, so dig out the one(s) you are interested and script them directly.
> Controller CLI only supports 8 concurrent SSH sessions, a hung ssh session takes some time to timeout. Airrecorder will connect once and sit there running commands, but you could also write AirRecorder to connnect and run a one time command, sleep and then connect again (i.e. wrap it in a shell script, cronjob etc). Care and consideration must be given in the case where AirRecorder is continually logging in and logging out - what happens if you lock out the controller SSH ? One sideeffect is that Airwave will fail to login.
> Be a nice CLI user... Whilst a script can execute commands "as fast as the controller can take them" - humans don't (usually) work as fast. This means it is easy to create a load on the controller that is not represenative of the usual steady state. That may or may not be a bad thing, but consider an example where you are trying to watch CPU load. The more frequently and faster you start use the CLI, the more CPU you are actually going to use - it's going to skew your result. Hence, your data collection intervals should be chosen carefully.
AirRecorder supports a handy CLI option --post-command-delay <delay in ms> to allow some breathing room after each command. On a heavily loaded production system, it would be advisable to use something like 100ms, 200ms (typical). Of course there may be a legitimate reason to run the commands as fast as possible, or the #ap x command delay is too long (remember that AirRecorder is syncronous), but slower is better !
regards
-jeff