oxidized icon indicating copy to clipboard operation
oxidized copied to clipboard

Allow models to use multiple inputs

Open robertcheramy opened this issue 11 months ago • 1 comments

In some situations, you may need to get a config per scp / ftp and execute some commands per ssh to get the inventory or serial number.

In the case APC devices (Uninterruptible Power Supply - model apc_aos.rb), I want config.ini per ftp/scp and execute following commands per ssh:

about
upsabout

robertcheramy avatar Dec 03 '24 15:12 robertcheramy

This issue is stale because it has been open 90 days with no activity.

github-actions[bot] avatar Mar 04 '25 02:03 github-actions[bot]

Notes:

  • This may imply to merge scp.rb into ssh.rb, see input from @ytti in https://github.com/ytti/oxidized/commit/0bfddc0f0804faf3d9bfbe8ae8c0ee694ce99257#r162861892
  • I'm thinking of adding download oder get_file in parallel to cmd to differentiate between (ssh) commands and downloading files.
  • This may mean refactoring code if we really mean mutliple inputs like ssh + ftp. Currently, one input module is chosen in Oxidized::Node.run_input. My Idea is to allow to download a file with scp/sftp within the ssh module (any maybe download a file within http, I haven't looked at it), but not to mix inputs.

robertcheramy avatar Jul 29 '25 13:07 robertcheramy

cmd does take parameters, I'm thinking we configure >1 input methods in model and then in the config block we give them execution order. If execution order is unset it is executed first. First execution order input is also default for cmd if no input is not specified.

# this gets via scp
cmd "/config/plop"
# this logins via ssh 
cmd "about" input: ssh

cfg :scp
cfg :ssh do
  order 2
end

ytti avatar Jul 29 '25 15:07 ytti

This issue is stale because it has been open 90 days with no activity.

github-actions[bot] avatar Oct 29 '25 02:10 github-actions[bot]