Sha256: 6208cb4f40edbf33e082ddf913d8b3f96863f77633d511d533346079113d5072

Contents?: true

Size: 1.84 KB

Versions: 1

Compression:

Stored size: 1.84 KB

Contents

# Oxidized Script
CLI and Library to interface with network devices in Oxidized

## Install
 % gem install oxidized-script

## Use

### CLI
```
[fisakytt@lan-login1 ~]% oxs S-2250220 'sh ver'
                Jan 29 2010 12:18:24
                K.14.54
                79
[fisakytt@lan-login1 ~]% cat > cmds
show ip route
[fisakytt@lan-login1 ~]% oxs -x cmds 62.236.123.199
Default gateway is 62.236.123.198

Host               Gateway           Last Use    Total Uses  Interface
ICMP redirect cache is empty
[fisakytt@lan-login1 ~]% cat >> cmds
sh ip cef
[fisakytt@lan-login1 ~]% cat cmds|oxs -x- 62.236.123.199
Default gateway is 62.236.123.198

Host               Gateway           Last Use    Total Uses  Interface
ICMP redirect cache is empty
%IPv4 CEF not running
[fisakytt@lan-login1 ~]% oxs --help
Usage: oxs [options] hostname [command]
    -m, --model         host model (ios, junos, etc), otherwise discovered from Oxidized source
    -x, --commands      commands file to be sent
    -u, --username      username to use
    -p, --password      password to use
    -t, --timeout       timeout value to use
    -e, --enable        enable password to use
    -d, --debug         turn on debugging
    -h, --help          Display this help message.
[fisakytt@lan-login1 ~]% 
```

### Library
```
[fisakytt@lan-login1 ~]% cat moi42.b 
#!/usr/bin/env ruby

require 'oxidized/script'

Oxidized::Config.load
Oxidized.setup_logger

Oxidized::Script.new(:host=>'62.236.123.199') do |oxs|
  puts oxs.cmd 'show mac address-table dynamic vlan 101'
end
[fisakytt@lan-login1 ~]% ./moi42.b 
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
 101    44d3.ca4c.383e    DYNAMIC     Gi0/1
[fisakytt@lan-login1 ~]% 
```

## TODO
  * Interactive use?
  * Tests+docs, as always :(

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
oxidized-script-0.2.0 README.md