Code Monkey home page Code Monkey logo

ansible-cisco-snmp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-cisco-snmp's Issues

Extend cisco_snmp_interface.py for setup portAdminSpeed and portDuplex

It is possible to extend the script for setup portAdminSpeed and portDuplex on interface?
The problem is Cisoco use in this case a seperate CISCO-STACK-MIB

From CISCO-STACK-MIB

self.portAdminSpeed = "1.3.6.1.4.1.9.5.1.4.1.1.9"
self.portDuplex = "1.3.6.1.4.1.9.5.1.4.1.1.10"
self.portIfIndex = "1.3.6.1.4.1.9.5.1.4.1.1.11"

And works with portIfIndex mapping to ifIndex here:
| -- portIfIndex (11)
1.3.6.1.4.1.9.5.1.4.1.1.11.1.1 = INTEGER: 10101
1.3.6.1.4.1.9.5.1.4.1.1.11.1.2 = INTEGER: 10102
1.3.6.1.4.1.9.5.1.4.1.1.11.1.3 = INTEGER: 10001
1.3.6.1.4.1.9.5.1.4.1.1.11.1.4 = INTEGER: 10002
1.3.6.1.4.1.9.5.1.4.1.1.11.1.5 = INTEGER: 10003
1.3.6.1.4.1.9.5.1.4.1.1.11.1.6 = INTEGER: 10004
1.3.6.1.4.1.9.5.1.4.1.1.11.1.7 = INTEGER: 10005

The ifIndex are the following interfaces:
IF-MIB::ifDescr.10101 = STRING: GigabitEthernet1/0/1
IF-MIB::ifDescr.10102 = STRING: GigabitEthernet1/0/2
IF-MIB::ifDescr.10001 = STRING: FastEthernet1/0/1
IF-MIB::ifDescr.10002 = STRING: FastEthernet1/0/2
IF-MIB::ifDescr.10003 = STRING: FastEthernet1/0/3
IF-MIB::ifDescr.10004 = STRING: FastEthernet1/0/4
IF-MIB::ifDescr.10005 = STRING: FastEthernet1/0/5

This are the possible values:
portAdminSpeed
Values
1 : autoDetect
2 : autoDetect10100
10 : s10G
64000 : s64000
1544000 : s1544000
2000000 : s2000000
2048000 : s2048000
4000000 : s4000000
10000000 : s10000000
16000000 : s16000000
45000000 : s45000000
64000000 : s64000000
100000000 : s100000000
155000000 : s155000000
400000000 : s400000000
622000000 : s622000000
1000000000 : s1000000000

portDuplex
Values
1 : half
2 : full
3 : disagree
4 : auto

Could you added this or give me a hint how can I write the mapping find function of ifIndex to portIfIndex in python script?

Error creating Vlans

First of all, these modules are AWESOME!

I'm trying to figure out how to solve this error:

failed: [x.x.x.x] => {"failed": true, "parsed": false}
Traceback (most recent call last):
  File "/home/ubuntu/.ansible/tmp/ansible-tmp-1446051069.8-34119550336394/cisco_snmp_vlan", line >1914, in <module>
    main()
  File "/home/ubuntu/.ansible/tmp/ansible-tmp-1446051069.8-34119550336394/cisco_snmp_vlan", line >1898, in main
    vartable = dev.getnext(o.vtpVlanEditTable)
  File "/usr/local/lib/python2.7/dist-packages/nelsnmp/snmp.py", line 278, in getnext
    lookupMib=False
  File "/usr/local/lib/python2.7/dist-packages/pysnmp/entity/rfc3413/oneliner/cmdgen.py", line 222, in nextCmd
    return errorIndication, errorStatus, errorIndex, varBindTable
 UnboundLocalError: local variable 'errorIndication' referenced before assignment

 FATAL: all hosts have already failed -- aborting

It just happens when I try to create a Vlan on the device, I'm testing using a Catalyst 2960. This error occurs for both SNMP v2c and v3.

Everything else works fine!

Thanks

ZTP help

Hey, I try to use your code with my projet but I don't know how to put multiple final config, how the switch will know to take his config based on mac address or serial number if its possible.

Also use option 125 for ios_version.bin.

Can i contact you by email or slack for exemple?

tank you.
Nicolas

Syntax Error

Hi Patrick,
I am first time using this module. Getting this error:

Unable to import cisco_snmp_portsecurity due to invalid syntax

installed nelsnmp
cloned ansible-cisco-snmp
ansible.cfg - pointing library to ansible-cisco-snmp/library


$ cat ansible.cfg

[defaults]

library = /tmp/certs/ansible-cisco-snmp/librar

running following code:

cat test-snmp.yml

---
 - hosts: all
   connection: local
   gather_facts: no
    
   tasks:
           #    - name: test 
           # cisco_snmp_interface: 
           #host={{ inventory_hostname }}
           #version=2c 
           #community=private
        - cisco_snmp_portsecurity: host={{ inventory_hostname }} version=v3 community=private interface_name=FastEthernet0/2 portsecurity=enabled max=5

Error:

PLAYBOOK: test_snmp.yml ********************************************************
1 plays in test_snmp.yml

PLAY [all] *********************************************************************
META: ran handlers

TASK [cisco_snmp_portsecurity] *************************************************
task path: /tmp/certs/test_snmp.yml:12
fatal: [wayzataoclab729-swt.XXXX.com]: FAILED! => {"msg": "Unable to import cisco_snmp_portsecurity due to invalid syntax"}

Same Syntax error came when I tried to use interface module

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.