code:
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
| # Config file for collectd(1).
#
# Some plugins need additional configuration and are disabled by default.
# Please read collectd.conf(5) for details.
#
# You should also read /usr/share/doc/collectd-core/README.Debian.plugins
# before enabling any more plugins.
##############################################################################
# Global #
#----------------------------------------------------------------------------#
# Global settings for the daemon. #
##############################################################################
Hostname "hostname"
FQDNLookup true
#BaseDir "/var/lib/collectd"
#PluginDir "/usr/lib/collectd"
#TypesDB "/usr/share/collectd/types.db" "/etc/collectd/my_types.db"
#----------------------------------------------------------------------------#
# When enabled, plugins are loaded automatically with the default options #
# when an appropriate <Plugin ...> block is encountered. #
# Disabled by default. #
#----------------------------------------------------------------------------#
AutoLoadPlugin false
#----------------------------------------------------------------------------#
# Interval at which to query values. This may be overwritten on a per-plugin #
# base by using the 'Interval' option of the LoadPlugin block: #
# <LoadPlugin foo> #
# Interval 60 #
# </LoadPlugin> #
#----------------------------------------------------------------------------#
Interval 10
#Timeout 2
#ReadThreads 5
#WriteThreads 5
# Limit the size of the write queue. Default is no limit. Setting up a limit
# is recommended for servers handling a high volume of traffic.
#WriteQueueLimitHigh 1000000
#WriteQueueLimitLow 800000
##############################################################################
# Logging #
#----------------------------------------------------------------------------#
# Plugins which provide logging functions should be loaded first, so log #
# messages generated when loading or configuring other plugins can be #
# accessed. #
##############################################################################
LoadPlugin logfile
LoadPlugin syslog
<Plugin logfile>
LogLevel "info"
File "/var/log/collectd.log"
Timestamp true
PrintSeverity false
</Plugin>
<Plugin syslog>
LogLevel info
</Plugin>
##############################################################################
# LoadPlugin section #
#----------------------------------------------------------------------------#
# Specify what features to activate. #
##############################################################################
#LoadPlugin aggregation
#LoadPlugin amqp
#LoadPlugin apache
#LoadPlugin apcups
#LoadPlugin ascent
#LoadPlugin battery
#LoadPlugin bind
#LoadPlugin cgroups
#LoadPlugin conntrack
#LoadPlugin contextswitch
LoadPlugin cpu
#LoadPlugin cpufreq
#LoadPlugin csv
#LoadPlugin curl
#LoadPlugin curl_json
#LoadPlugin curl_xml
#LoadPlugin dbi
#LoadPlugin df
#LoadPlugin disk
#LoadPlugin dns
#LoadPlugin email
#LoadPlugin entropy
#LoadPlugin ethstat
#LoadPlugin exec
#LoadPlugin filecount
#LoadPlugin fscache
#LoadPlugin gmond
#LoadPlugin hddtemp
LoadPlugin interface
#LoadPlugin ipmi
#LoadPlugin iptables
#LoadPlugin ipvs
LoadPlugin irq
#LoadPlugin java
#LoadPlugin libvirt
LoadPlugin load
#LoadPlugin lvm
#LoadPlugin madwifi
#LoadPlugin mbmon
#LoadPlugin md
#LoadPlugin memcachec
#LoadPlugin memcached
LoadPlugin memory
#LoadPlugin modbus
#LoadPlugin multimeter
#LoadPlugin mysql
#LoadPlugin netlink
#LoadPlugin network
#LoadPlugin nfs
#LoadPlugin nginx
#LoadPlugin notify_desktop
#LoadPlugin notify_email
#LoadPlugin ntpd
#LoadPlugin numa
#LoadPlugin nut
#LoadPlugin olsrd
#LoadPlugin openvpn
#<LoadPlugin perl>
# Globals true
#</LoadPlugin>
#LoadPlugin pinba
#LoadPlugin ping
#LoadPlugin postgresql
#LoadPlugin powerdns
LoadPlugin processes
#LoadPlugin protocols
#<LoadPlugin python>
# Globals true
#</LoadPlugin>
LoadPlugin apache
LoadPlugin cpu
LoadPlugin df
LoadPlugin entropy
LoadPlugin interface
LoadPlugin load
LoadPlugin memory
LoadPlugin processes
LoadPlugin users
#LoadPlugin rrdcached
LoadPlugin rrdtool
#LoadPlugin sensors
LoadPlugin serial
LoadPlugin snmp
#LoadPlugin statsd
LoadPlugin swap
#LoadPlugin table
#LoadPlugin tail
#LoadPlugin tail_csv
#LoadPlugin tcpconns
#LoadPlugin teamspeak2
#LoadPlugin ted
#LoadPlugin thermal
#LoadPlugin tokyotyrant
#LoadPlugin unixsock
#LoadPlugin uptime
LoadPlugin users
#LoadPlugin uuid
#LoadPlugin varnish
#LoadPlugin vmem
#LoadPlugin vserver
#LoadPlugin wireless
LoadPlugin write_graphite
#LoadPlugin write_http
#LoadPlugin write_riemann
##############################################################################
# Plugin configuration #
#----------------------------------------------------------------------------#
# In this section configuration stubs for each plugin are provided. A desc- #
# ription of those options is available in the collectd.conf(5) manual page. #
##############################################################################
<Plugin apache>
<Instance "Graphite">
URL "http://localhost/server-status?auto"
# User "www-user"
# Password "secret"
# VerifyPeer false
# VerifyHost false
# CACert "/etc/ssl/ca.crt"
Server "apache"
</Instance>
</Plugin>
# See /usr/share/doc/collectd/examples/snmp-data.conf.gz for a
# comprehensive sample configuration.
#<Plugin snmp>
# <Data "powerplus_voltge_input">
# Type "voltage"
# Table false
# Instance "input_line1"
# Scale 0.1
# Values "SNMPv2-SMI::enterprises.6050.5.4.1.1.2.1"
# </Data>
# <Data "hr_users">
# Type "users"
# Table false
# Instance ""
# Shift -1
# Values "HOST-RESOURCES-MIB::hrSystemNumUsers.0"
# </Data>
# <Data "std_traffic">
# Type "if_octets"
# Table true
# InstancePrefix "traffic"
# Instance "IF-MIB::ifDescr"
# Values "IF-MIB::ifInOctets" "IF-MIB::ifOutOctets"
# </Data>
#
# <Host "some.switch.mydomain.org">
# Address "192.168.0.2"
# Version 1
# Community "community_string"
# Collect "std_traffic"
# Inverval 120
# </Host>
# <Host "some.server.mydomain.org">
# Address "192.168.0.42"
# Version 2
# Community "another_string"
# Collect "std_traffic" "hr_users"
# </Host>
# <Host "some.ups.mydomain.org">
# Address "192.168.0.3"
# Version 1
# Community "more_communities"
# Collect "powerplus_voltge_input"
# Interval 300
# </Host>
#</Plugin>
##### Niels added:
<Plugin snmp>
<Data "if_throughput">
Type "if_octets"
Table true
Instance "IF-MIB::ifDescr"
Values "IF-MIB::ifHCInOctets" "IF-MIB::ifHCOutOctets"
</Data>
<Data "if_operstatus">
Type "gauge"
Table true
Instance "IF-MIB::ifDescr"
Values "IF-MIB::ifOperStatus"
</Data>
<Data "sysUptime">
Type "counter"
Table false
Instance "RFC1213-MIB"
Values "1.3.6.1.2.1.1.3.0"
</Data>
<Host "klant1">
Address "192.168.0.5"
Version 2
Community "censuur"
Collect "if_throughput" "if_operstatus" "sysUptime"
</Host>
<Host "klant2">
Address "192.168.0.4"
Version 2
Community "censuur"
Collect "if_throughput" "if_operstatus" "sysUptime"
</Host>
</Plugin>
<Plugin write_graphite>
<Node "graphing">
Host "localhost"
Port "2003"
Protocol "tcp"
LogSendErrors true
Prefix "snmp."
Postfix ""
StoreRates true
AlwaysAppendDS false
EscapeCharacter "_"
</Node>
</Plugin>
<Include "/etc/collectd/collectd.conf.d">
Filter "*.conf"
</Include> |
edit::

Hier heb ik net de sysdescr alweer uit verwijderd.. dus hier heb je niets aan. ik probeer het opnieuw, sorry.
Wat ik dus wil doen is de textwaardes zoals naam, locatie en bijvoorbeeld router model registreren en weergeven zoals het is: gewoon text. Ik denk dat het probleem de juiste 'type' selecteren is, dus gauge, counter, of iets dergelijks maar ik weet niet welke.
code:
1
2
3
4
5
6
| <Data "sysName">
Type "string"
Table false
Instance "SNMPv2-MIB"
Values "sysName"
</Data> |
Ik heb bovenstaand blokje nu ingevoegd in de configuratie van de snmp plugin. In /var/log/collectd.log zie ik nu echter:
code:
1
2
3
| [2016-02-29 14:36:39] snmp plugin: DataSet `string' not defined.
[2016-02-29 14:36:49] snmp plugin: DataSet `string' not defined.
[2016-02-29 14:36:51] snmp plugin: DataSet `string' not defined. |
...dat 'string' geen geldig data type is, dus ik moet of op zoek naar een andere string, of deze wellicht zelf definieren(?)
Aanvulling #?
Ik heb nu
aangepast naar
, en nu zit de logfile er als volgt uit:
code:
1
2
| [2016-02-29 14:49:33] snmp plugin: OID "SNMPv2-MIB::sysName" is undefined (type ASN_NULL)
[2016-02-29 14:49:43] snmp plugin: OID "SNMPv2-MIB::sysName" is undefined (type ASN_NULL) |
Aanvulling 3
Omdat nu (ineens??) de 'vriendelijke' oid value niet herkend wordt heb ik nu de numerieke oid ingevuld bij Values: 1.3.6.1.2.1.1.5.0
code:
1
2
3
4
5
6
| <Data "sysName">
Type "absolute"
Table false
Instance "SNMPv2-MIB"
Values "1.3.6.1.2.1.1.5.0"
</Data> |
logfile is nu echter als volgt, dus ik heb weer een cirkeltje rondgemaakt en ben weer terug bij af...
code:
1
2
3
4
| [2016-02-29 14:53:10] parse_value: Failed to parse string as absolute: (null).
[2016-02-29 14:53:10] snmp plugin: csnmp_value_list_to_value: Parsing string as absolute failed: Klant1_hostnaam
[2016-02-29 14:53:10] parse_value: Failed to parse string as absolute: (null).
[2016-02-29 14:53:10] snmp plugin: csnmp_value_list_to_value: Parsing string as absolute failed: Klant2_hostnaam |
[
Voor 18% gewijzigd door
n1els op 29-02-2016 07:58
]
Dimidium facti qui bene coepit habet: sapere aude.