1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
|
#
# This file is part of pysnmp software.
#
# Copyright (c) 2005-2016, Ilya Etingof <ilya@glas.net>
# License: http://pysnmp.sf.net/license.html
#
from sys import version
from time import time
from pysnmp import __version__
(MibScalarInstance,
TimeTicks) = mibBuilder.importSymbols(
'SNMPv2-SMI',
'MibScalarInstance',
'TimeTicks'
)
(sysDescr,
sysObjectID,
sysUpTime,
sysContact,
sysName,
sysLocation,
sysServices,
sysORLastChange,
snmpInPkts,
snmpOutPkts,
snmpInBadVersions,
snmpInBadCommunityNames,
snmpInBadCommunityUses,
snmpInASNParseErrs,
snmpInTooBigs,
snmpInNoSuchNames,
snmpInBadValues,
snmpInReadOnlys,
snmpInGenErrs,
snmpInTotalReqVars,
snmpInTotalSetVars,
snmpInGetRequests,
snmpInGetNexts,
snmpInSetRequests,
snmpInGetResponses,
snmpInTraps,
snmpOutTooBigs,
snmpOutNoSuchNames,
snmpOutBadValues,
snmpOutGenErrs,
snmpOutSetRequests,
snmpOutGetResponses,
snmpOutTraps,
snmpEnableAuthenTraps,
snmpSilentDrops,
snmpProxyDrops,
snmpTrapOID,
coldStart,
snmpSetSerialNo) = mibBuilder.importSymbols(
'SNMPv2-MIB',
'sysDescr',
'sysObjectID',
'sysUpTime',
'sysContact',
'sysName',
'sysLocation',
'sysServices',
'sysORLastChange',
'snmpInPkts',
'snmpOutPkts',
'snmpInBadVersions',
'snmpInBadCommunityNames',
'snmpInBadCommunityUses',
'snmpInASNParseErrs',
'snmpInTooBigs',
'snmpInNoSuchNames',
'snmpInBadValues',
'snmpInReadOnlys',
'snmpInGenErrs',
'snmpInTotalReqVars',
'snmpInTotalSetVars',
'snmpInGetRequests',
'snmpInGetNexts',
'snmpInSetRequests',
'snmpInGetResponses',
'snmpInTraps',
'snmpOutTooBigs',
'snmpOutNoSuchNames',
'snmpOutBadValues',
'snmpOutGenErrs',
'snmpOutSetRequests',
'snmpOutGetResponses',
'snmpOutTraps',
'snmpEnableAuthenTraps',
'snmpSilentDrops',
'snmpProxyDrops',
'snmpTrapOID',
'coldStart',
'snmpSetSerialNo'
)
__sysDescr = MibScalarInstance(sysDescr.name, (0,), sysDescr.syntax.clone(
"PySNMP engine version %s, Python %s" % (__version__, version.replace('\n', ' ').replace('\r', ' '))))
__sysObjectID = MibScalarInstance(sysObjectID.name, (0,), sysObjectID.syntax.clone((1, 3, 6, 1, 4, 1, 20408)))
class SysUpTime(TimeTicks):
createdAt = time()
def clone(self, **kwargs):
if 'value' not in kwargs:
kwargs['value'] = int((time() - self.createdAt) * 100)
return TimeTicks.clone(self, **kwargs)
__sysUpTime = MibScalarInstance(sysUpTime.name, (0,), SysUpTime(0))
__sysContact = MibScalarInstance(sysContact.name, (0,), sysContact.syntax.clone(''))
__sysName = MibScalarInstance(sysName.name, (0,), sysName.syntax.clone(''))
__sysLocation = MibScalarInstance(sysLocation.name, (0,), sysLocation.syntax.clone(''))
__sysServices = MibScalarInstance(sysServices.name, (0,), sysServices.syntax.clone(0))
__sysORLastChange = MibScalarInstance(sysORLastChange.name, (0,), sysORLastChange.syntax.clone(0))
__snmpInPkts = MibScalarInstance(snmpInPkts.name, (0,), snmpInPkts.syntax.clone(0))
__snmpOutPkts = MibScalarInstance(snmpOutPkts.name, (0,), snmpOutPkts.syntax.clone(0))
__snmpInBadVersions = MibScalarInstance(snmpInBadVersions.name, (0,), snmpInBadVersions.syntax.clone(0))
__snmpInBadCommunityNames = MibScalarInstance(snmpInBadCommunityNames.name, (0,),
snmpInBadCommunityNames.syntax.clone(0))
__snmpInBadCommunityUses = MibScalarInstance(snmpInBadCommunityUses.name, (0,), snmpInBadCommunityUses.syntax.clone(0))
__snmpInASNParseErrs = MibScalarInstance(snmpInASNParseErrs.name, (0,), snmpInASNParseErrs.syntax.clone(0))
__snmpInTooBigs = MibScalarInstance(snmpInTooBigs.name, (0,), snmpInTooBigs.syntax.clone(0))
__snmpInNoSuchNames = MibScalarInstance(snmpInNoSuchNames.name, (0,), snmpInNoSuchNames.syntax.clone(0))
__snmpInBadValues = MibScalarInstance(snmpInBadValues.name, (0,), snmpInBadValues.syntax.clone(0))
__snmpInReadOnlys = MibScalarInstance(snmpInReadOnlys.name, (0,), snmpInReadOnlys.syntax.clone(0))
__snmpInGenErrs = MibScalarInstance(snmpInGenErrs.name, (0,), snmpInGenErrs.syntax.clone(0))
__snmpInTotalReqVars = MibScalarInstance(snmpInTotalReqVars.name, (0,), snmpInTotalReqVars.syntax.clone(0))
__snmpInTotalSetVars = MibScalarInstance(snmpInTotalSetVars.name, (0,), snmpInTotalSetVars.syntax.clone(0))
__snmpInGetRequests = MibScalarInstance(snmpInGetRequests.name, (0,), snmpInGetRequests.syntax.clone(0))
__snmpInGetNexts = MibScalarInstance(snmpInGetNexts.name, (0,), snmpInGetNexts.syntax.clone(0))
__snmpInSetRequests = MibScalarInstance(snmpInSetRequests.name, (0,), snmpInSetRequests.syntax.clone(0))
__snmpInGetResponses = MibScalarInstance(snmpInGetResponses.name, (0,), snmpInGetResponses.syntax.clone(0))
__snmpInTraps = MibScalarInstance(snmpInTraps.name, (0,), snmpInTraps.syntax.clone(0))
__snmpOutTooBigs = MibScalarInstance(snmpOutTooBigs.name, (0,), snmpOutTooBigs.syntax.clone(0))
__snmpOutNoSuchNames = MibScalarInstance(snmpOutNoSuchNames.name, (0,), snmpOutNoSuchNames.syntax.clone(0))
__snmpOutBadValues = MibScalarInstance(snmpOutBadValues.name, (0,), snmpOutBadValues.syntax.clone(0))
__snmpOutGenErrs = MibScalarInstance(snmpOutGenErrs.name, (0,), snmpOutGenErrs.syntax.clone(0))
__snmpOutSetRequests = MibScalarInstance(snmpOutSetRequests.name, (0,), snmpOutSetRequests.syntax.clone(0))
__snmpOutGetResponses = MibScalarInstance(snmpOutGetResponses.name, (0,), snmpOutGetResponses.syntax.clone(0))
__snmpOutTraps = MibScalarInstance(snmpOutTraps.name, (0,), snmpOutTraps.syntax.clone(0))
__snmpEnableAuthenTraps = MibScalarInstance(snmpEnableAuthenTraps.name, (0,), snmpEnableAuthenTraps.syntax.clone(1))
__snmpSilentDrops = MibScalarInstance(snmpSilentDrops.name, (0,), snmpSilentDrops.syntax.clone(0))
__snmpProxyDrops = MibScalarInstance(snmpProxyDrops.name, (0,), snmpProxyDrops.syntax.clone(0))
__snmpTrapOID = MibScalarInstance(snmpTrapOID.name, (0,), snmpTrapOID.syntax.clone(coldStart.name))
__snmpSetSerialNo = MibScalarInstance(snmpSetSerialNo.name, (0,), snmpSetSerialNo.syntax.clone(0))
mibBuilder.exportSymbols(
"__SNMPv2-MIB",
sysDescr=__sysDescr,
sysObjectID=__sysObjectID,
sysUpTime=__sysUpTime,
sysContact=__sysContact,
sysName=__sysName,
sysLocation=__sysLocation,
sysServices=__sysServices,
sysORLastChange=__sysORLastChange,
snmpInPkts=__snmpInPkts,
snmpOutPkts=__snmpOutPkts,
snmpInBadVersions=__snmpInBadVersions,
snmpInBadCommunityNames=__snmpInBadCommunityNames,
snmpInBadCommunityUses=__snmpInBadCommunityUses,
snmpInASNParseErrs=__snmpInASNParseErrs,
snmpInTooBigs=__snmpInTooBigs,
snmpInNoSuchNames=__snmpInNoSuchNames,
snmpInBadValues=__snmpInBadValues,
snmpInReadOnlys=__snmpInReadOnlys,
snmpInGenErrs=__snmpInGenErrs,
snmpInTotalReqVars=__snmpInTotalReqVars,
snmpInTotalSetVars=__snmpInTotalSetVars,
snmpInGetRequests=__snmpInGetRequests,
snmpInGetNexts=__snmpInGetNexts,
snmpInSetRequests=__snmpInSetRequests,
snmpInGetResponses=__snmpInGetResponses,
snmpInTraps=__snmpInTraps,
snmpOutTooBigs=__snmpOutTooBigs,
snmpOutNoSuchNames=__snmpOutNoSuchNames,
snmpOutBadValues=__snmpOutBadValues,
snmpOutGenErrs=__snmpOutGenErrs,
snmpOutSetRequests=__snmpOutSetRequests,
snmpOutGetResponses=__snmpOutGetResponses,
snmpOutTraps=__snmpOutTraps,
snmpEnableAuthenTraps=__snmpEnableAuthenTraps,
snmpSilentDrops=__snmpSilentDrops,
snmpProxyDrops=__snmpProxyDrops,
snmpTrapOID=__snmpTrapOID,
snmpSetSerialNo=__snmpSetSerialNo
)
|