Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNMP Community - Symbols Cause Churn #414

Closed
krisamundson opened this issue Jan 19, 2017 · 3 comments
Closed

SNMP Community - Symbols Cause Churn #414

krisamundson opened this issue Jan 19, 2017 · 3 comments

Comments

@krisamundson
Copy link

When you have symbols in an SNMP community string you get churn as the provider fails to recognize the community and re-applies on every run.

Here is the puppet code:

  cisco_snmp_community { 'operator':
    ensure    => present,
    community => 'SimpleCommunity',
    group     => 'network-operator',
  }

  cisco_snmp_community { 'admin':
    ensure    => present,
    community => 'C0mplex()Community!',
    group     => 'network-admin',
  }

You will now see that both communities apply on the first run, and the "admin" community continues to apply on every run.

[root@pdx-1c1-spine1 ~]# puppet agent -t
2017-01-19 15:37:57.101012 WARN  puppetlabs.facter - Could not initialize locale, even with LC_* variables cleared. Continuing without localization support
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for pdx-1c1-spine1.ops.kdev
Info: Applying configuration version 'e0b18bc68e7e4a14a18954d2506ae558dd98582e'
Notice: /Stage[main]/Main/Node[pdx-1c1-spine1]/Cisco_snmp_community[operator]/ensure: created
Notice: /Stage[main]/Main/Node[pdx-1c1-spine1]/Cisco_snmp_community[admin]/ensure: created
Notice: Applied catalog in 1.75 seconds

[root@pdx-1c1-spine1 ~]# puppet agent -t
2017-01-19 15:39:29.115800 WARN  puppetlabs.facter - Could not initialize locale, even with LC_* variables cleared. Continuing without localization support
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for pdx-1c1-spine1.ops.kdev
Info: Applying configuration version 'e0b18bc68e7e4a14a18954d2506ae558dd98582e'
Notice: /Stage[main]/Main/Node[pdx-1c1-spine1]/Cisco_snmp_community[admin]/group: group changed 'network-operator' to 'network-admin'
Notice: Applied catalog in 1.41 seconds

NXOS: version 7.0(3)I2(2d)
ciscopuppet module: 1.5.0
puppet agent: 4.8.1

@mikewiebe
Copy link
Contributor

mikewiebe commented Jan 20, 2017

@krisamundson I am looking into this issue and working on a fix. I will keep you updated on the progress.

@mikewiebe
Copy link
Contributor

@krisamundson Test results with fix.

root@dt-n9k5-1#puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for dt-n9k5-1.cisco.com
Info: Applying configuration version '1485293583'
Notice: /Stage[main]/Main/Node[default]/Cisco_snmp_community[operator]/ensure: created
Notice: /Stage[main]/Main/Node[default]/Cisco_snmp_community[admin]/ensure: created
Notice: Applied catalog in 4.84 seconds
root@dt-n9k5-1#
root@dt-n9k5-1#puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for dt-n9k5-1.cisco.com
Info: Applying configuration version '1485293601'
Notice: Applied catalog in 0.49 seconds
root@dt-n9k5-1#
root@dt-n9k5-1#puppet resource Cisco_snmp_community
cisco_snmp_community { 'C0mplex()Community!':
  ensure => 'present',
  group  => 'network-admin',
}
cisco_snmp_community { 'SimpleCommunity':
  ensure => 'present',
  group  => 'default',
}
root@dt-n9k5-1#

Now add another user with even more complex characters.

root@dt-n9k5-1#puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for dt-n9k5-1.cisco.com
Info: Applying configuration version '1485293784'
Notice: /Stage[main]/Main/Node[default]/Cisco_snmp_community[admin]/ensure: created
Notice: Applied catalog in 0.65 seconds
root@dt-n9k5-1#puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for dt-n9k5-1.cisco.com
Info: Applying configuration version '1485293797'
Notice: Applied catalog in 0.63 seconds
root@dt-n9k5-1#
root@dt-n9k5-1#puppet resource Cisco_snmp_community
cisco_snmp_community { 'C()#$%^&*-_=+|/,<Community!':
  ensure => 'present',
  group  => 'network-admin',
}
cisco_snmp_community { 'C0mplex()Community!':
  ensure => 'present',
  group  => 'network-admin',
}
cisco_snmp_community { 'SimpleCommunity':
  ensure => 'present',
  group  => 'default',
}
root@dt-n9k5-1#

@krisamundson
Copy link
Author

Confirmed working for me on NS-OSv. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants