-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from jordiprats/master
Added snmpd::extend
- Loading branch information
Showing
7 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# CHANGELOG | ||
|
||
## 0.2.6 | ||
|
||
* Added **snmpd::extend** | ||
|
||
## 0.2.5 | ||
|
||
* flag to ignore not prexistent users in autoACL mode | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# this example should FAIL | ||
|
||
class { 'snmpd': | ||
add_default_acls => false, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class { 'snmpd': | ||
add_default_acls => false, | ||
} | ||
|
||
class { 'snmpd::loadavg': } | ||
|
||
snmpd::v3user { 'v3testuser': | ||
authpass => '1234567890', | ||
encpass => '1234567890', | ||
} | ||
|
||
# snmpwalk -v3 -l authPriv -u v3testuser -a SHA -A "1234567890" -x AES -X "1234567890" 127.0.0.1 .1 | grep demodate | ||
|
||
snmpd::extend { 'demodate': | ||
script => '/usr/bin/date +%s', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
define snmpd::extend( | ||
$script, | ||
$extend_name = $name, | ||
$description = undef, | ||
$mib_oid = undef, | ||
$order = '42', | ||
) { | ||
# extend [MIBOID] NAME PROG ARGS | ||
# works in a similar manner to the exec directive, but with a number of improvements. The MIB tables (nsExtendConfigTable etc) are indexed by the NAME token, so are unaffected by the order in | ||
# which entries are read from the configuration files. There are two result tables - one (nsExtendOutput1Table) containing the exit status, the first line and full output (as a single string) | ||
# for each extend entry, and the other (nsExtendOutput2Table) containing the complete output as a series of separate lines. | ||
# | ||
# If MIBOID is specified, then the configuration and result tables will be rooted at this point in the OID tree, but are otherwise structured in exactly the same way. This means that several | ||
# separate extend directives can specify the same MIBOID root, without conflicting. | ||
# | ||
# The exit status and output is cached for each entry individually, and can be cleared (and the caching behaviour configured) using the nsCacheTable. | ||
|
||
concat::fragment { "eyp-snmpd - extend ${extend_name}": | ||
target => '/etc/snmp/snmpd.conf', | ||
order => "02-${order}", | ||
content => template("${module_name}/extend.erb"), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<% if defined?(@description) -%> | ||
|
||
# <%= @description %> | ||
<% end -%> | ||
extend <% if defined?(@mib_oid) %> <%= @mib_oid %><% end %><%= @extend_name %> <%= @script %> |