Add Multiple SNMP Agents to Telegraf Config
Video Lecture
Description
I will add several more SNMP agents to the Telegraf config.
In order for Telegraf to connect to the external SNMP agents, those other SNMP agents will need to be configured to allow my Telegraf agent to connect remotely.
On my servers, that I'd like monitor using SNMP, I install SNMPD using
1 |
|
I then configure snmpd.conf.
1 |
|
I change below,
1 2 3 |
|
1 2 3 |
|
and I change below
1 2 3 4 |
|
to return more data,
1 2 3 4 |
|
and I change below,
1 2 3 4 |
|
1 2 3 4 |
|
The SNMPD can now be connected to remotely by anybody on the internet, so I use iptables to restrict UDP connections on port 161 to the localhost and my external Grafana server domain or ip only.
1 2 3 4 |
|
I then start the SNMPD service
1 |
|
I then go back to my Grafana server, and test that I can query the new SNMPD on the other server using SNMPWALK.
1 |
|
I then reconfigure the Telegraf conf to add the information for my external SNMP agent.
I duplicate the existing [[inputs.snmp]] section from the last lecture, but change the SNMP agents address.
I also repeat the process for another server that I want to monitor SNMP for, so at the end of the lecture, I have 3 SNMP agents able to be queried using Grafana.
After I've added all my SNMP agent configs to the telegraf.conf, I then restart the Telegraf service on my Grafana server.
1 |
|