oxidized
oxidized copied to clipboard
Allow models to use multiple inputs
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
This issue is stale because it has been open 90 days with no activity.
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
downloadoderget_filein parallel tocmdto 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.
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
This issue is stale because it has been open 90 days with no activity.