Open jguida opened 5 years ago
Yeah it's never worked as far as I know. Most likely a simple fix but I've never taken a look.
How to make the script not timeout from certain commands? is there any alternative?
So far as even industry standard automation tools gave up on my case of authenticating by password, i came to your oxidized-script and it just did what i told it to, great job! :)
However...
This command
oxs --verbose --debug --threads 10 --regex ^100 --commands /opt/oxidized/cmds_for_oxs/add_user_zabbix
outputs
Forking 100.99.83.1 We had the following error on node 100.99.83.1: execution expired
for every host I feed to it.
But when I check the host manually, I see that the commands provided have worked and taken effect.
This was the command file:
configure delete system login user backup set system login user zabbix set system login user zabbix level admin set system login user zabbix authentication plaintext-password "pswd" commit loadkey zabbix /home/admin/id_rsa.pub save exit
Works ok: [oxidized@zabbix oxidized]$ oxs -m ios -x comandos/ios 10.11.1.99 Building configuration...
Current configuration : 15075 bytes ! ! Last configuration change at 09:44:27 GMT Sun Nov 4 2018 by jguida ! NVRAM config last updated at 09:44:29 GMT Sun Nov 4 2018 by jguida ! version 15.4 no service pad service timestamps debug datetime msec localtime show-timezone service timestamps log datetime msec localtime show-timezone
But if i set --timeout fail: I work in a bash script with oxs, but is a device is offline, the script don't continue of a device offline.
!/bin/bash
while read -r line; do /usr/local/bin/oxs -v -d -m ios -x comandos/ios $line done < "$1"
[oxidized@zabbix oxidized]$ oxs -m ios --timeout 120 -x comandos/ios 10.11.1.99 unable to connect /usr/local/share/gems/gems/oxidized-script-0.5.1/lib/oxidized/script/script.rb:113:in'
connect': unable to connect (Oxidized::Script::NoConnection) from /usr/local/share/gems/gems/oxidized-script-0.5.1/lib/oxidized/script/script.rb:92:in
initialize' from /usr/local/share/gems/gems/oxidized-script-0.5.1/lib/oxidized/script/cli.rb:122:innew' from /usr/local/share/gems/gems/oxidized-script-0.5.1/lib/oxidized/script/cli.rb:122:in
connect' from /usr/local/share/gems/gems/oxidized-script-0.5.1/lib/oxidized/script/cli.rb:37:inrun' from /usr/local/share/gems/gems/oxidized-script-0.5.1/bin/oxs:5:in
<top (required)>' from /usr/local/bin/oxs:23:inload' from /usr/local/bin/oxs:23:in