Skip to content

Commit

Permalink
Disabling SCP for apc_aos for now
Browse files Browse the repository at this point in the history
We have to wait until Net::SCP has been fixed in order to support SCP
for apc_aos
This has been documented in a new Model Note
(Fixed Rubocop Warnings introduced by a previous commit)
  • Loading branch information
robertcheramy committed Feb 27, 2024
1 parent bdd6891 commit 6ec8ee5
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ Style/ParallelAssignment:
Enabled: false

Metrics/MethodLength:
Max: 45
Max: 50

## Metrics/AbcSize:
## Max: 28
Metrics/AbcSize:
Max: 28

Metrics/ClassLength:
Max: 200
Expand Down
14 changes: 7 additions & 7 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-01-16 10:57:24 UTC using RuboCop version 1.60.0.
# on 2024-02-27 14:27:59 UTC using RuboCop version 1.60.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 64
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
# Offense count: 27
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
Metrics/AbcSize:
Max: 92
Enabled: false

# Offense count: 16
# Offense count: 17
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Max: 12

# Offense count: 13
# Offense count: 14
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Max: 12
Expand Down Expand Up @@ -84,7 +84,7 @@ Style/RegexpLiteral:
Style/SlicingWithRange:
Enabled: false

# Offense count: 82
# Offense count: 83
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Mode.
Style/StringConcatenation:
Expand Down
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- Fix potential busy wait when retries and/or next_adds_job is enabled (@gs-kamnas)
- Reverting PR #2498 as it broke old procurve models (2510G, 2610, 2824). Fixes #2833, #2871 (@robertcheramy)
- Fixed regexp used to remove secrets in nxos model. Fixes #3080 (@desnoe)
- apc_aos: fixed ftp and scp. Fixes #1802 (@robertcheramy)

## [0.29.1 - 2023-04-24]

Expand Down
52 changes: 52 additions & 0 deletions docs/Model-Notes/APC_AOS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# APC AOS Configuration

Currently, the configuration of APC Network Management Cards can be downloaded with FTP only.

A download of the configuration with SCP is [work in progress](https://github.com/ytti/oxidized/issues/1802).
As the APC has an unusual behavior (the connection is closed without an exit-status), this has to be
[fixed](https://github.com/net-ssh/net-scp/pull/71) upstream in [Net::SCP](https://github.com/net-ssh/net-scp).
As soon as there is a release of Net::SCP supporting the behavior of APC OS, we will activate SCP in oxidized.

## Can I collect more information than just the configuration?
APC OS does not have the ability to show the config.ini within an SSH-session. As oxidized can only get the
configuration with one input type at a time, it is not possible to fetch config.ini via FTP/SCP and get the output of
some commands via SSH at the same time.

A ticket has been opened with APC support in order to support "cat config.ini" within an SSH-session, but
the chances it will be supported at some time are not very good, and older versions will still not support it.

## How do I activate FTP input?
In order to download the configuration with FTP (and in the future with SCP), you have to activate it as an
input in the oxidized configuration. If you do not activate the input, oxidized will fail for the node with
a rather unspecific error (`WARN -- : /apc status fail, retry attempt 1`).

The configuration can be done either globally or only for the model apc_aos.

The global configuration would look like this. Note that Oxidized will try every input type in the given order
until it succeeds, or it will report a failure.
```yaml
input:
default: ssh, ftp, scp
```
Configuration for activating the FTP input for apc_aos only:
```yaml
input:
default: ssh
models:
apc_aos:
input: ftp
```
You can also set specific username and password for apc_aos only:
```yaml
username: default-user
password: default-password
input:
default: ssh
models:
apc_aos:
username: apc-user
password: apc-password
input: ftp
```
2 changes: 1 addition & 1 deletion docs/Supported-OS-Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
|Allied Telesis |Alliedware Plus |[awplus](/lib/oxidized/model/awplus.rb)
| |AT-8000S, AT-8000GS series |[powerconnect](/lib/oxidized/model/powerconnect.rb)
|Alvarion |BreezeACCESS |[alvarion](/lib/oxidized/model/alvarion.rb)
|APC |AOS |[apc_aos](/lib/oxidized/model/apc_aos.rb) |@robertcheramy
|APC |AOS |[apc_aos](/lib/oxidized/model/apc_aos.rb) |@robertcheramy |[APC AOS](Model-Notes/APC_AOS.md)
|Arbor Networks |ArbOS |[arbos](/lib/oxidized/model/arbos.rb) | |[ArbOS](Model-Notes/ArbOS.md)
|Arista |EOS |[eos](/lib/oxidized/model/eos.rb) | |[EOS](Model-Notes/EOS.md)
|Arris |C4CMTS |[c4cmts](/lib/oxidized/model/c4cmts.rb)
Expand Down
2 changes: 1 addition & 1 deletion lib/oxidized/model/apc_aos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ class Apc_aos < Oxidized::Model # rubocop:disable Naming/ClassAndModuleCamelCase
cfg
end

cfg :ftp, :scp do
cfg :ftp do
end
end
1 change: 1 addition & 0 deletions spec/model/apc_aos_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
end

it "fetches the configuration with scp" do
skip "Work in Progress, see issue #1802"
@node = Oxidized::Node.new(name: 'example.com',
input: 'scp',
output: 'file',
Expand Down

0 comments on commit 6ec8ee5

Please sign in to comment.