This page seems to give clear instructions on how to get CollectD to write to the Azure agent: https://docs.microsoft.com/en-us/azure/azure-monitor/agents/data-sources-collectd
These pages (here and enter link description here) seem to have pretty clear config with examples for polling various device types.
Can you share some of the errors that you're encountering? There's also the Linux snmpwalk
tool that might help with debugging SNMP? I think I used it a long time ago to set things up, testing all the strings were correct.
UPDATE:
I've done the following to test on an EC2 instance so far, and can get CollectD to print out what it finds from SNMP. I'd suggest you get this working and then move on to pushing to Azure.
- Boot Amazon Linux
- Install
net-snmp
and net-snmp-utils
- Install
collectd
and collectd-snmp
- Create configs
- Start snmpd service
- Test snmpwalk
- Test collectd
Install Commands:
amazon-linux-extras install collectd
yum install -y net-snmp net-snmp-utils collectd-snmp
Config:
/etc/snmp/snmpd.conf
:
com2sec AllUser default changeme
group AllGroup v2c AllUser
view SystemView included .1.3.6.1.2.1.1
view SystemView included .1.3.6.1.2.1.25.1.1
view AllView included .1
access AllGroup "" any noauth exact AllView none none
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
dontLogTCPWrappersConnects yes
/etc/collectd.conf
:
Hostname "localhost"
FQDNLookup true
BaseDir "/var/lib/collectd"
PIDFile "/var/run/collectd.pid"
PluginDir "/usr/lib64/collectd"
TypesDB "/usr/share/collectd/types.db"
LoadPlugin logfile
<Plugin logfile>
LogLevel info
File STDOUT
Timestamp true
PrintSeverity false
</Plugin>
# LoadPlugin cpu
# LoadPlugin interface
# LoadPlugin load
# LoadPlugin memory
LoadPlugin snmp
LoadPlugin write_log
<Plugin snmp>
<Data "hr_processes">
Type "gauge"
Table false
Instance ""
Shift -1
Values "HOST-RESOURCES-MIB::hrSystemProcesses.0"
</Data>
<Host "localhost">
Address "localhost"
Version 2
Community "changeme"
Collect "std_traffic" "hr_processes"
</Host>
</Plugin>
Include "/etc/collectd.d"
Command outputs:
# snmpwalk -v 2c -c changeme -O e localhost | grep hrSystemProcesses
HOST-RESOURCES-MIB::hrSystemProcesses.0 = Gauge32: 95
HOST-RESOURCES-MIB::hrSWRunParameters.32729 = STRING: "--color=auto hrSystemProcesses"
# collectd -f -C /etc/collectd.conf
[2022-01-11 12:34:32] plugin_load: plugin "logfile" successfully loaded.
[2022-01-11 12:34:32] plugin_load: plugin "snmp" successfully loaded.
[2022-01-11 12:34:32] plugin_load: plugin "write_log" successfully loaded.
[2022-01-11 12:34:32] snmp plugin: No such data configured: `std_traffic'
[2022-01-11 12:34:32] Initialization complete, entering read-loop.
[2022-01-11 12:34:32] write_log values:
localhost.snmp.gauge 94 1641904472
^C[2022-01-11 12:34:34] Exiting normally.
[2022-01-11 12:34:34] collectd: Stopping 5 read threads.
[2022-01-11 12:34:34] collectd: Stopping 5 write threads.