oxidized-script icon indicating copy to clipboard operation
oxidized-script copied to clipboard

oxs --timeout error

Open jguida opened this issue 7 years ago • 5 comments

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:in new' 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:in run' from /usr/local/share/gems/gems/oxidized-script-0.5.1/bin/oxs:5:in <top (required)>' from /usr/local/bin/oxs:23:in load' from /usr/local/bin/oxs:23:in

'

jguida avatar Nov 06 '18 00:11 jguida

Yeah it's never worked as far as I know. Most likely a simple fix but I've never taken a look.

laf avatar Nov 08 '18 22:11 laf

How to make the script not timeout from certain commands? is there any alternative?

8zero2 avatar Jul 09 '19 14:07 8zero2

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

ancorrus avatar Mar 24 '20 07:03 ancorrus