telemetry-snmp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/rspec.yml +44 -0
  3. data/.github/workflows/rubocop.yml +28 -0
  4. data/.github/workflows/sourcehawk-scan.yml +20 -0
  5. data/.gitignore +14 -0
  6. data/.rspec +4 -0
  7. data/.rubocop.yml +26 -0
  8. data/CHANGELOG.md +4 -0
  9. data/CODE_OF_CONDUCT.md +75 -0
  10. data/CONTRIBUTING.md +54 -0
  11. data/Gemfile +10 -0
  12. data/INDIVIDUAL_CONTRIBUTOR_LICENSE.md +30 -0
  13. data/LICENSE +201 -0
  14. data/NOTICE.txt +9 -0
  15. data/README.md +54 -0
  16. data/attribution.txt +1 -0
  17. data/config.ru +15 -0
  18. data/exe/snmp_collector +55 -0
  19. data/lib/telemetry/snmp.rb +23 -0
  20. data/lib/telemetry/snmp/api.rb +55 -0
  21. data/lib/telemetry/snmp/auth.rb +54 -0
  22. data/lib/telemetry/snmp/auth/defaults.rb +41 -0
  23. data/lib/telemetry/snmp/client.rb +104 -0
  24. data/lib/telemetry/snmp/controllers/device_creds.rb +105 -0
  25. data/lib/telemetry/snmp/controllers/devices.rb +94 -0
  26. data/lib/telemetry/snmp/controllers/oid_groups.rb +71 -0
  27. data/lib/telemetry/snmp/controllers/oids.rb +80 -0
  28. data/lib/telemetry/snmp/controllers/users.rb +81 -0
  29. data/lib/telemetry/snmp/controllers/walks.rb +89 -0
  30. data/lib/telemetry/snmp/data.rb +69 -0
  31. data/lib/telemetry/snmp/data/default_opts.rb +73 -0
  32. data/lib/telemetry/snmp/data/migrations/001_device_creds.rb +19 -0
  33. data/lib/telemetry/snmp/data/migrations/002_create_devices_table.rb +31 -0
  34. data/lib/telemetry/snmp/data/migrations/003_create_oids_tables.rb +16 -0
  35. data/lib/telemetry/snmp/data/migrations/004_create_oid_groups.rb +15 -0
  36. data/lib/telemetry/snmp/data/migrations/005_create_oids_oid_groups.rb +17 -0
  37. data/lib/telemetry/snmp/data/migrations/006_device_to_oid_group.rb +15 -0
  38. data/lib/telemetry/snmp/data/migrations/007_create_users.rb +20 -0
  39. data/lib/telemetry/snmp/data/migrations/008_create_walks_table.rb +14 -0
  40. data/lib/telemetry/snmp/data/migrations/009_create_tag_name_column.rb +7 -0
  41. data/lib/telemetry/snmp/data/migrations/010_create_user_audit_table.rb +18 -0
  42. data/lib/telemetry/snmp/data/models/device.rb +11 -0
  43. data/lib/telemetry/snmp/data/models/device_cred.rb +11 -0
  44. data/lib/telemetry/snmp/data/models/oid.rb +10 -0
  45. data/lib/telemetry/snmp/data/models/oid_group.rb +10 -0
  46. data/lib/telemetry/snmp/data/models/oid_oid_groups.rb +10 -0
  47. data/lib/telemetry/snmp/data/models/oid_walk.rb +10 -0
  48. data/lib/telemetry/snmp/data/models/user.rb +10 -0
  49. data/lib/telemetry/snmp/data/models/user_audit_log.rb +19 -0
  50. data/lib/telemetry/snmp/mibs/AGENTX-MIB.txt +527 -0
  51. data/lib/telemetry/snmp/mibs/AIRPORT-BASESTATION-3-MIB.txt +461 -0
  52. data/lib/telemetry/snmp/mibs/BRIDGE-MIB.txt +1472 -0
  53. data/lib/telemetry/snmp/mibs/DISMAN-EVENT-MIB.txt +1882 -0
  54. data/lib/telemetry/snmp/mibs/DISMAN-SCHEDULE-MIB.txt +699 -0
  55. data/lib/telemetry/snmp/mibs/DISMAN-SCRIPT-MIB.txt +1764 -0
  56. data/lib/telemetry/snmp/mibs/EtherLike-MIB.txt +1862 -0
  57. data/lib/telemetry/snmp/mibs/HCNUM-TC.txt +118 -0
  58. data/lib/telemetry/snmp/mibs/HOST-RESOURCES-MIB.txt +1540 -0
  59. data/lib/telemetry/snmp/mibs/HOST-RESOURCES-TYPES.txt +389 -0
  60. data/lib/telemetry/snmp/mibs/IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt +123 -0
  61. data/lib/telemetry/snmp/mibs/IANA-LANGUAGE-MIB.txt +123 -0
  62. data/lib/telemetry/snmp/mibs/IANA-RTPROTO-MIB.txt +91 -0
  63. data/lib/telemetry/snmp/mibs/IANAifType-MIB.txt +619 -0
  64. data/lib/telemetry/snmp/mibs/IF-INVERTED-STACK-MIB.txt +149 -0
  65. data/lib/telemetry/snmp/mibs/IF-MIB.txt +1814 -0
  66. data/lib/telemetry/snmp/mibs/INET-ADDRESS-MIB.txt +402 -0
  67. data/lib/telemetry/snmp/mibs/IP-FORWARD-MIB.txt +1277 -0
  68. data/lib/telemetry/snmp/mibs/IP-MIB.txt +4993 -0
  69. data/lib/telemetry/snmp/mibs/IPV6-FLOW-LABEL-MIB.txt +58 -0
  70. data/lib/telemetry/snmp/mibs/IPV6-ICMP-MIB.txt +529 -0
  71. data/lib/telemetry/snmp/mibs/IPV6-MIB.txt +1443 -0
  72. data/lib/telemetry/snmp/mibs/IPV6-TC.txt +67 -0
  73. data/lib/telemetry/snmp/mibs/IPV6-TCP-MIB.txt +211 -0
  74. data/lib/telemetry/snmp/mibs/IPV6-UDP-MIB.txt +141 -0
  75. data/lib/telemetry/snmp/mibs/NET-SNMP-AGENT-MIB.txt +554 -0
  76. data/lib/telemetry/snmp/mibs/NET-SNMP-EXAMPLES-MIB.txt +285 -0
  77. data/lib/telemetry/snmp/mibs/NET-SNMP-EXTEND-MIB.txt +325 -0
  78. data/lib/telemetry/snmp/mibs/NET-SNMP-MIB.txt +67 -0
  79. data/lib/telemetry/snmp/mibs/NET-SNMP-PASS-MIB.txt +124 -0
  80. data/lib/telemetry/snmp/mibs/NET-SNMP-TC.txt +128 -0
  81. data/lib/telemetry/snmp/mibs/NET-SNMP-VACM-MIB.txt +154 -0
  82. data/lib/telemetry/snmp/mibs/NOTIFICATION-LOG-MIB.txt +753 -0
  83. data/lib/telemetry/snmp/mibs/PAN-COMMON-MIB.md5 +1 -0
  84. data/lib/telemetry/snmp/mibs/PAN-COMMON-MIB.my +2293 -0
  85. data/lib/telemetry/snmp/mibs/PAN-ENTITY-EXT-MIB.md5 +1 -0
  86. data/lib/telemetry/snmp/mibs/PAN-ENTITY-EXT-MIB.my +293 -0
  87. data/lib/telemetry/snmp/mibs/PAN-GLOBAL-REG-MIB.md5 +1 -0
  88. data/lib/telemetry/snmp/mibs/PAN-GLOBAL-REG-MIB.my +84 -0
  89. data/lib/telemetry/snmp/mibs/PAN-GLOBAL-TC-MIB.md5 +1 -0
  90. data/lib/telemetry/snmp/mibs/PAN-GLOBAL-TC-MIB.my +68 -0
  91. data/lib/telemetry/snmp/mibs/PAN-LC-MIB.md5 +1 -0
  92. data/lib/telemetry/snmp/mibs/PAN-LC-MIB.my +204 -0
  93. data/lib/telemetry/snmp/mibs/PAN-PRODUCT-MIB.md5 +1 -0
  94. data/lib/telemetry/snmp/mibs/PAN-PRODUCT-MIB.my +305 -0
  95. data/lib/telemetry/snmp/mibs/PAN-TRAPS.md5 +1 -0
  96. data/lib/telemetry/snmp/mibs/PAN-TRAPS.my +7809 -0
  97. data/lib/telemetry/snmp/mibs/RFC-1215.txt +38 -0
  98. data/lib/telemetry/snmp/mibs/RFC1155-SMI.txt +119 -0
  99. data/lib/telemetry/snmp/mibs/RFC1213-MIB.txt +2613 -0
  100. data/lib/telemetry/snmp/mibs/RMON-MIB.txt +3980 -0
  101. data/lib/telemetry/snmp/mibs/SCTP-MIB.txt +1342 -0
  102. data/lib/telemetry/snmp/mibs/SMUX-MIB.txt +160 -0
  103. data/lib/telemetry/snmp/mibs/SNMP-COMMUNITY-MIB.txt +429 -0
  104. data/lib/telemetry/snmp/mibs/SNMP-FRAMEWORK-MIB.txt +526 -0
  105. data/lib/telemetry/snmp/mibs/SNMP-MPD-MIB.txt +145 -0
  106. data/lib/telemetry/snmp/mibs/SNMP-NOTIFICATION-MIB.txt +589 -0
  107. data/lib/telemetry/snmp/mibs/SNMP-PROXY-MIB.txt +294 -0
  108. data/lib/telemetry/snmp/mibs/SNMP-TARGET-MIB.txt +660 -0
  109. data/lib/telemetry/snmp/mibs/SNMP-USER-BASED-SM-MIB.txt +912 -0
  110. data/lib/telemetry/snmp/mibs/SNMP-USM-AES-MIB.txt +62 -0
  111. data/lib/telemetry/snmp/mibs/SNMP-USM-DH-OBJECTS-MIB.txt +532 -0
  112. data/lib/telemetry/snmp/mibs/SNMP-VIEW-BASED-ACM-MIB.txt +830 -0
  113. data/lib/telemetry/snmp/mibs/SNMPv2-CONF.txt +322 -0
  114. data/lib/telemetry/snmp/mibs/SNMPv2-MIB.txt +854 -0
  115. data/lib/telemetry/snmp/mibs/SNMPv2-SMI.txt +344 -0
  116. data/lib/telemetry/snmp/mibs/SNMPv2-TC.txt +772 -0
  117. data/lib/telemetry/snmp/mibs/SNMPv2-TM.txt +176 -0
  118. data/lib/telemetry/snmp/mibs/TCP-MIB.txt +785 -0
  119. data/lib/telemetry/snmp/mibs/TRANSPORT-ADDRESS-MIB.txt +421 -0
  120. data/lib/telemetry/snmp/mibs/TUNNEL-MIB.txt +738 -0
  121. data/lib/telemetry/snmp/mibs/UCD-DEMO-MIB.txt +74 -0
  122. data/lib/telemetry/snmp/mibs/UCD-DISKIO-MIB.txt +171 -0
  123. data/lib/telemetry/snmp/mibs/UCD-DLMOD-MIB.txt +124 -0
  124. data/lib/telemetry/snmp/mibs/UCD-IPFWACC-MIB.txt +327 -0
  125. data/lib/telemetry/snmp/mibs/UCD-SNMP-MIB.txt +1712 -0
  126. data/lib/telemetry/snmp/mibs/UDP-MIB.txt +549 -0
  127. data/lib/telemetry/snmp/publisher.rb +130 -0
  128. data/lib/telemetry/snmp/version.rb +7 -0
  129. data/sourcehawk.yml +4 -0
  130. data/telemetry-snmp.gemspec +48 -0
  131. metadata +456 -0
@@ -0,0 +1,285 @@
1
+ NET-SNMP-EXAMPLES-MIB DEFINITIONS ::= BEGIN
2
+
3
+ --
4
+ -- Example MIB objects for agent module example implementations
5
+ --
6
+
7
+ IMPORTS
8
+ MODULE-IDENTITY, OBJECT-TYPE, Integer32,
9
+ NOTIFICATION-TYPE FROM SNMPv2-SMI
10
+ SnmpAdminString FROM SNMP-FRAMEWORK-MIB
11
+ netSnmp FROM NET-SNMP-MIB
12
+ RowStatus, StorageType FROM SNMPv2-TC
13
+ InetAddressType, InetAddress FROM INET-ADDRESS-MIB
14
+ ;
15
+
16
+ netSnmpExamples MODULE-IDENTITY
17
+ LAST-UPDATED "200406150000Z"
18
+ ORGANIZATION "www.net-snmp.org"
19
+ CONTACT-INFO
20
+ "postal: Wes Hardaker
21
+ P.O. Box 382
22
+ Davis CA 95617
23
+
24
+ email: net-snmp-coders@lists.sourceforge.net"
25
+ DESCRIPTION
26
+ "Example MIB objects for agent module example implementations"
27
+ REVISION "200406150000Z"
28
+ DESCRIPTION
29
+ "Corrected notification example definitions"
30
+ REVISION "200202060000Z"
31
+ DESCRIPTION
32
+ "First draft"
33
+ ::= { netSnmp 2 }
34
+
35
+ --
36
+ -- top level structure
37
+ --
38
+ netSnmpExampleScalars OBJECT IDENTIFIER ::= { netSnmpExamples 1 }
39
+ netSnmpExampleTables OBJECT IDENTIFIER ::= { netSnmpExamples 2 }
40
+ netSnmpExampleNotifications OBJECT IDENTIFIER ::= { netSnmpExamples 3 }
41
+ netSnmpExampleNotificationPrefix OBJECT IDENTIFIER
42
+ ::= { netSnmpExampleNotifications 0 }
43
+ netSnmpExampleNotificationObjects OBJECT IDENTIFIER
44
+ ::= { netSnmpExampleNotifications 2 }
45
+ -- netSnmpTutorial OBJECT IDENTIFIER ::= { netSnmpExamples 4 }
46
+
47
+ --
48
+ -- Example scalars
49
+ --
50
+
51
+ netSnmpExampleInteger OBJECT-TYPE
52
+ SYNTAX Integer32
53
+ MAX-ACCESS read-write
54
+ STATUS current
55
+ DESCRIPTION
56
+ "This is a simple object which merely houses a writable
57
+ integer. It's only purposes is to hold the value of a single
58
+ integer. Writing to it will simply change the value for
59
+ subsequent GET/GETNEXT/GETBULK retrievals.
60
+
61
+ This example object is implemented in the
62
+ agent/mibgroup/examples/scalar_int.c file."
63
+ DEFVAL { 42 }
64
+ ::= { netSnmpExampleScalars 1 }
65
+
66
+ netSnmpExampleSleeper OBJECT-TYPE
67
+ SYNTAX Integer32
68
+ MAX-ACCESS read-write
69
+ STATUS current
70
+ DESCRIPTION
71
+ "This is a simple object which is a basic integer. It's value
72
+ indicates the number of seconds that the agent will take in
73
+ responding to requests of this object. This is implemented
74
+ in a way which will allow the agent to keep responding to
75
+ other requests while access to this object is blocked. It is
76
+ writable, and changing it's value will change the amount of
77
+ time the agent will effectively wait for before returning a
78
+ response when this object is manipulated. Note that SET
79
+ requests through this object will take longer, since the
80
+ delay is applied to each internal transaction phase, which
81
+ could result in delays of up to 4 times the value of this
82
+ object.
83
+
84
+ This example object is implemented in the
85
+ agent/mibgroup/examples/delayed_instance.c file."
86
+ DEFVAL { 1 }
87
+ ::= { netSnmpExampleScalars 2 }
88
+
89
+ netSnmpExampleString OBJECT-TYPE
90
+ SYNTAX SnmpAdminString
91
+ MAX-ACCESS read-write
92
+ STATUS current
93
+ DESCRIPTION
94
+ "This is a simple object which merely houses a writable
95
+ string. It's only purposes is to hold the value of a single
96
+ string. Writing to it will simply change the value for
97
+ subsequent GET/GETNEXT/GETBULK retrievals.
98
+
99
+ This example object is implemented in the
100
+ agent/mibgroup/examples/watched.c file."
101
+ DEFVAL { "So long, and thanks for all the fish!" }
102
+ ::= { netSnmpExampleScalars 3 }
103
+
104
+
105
+ --
106
+ -- Example Tables
107
+ --
108
+
109
+ netSnmpIETFWGTable OBJECT-TYPE
110
+ SYNTAX SEQUENCE OF NetSnmpIETFWGEntry
111
+ MAX-ACCESS not-accessible
112
+ STATUS current
113
+ DESCRIPTION
114
+ "This table merely contains a set of data which is otherwise
115
+ useless for true network management. It is a table which
116
+ describes properies about a IETF Working Group, such as the
117
+ names of the two working group chairs.
118
+
119
+ This example table is implemented in the
120
+ agent/mibgroup/examples/data_set.c file."
121
+ ::= { netSnmpExampleTables 1 }
122
+
123
+ netSnmpIETFWGEntry OBJECT-TYPE
124
+ SYNTAX NetSnmpIETFWGEntry
125
+ MAX-ACCESS not-accessible
126
+ STATUS current
127
+ DESCRIPTION
128
+ "A row describing a given working group"
129
+ INDEX { nsIETFWGName }
130
+ ::= {netSnmpIETFWGTable 1 }
131
+
132
+ NetSnmpIETFWGEntry ::= SEQUENCE {
133
+ nsIETFWGName OCTET STRING,
134
+ nsIETFWGChair1 OCTET STRING,
135
+ nsIETFWGChair2 OCTET STRING
136
+ }
137
+
138
+ nsIETFWGName OBJECT-TYPE
139
+ SYNTAX OCTET STRING (SIZE(1..32))
140
+ MAX-ACCESS not-accessible
141
+ STATUS current
142
+ DESCRIPTION
143
+ "The name of the IETF Working Group this table describes."
144
+ ::= { netSnmpIETFWGEntry 1 }
145
+
146
+ nsIETFWGChair1 OBJECT-TYPE
147
+ SYNTAX OCTET STRING
148
+ MAX-ACCESS read-create
149
+ STATUS current
150
+ DESCRIPTION
151
+ "One of the names of the chairs for the IETF working group."
152
+ ::= { netSnmpIETFWGEntry 2 }
153
+
154
+ nsIETFWGChair2 OBJECT-TYPE
155
+ SYNTAX OCTET STRING
156
+ MAX-ACCESS read-create
157
+ STATUS current
158
+ DESCRIPTION
159
+ "The other name, if one exists, of the chairs for the IETF
160
+ working group."
161
+ ::= { netSnmpIETFWGEntry 3 }
162
+
163
+ --
164
+ -- A table used in a table_iterator example
165
+ -- (agent/mibgroup/examples/netSnmpHostsTable*.[ch])
166
+ --
167
+
168
+ netSnmpHostsTable OBJECT-TYPE
169
+ SYNTAX SEQUENCE OF NetSnmpHostsEntry
170
+ MAX-ACCESS not-accessible
171
+ STATUS current
172
+ DESCRIPTION
173
+ "An example table that implements a wrapper around the
174
+ /etc/hosts file on a machine using the iterator helper API."
175
+ ::= { netSnmpExampleTables 2 }
176
+
177
+ netSnmpHostsEntry OBJECT-TYPE
178
+ SYNTAX NetSnmpHostsEntry
179
+ MAX-ACCESS not-accessible
180
+ STATUS current
181
+ DESCRIPTION
182
+ "A host name mapped to an ip address"
183
+ INDEX { netSnmpHostName }
184
+ ::= { netSnmpHostsTable 1 }
185
+
186
+ NetSnmpHostsEntry ::= SEQUENCE {
187
+ netSnmpHostName OCTET STRING,
188
+ netSnmpHostAddressType InetAddressType,
189
+ netSnmpHostAddress InetAddress,
190
+ netSnmpHostStorage StorageType,
191
+ netSnmpHostRowStatus RowStatus
192
+ }
193
+
194
+ netSnmpHostName OBJECT-TYPE
195
+ SYNTAX OCTET STRING (SIZE(0..64))
196
+ MAX-ACCESS not-accessible
197
+ STATUS current
198
+ DESCRIPTION
199
+ "A host name that exists in the /etc/hosts (unix) file."
200
+ ::= { netSnmpHostsEntry 1 }
201
+
202
+ netSnmpHostAddressType OBJECT-TYPE
203
+ SYNTAX InetAddressType
204
+ MAX-ACCESS read-create
205
+ STATUS current
206
+ DESCRIPTION
207
+ "The address type of then given host."
208
+ ::= { netSnmpHostsEntry 2 }
209
+
210
+ netSnmpHostAddress OBJECT-TYPE
211
+ SYNTAX InetAddress
212
+ MAX-ACCESS read-create
213
+ STATUS current
214
+ DESCRIPTION
215
+ "The address of then given host."
216
+ ::= { netSnmpHostsEntry 3 }
217
+
218
+ netSnmpHostStorage OBJECT-TYPE
219
+ SYNTAX StorageType
220
+ MAX-ACCESS read-create
221
+ STATUS current
222
+ DESCRIPTION "The storage type for this conceptual row."
223
+ DEFVAL { nonVolatile }
224
+ ::= { netSnmpHostsEntry 4 }
225
+
226
+ netSnmpHostRowStatus OBJECT-TYPE
227
+ SYNTAX RowStatus
228
+ MAX-ACCESS read-create
229
+ STATUS current
230
+ DESCRIPTION "The status of this conceptual row."
231
+ ::= { netSnmpHostsEntry 5 }
232
+
233
+
234
+ --
235
+ -- Example Notifications
236
+ --
237
+
238
+ netSnmpExampleHeartbeatRate OBJECT-TYPE
239
+ SYNTAX Integer32
240
+ MAX-ACCESS accessible-for-notify
241
+ STATUS current
242
+ DESCRIPTION
243
+ "A simple integer object, to act as a payload for the
244
+ netSnmpExampleHeartbeatNotification. The value has
245
+ no real meaning, but is nominally the interval (in
246
+ seconds) between successive heartbeat notifications."
247
+ ::= { netSnmpExampleNotificationObjects 1 }
248
+
249
+ netSnmpExampleHeartbeatName OBJECT-TYPE
250
+ SYNTAX SnmpAdminString
251
+ MAX-ACCESS accessible-for-notify
252
+ STATUS current
253
+ DESCRIPTION
254
+ "A simple string object, to act as an optional payload
255
+ for the netSnmpExampleHeartbeatNotification. This varbind
256
+ is not part of the notification definition, so is optional
257
+ and need not be included in the notification payload.
258
+ The value has no real meaning, but the romantically inclined
259
+ may take it to be the object of the sender's affection,
260
+ and hence the cause of the heart beating faster."
261
+ ::= { netSnmpExampleNotificationObjects 2 }
262
+
263
+ netSnmpExampleHeartbeatNotification NOTIFICATION-TYPE
264
+ OBJECTS { netSnmpExampleHeartbeatRate }
265
+ STATUS current
266
+ DESCRIPTION
267
+ "An example notification, used to illustrate the
268
+ definition and generation of trap and inform PDUs
269
+ (including the use of both standard and additional
270
+ varbinds in the notification payload).
271
+ This notification will typically be sent every
272
+ 30 seconds, using the code found in the example module
273
+ agent/mibgroup/examples/notification.c"
274
+ ::= { netSnmpExampleNotificationPrefix 1 }
275
+
276
+ netSnmpExampleNotification OBJECT-TYPE
277
+ SYNTAX SnmpAdminString
278
+ MAX-ACCESS accessible-for-notify
279
+ STATUS obsolete
280
+ DESCRIPTION
281
+ "This object was improperly defined for its original purpose,
282
+ and should no longer be used."
283
+ ::= { netSnmpExampleNotifications 1 }
284
+
285
+ END
@@ -0,0 +1,325 @@
1
+ NET-SNMP-EXTEND-MIB DEFINITIONS ::= BEGIN
2
+
3
+ --
4
+ -- Defines a framework for scripted extensions
5
+ --
6
+
7
+ IMPORTS
8
+ nsExtensions FROM NET-SNMP-AGENT-MIB
9
+
10
+ OBJECT-TYPE, NOTIFICATION-TYPE, MODULE-IDENTITY, Integer32
11
+ FROM SNMPv2-SMI
12
+
13
+ OBJECT-GROUP, NOTIFICATION-GROUP
14
+ FROM SNMPv2-CONF
15
+
16
+ DisplayString, RowStatus, StorageType FROM SNMPv2-TC;
17
+
18
+
19
+ netSnmpExtendMIB MODULE-IDENTITY
20
+ LAST-UPDATED "201003170000Z"
21
+ ORGANIZATION "www.net-snmp.org"
22
+ CONTACT-INFO
23
+ "postal: Wes Hardaker
24
+ P.O. Box 382
25
+ Davis CA 95617
26
+
27
+ email: net-snmp-coders@lists.sourceforge.net"
28
+ DESCRIPTION
29
+ "Defines a framework for scripted extensions for the Net-SNMP agent."
30
+ REVISION "201003170000Z"
31
+ DESCRIPTION
32
+ "Fixed inconsistencies in the definition of nsExtendConfigTable."
33
+ REVISION "200405080000Z"
34
+ DESCRIPTION
35
+ "First revision."
36
+ ::= { nsExtensions 1 }
37
+
38
+ nsExtendObjects OBJECT IDENTIFIER ::= { nsExtensions 2}
39
+ nsExtendGroups OBJECT IDENTIFIER ::= { nsExtensions 3}
40
+
41
+ nsExtendNumEntries OBJECT-TYPE
42
+ SYNTAX INTEGER
43
+ MAX-ACCESS read-only
44
+ STATUS current
45
+ DESCRIPTION
46
+ "The number of rows in the nsExtendConfigTable"
47
+ ::= { nsExtendObjects 1 }
48
+
49
+ nsExtendConfigTable OBJECT-TYPE
50
+ SYNTAX SEQUENCE OF NsExtendConfigEntry
51
+ MAX-ACCESS not-accessible
52
+ STATUS current
53
+ DESCRIPTION
54
+ "A table of scripted extensions - configuration and (basic) output."
55
+ ::= { nsExtendObjects 2 }
56
+
57
+ nsExtendConfigEntry OBJECT-TYPE
58
+ SYNTAX NsExtendConfigEntry
59
+ MAX-ACCESS not-accessible
60
+ STATUS current
61
+ DESCRIPTION
62
+ "A conceptual row within the extension table."
63
+ INDEX { nsExtendToken }
64
+ ::= { nsExtendConfigTable 1 }
65
+
66
+ NsExtendConfigEntry ::= SEQUENCE {
67
+ nsExtendToken DisplayString,
68
+ nsExtendCommand DisplayString,
69
+ nsExtendArgs DisplayString,
70
+ nsExtendInput DisplayString,
71
+ nsExtendCacheTime INTEGER,
72
+ nsExtendExecType INTEGER,
73
+ nsExtendRunType INTEGER,
74
+
75
+ nsExtendStorage StorageType,
76
+ nsExtendStatus RowStatus
77
+ }
78
+
79
+ --
80
+ -- The configuration of an extension command
81
+ --
82
+
83
+ nsExtendToken OBJECT-TYPE
84
+ SYNTAX DisplayString
85
+ MAX-ACCESS not-accessible
86
+ STATUS current
87
+ DESCRIPTION
88
+ "An arbitrary token to identify this extension entry"
89
+ ::= { nsExtendConfigEntry 1 }
90
+
91
+ nsExtendCommand OBJECT-TYPE
92
+ SYNTAX DisplayString
93
+ MAX-ACCESS read-create
94
+ STATUS current
95
+ DESCRIPTION
96
+ "The full path of the command binary (or script) to run"
97
+ ::= { nsExtendConfigEntry 2 }
98
+
99
+ nsExtendArgs OBJECT-TYPE
100
+ SYNTAX DisplayString
101
+ MAX-ACCESS read-create
102
+ STATUS current
103
+ DESCRIPTION
104
+ "Any command-line arguments for the command"
105
+ DEFVAL { ''H } -- the empty string
106
+ ::= { nsExtendConfigEntry 3 }
107
+
108
+ nsExtendInput OBJECT-TYPE
109
+ SYNTAX DisplayString
110
+ MAX-ACCESS read-create
111
+ STATUS current
112
+ DESCRIPTION
113
+ "The standard input for the command"
114
+ DEFVAL { ''H } -- the empty string
115
+ ::= { nsExtendConfigEntry 4 }
116
+
117
+ nsExtendCacheTime OBJECT-TYPE
118
+ SYNTAX INTEGER
119
+ MAX-ACCESS read-create
120
+ STATUS current
121
+ DESCRIPTION
122
+ "The length of time for which the output of
123
+ this command will be cached. During this time,
124
+ retrieving the output-related values will not
125
+ reinvoke the command.
126
+ A value of -1 indicates that the output results
127
+ should not be cached at all, and retrieving each
128
+ individual output-related value will invoke the
129
+ command afresh."
130
+ DEFVAL { 5 }
131
+ ::= { nsExtendConfigEntry 5 }
132
+
133
+ nsExtendExecType OBJECT-TYPE
134
+ SYNTAX INTEGER
135
+ { exec (1), -- 'fork-and-exec'
136
+ shell (2) -- run via a sub-shell
137
+ }
138
+ MAX-ACCESS read-create
139
+ STATUS current
140
+ DESCRIPTION
141
+ "The mechanism used to invoke the command."
142
+ DEFVAL { exec }
143
+ ::= { nsExtendConfigEntry 6 }
144
+
145
+ nsExtendRunType OBJECT-TYPE
146
+ SYNTAX INTEGER
147
+ { run-on-read (1),
148
+ run-on-set (2),
149
+ run-command (3)
150
+ }
151
+ MAX-ACCESS read-create
152
+ STATUS current
153
+ DESCRIPTION
154
+ "Used to implement 'push-button' command invocation.
155
+ The command for a 'run-on-read' entry will be invoked
156
+ whenever one of the corresponding output-related
157
+ instances is requested (and assuming the cached value
158
+ is not still current).
159
+ The command for a 'run-on-set' entry will only be invoked
160
+ on receipt of a SET assignment for this object with the
161
+ value 'run-command'.
162
+ Reading an instance of this object will always return either
163
+ 'run-on-read' or 'run-on-set'.
164
+ "
165
+ DEFVAL { run-on-read }
166
+ ::= { nsExtendConfigEntry 7 }
167
+
168
+ --
169
+ -- Standard table-manipulation objects
170
+ --
171
+
172
+ nsExtendStorage OBJECT-TYPE
173
+ SYNTAX StorageType
174
+ MAX-ACCESS read-create
175
+ STATUS current
176
+ DESCRIPTION
177
+ "The storage type for this conceptual row."
178
+ DEFVAL { volatile }
179
+ ::= { nsExtendConfigEntry 20 }
180
+
181
+ nsExtendStatus OBJECT-TYPE
182
+ SYNTAX RowStatus
183
+ MAX-ACCESS read-create
184
+ STATUS current
185
+ DESCRIPTION
186
+ "Used to create new rows in the table, in the standard manner.
187
+ Note that is valid for an instance to be left with the value
188
+ notInService(2) indefinitely - i.e. the meaning of 'abnormally
189
+ long' (see RFC 2579, RowStatus) for this table is infinite."
190
+ ::= { nsExtendConfigEntry 21 }
191
+
192
+
193
+ --
194
+ -- The results of running the extension command
195
+ --
196
+
197
+ nsExtendOutput1Table OBJECT-TYPE
198
+ SYNTAX SEQUENCE OF NsExtendOutput1Entry
199
+ MAX-ACCESS not-accessible
200
+ STATUS current
201
+ DESCRIPTION
202
+ "A table of scripted extensions - configuration and (basic) output."
203
+ ::= { nsExtendObjects 3 }
204
+
205
+ nsExtendOutput1Entry OBJECT-TYPE
206
+ SYNTAX NsExtendOutput1Entry
207
+ MAX-ACCESS not-accessible
208
+ STATUS current
209
+ DESCRIPTION
210
+ "A conceptual row within the extension table."
211
+ AUGMENTS { nsExtendConfigEntry }
212
+ ::= { nsExtendOutput1Table 1 }
213
+
214
+ NsExtendOutput1Entry ::= SEQUENCE {
215
+ nsExtendOutput1Line DisplayString,
216
+ nsExtendOutputFull DisplayString,
217
+ nsExtendOutNumLines Integer32,
218
+ nsExtendResult Integer32
219
+ }
220
+
221
+ nsExtendOutput1Line OBJECT-TYPE
222
+ SYNTAX DisplayString
223
+ MAX-ACCESS read-only
224
+ STATUS current
225
+ DESCRIPTION
226
+ "The first line of output from the command"
227
+ ::= { nsExtendOutput1Entry 1 }
228
+
229
+ nsExtendOutputFull OBJECT-TYPE
230
+ SYNTAX DisplayString
231
+ MAX-ACCESS read-only
232
+ STATUS current
233
+ DESCRIPTION
234
+ "The full output from the command, as a single string"
235
+ ::= { nsExtendOutput1Entry 2 }
236
+
237
+ nsExtendOutNumLines OBJECT-TYPE
238
+ SYNTAX Integer32
239
+ MAX-ACCESS read-only
240
+ STATUS current
241
+ DESCRIPTION
242
+ "The number of lines of output (and hence
243
+ the number of rows in nsExtendOutputTable
244
+ relating to this particular entry)."
245
+ ::= { nsExtendOutput1Entry 3 }
246
+
247
+ nsExtendResult OBJECT-TYPE
248
+ SYNTAX Integer32
249
+ MAX-ACCESS read-only
250
+ STATUS current
251
+ DESCRIPTION
252
+ "The return value of the command."
253
+ ::= { nsExtendOutput1Entry 4 }
254
+
255
+
256
+ --
257
+ -- The line-based output table
258
+ --
259
+
260
+ nsExtendOutput2Table OBJECT-TYPE
261
+ SYNTAX SEQUENCE OF NsExtendOutput2Entry
262
+ MAX-ACCESS not-accessible
263
+ STATUS current
264
+ DESCRIPTION
265
+ "A table of (line-based) output from scripted extensions."
266
+ ::= { nsExtendObjects 4 }
267
+
268
+ nsExtendOutput2Entry OBJECT-TYPE
269
+ SYNTAX NsExtendOutput2Entry
270
+ MAX-ACCESS not-accessible
271
+ STATUS current
272
+ DESCRIPTION
273
+ "A conceptual row within the line-based output table."
274
+ INDEX { nsExtendToken, nsExtendLineIndex }
275
+ ::= { nsExtendOutput2Table 1 }
276
+
277
+ NsExtendOutput2Entry ::= SEQUENCE {
278
+ nsExtendLineIndex INTEGER,
279
+ nsExtendOutLine DisplayString
280
+ }
281
+
282
+ nsExtendLineIndex OBJECT-TYPE
283
+ SYNTAX INTEGER(1..1024)
284
+ MAX-ACCESS not-accessible
285
+ STATUS current
286
+ DESCRIPTION
287
+ "The index of this line of output.
288
+ For a given nsExtendToken, this will run from
289
+ 1 to the corresponding value of nsExtendNumLines."
290
+ ::= { nsExtendOutput2Entry 1 }
291
+
292
+ nsExtendOutLine OBJECT-TYPE
293
+ SYNTAX DisplayString
294
+ MAX-ACCESS read-only
295
+ STATUS current
296
+ DESCRIPTION
297
+ "A single line of output from the extension command."
298
+ ::= { nsExtendOutput2Entry 2 }
299
+
300
+ --
301
+ -- Conformance-related definitions
302
+ --
303
+
304
+ nsExtendConfigGroup OBJECT-GROUP
305
+ OBJECTS {
306
+ nsExtendCommand, nsExtendArgs, nsExtendInput,
307
+ nsExtendCacheTime, nsExtendExecType, nsExtendRunType,
308
+ nsExtendStorage, nsExtendStatus, nsExtendNumEntries
309
+ }
310
+ STATUS current
311
+ DESCRIPTION
312
+ "Objects relating to the configuration of extension commands."
313
+ ::= { nsExtendGroups 1 }
314
+
315
+ nsExtendOutputGroup OBJECT-GROUP
316
+ OBJECTS {
317
+ nsExtendOutNumLines, nsExtendResult,
318
+ nsExtendOutLine, nsExtendOutput1Line, nsExtendOutputFull
319
+ }
320
+ STATUS current
321
+ DESCRIPTION
322
+ "Objects relating to the output of extension commands."
323
+ ::= { nsExtendGroups 2 }
324
+
325
+ END