Part 3 will focus on getting SNMP Metrics to your Grafana setup.

In this demo, we will be pulling SNMP information using Collectd and putting that info into InfluxDB and displaying ti with Grafana.

For the simple setup, we are going to use a Windows host.
Later on we will use a network Device.

On your windows computer open up ‘Services’ and look for the service named “SNMP Service”
If it is not present, you may need to install the feature using the Server Manager Add roles and features wizard –> Features –> SNMP Service
Right click and select properties of this service and then select the Security tab:

Make sure you only have a READ ONLY rights assigned. We don’t want any mishaps here!
If you want to specify a single host, you can also do that here, add your Grafana server’s IP in there.

Start the service, and make it automatic start on boot.

Now, onto Collectd, and telling CollectD to fetch SNMP information.
All configuration is done through the collectd.conf file located in /etc/collectd/
This is somewhat confusing if you are new to this.

First,
Setup your services that you wish to probe,
For instance,

 

<Data "CPU_Usage">
 type "percent"
 table true
 instanceprefix "CPUCore"
# Instance "HOST-RESOURCES-MIB::hrProcessorEntry"
 scale 1
 values "HOST-RESOURCES-MIB::hrProcessorLoad"
</Data>

Will probe the CPU Usage of the system.

<Data "hrStorageSize">
 type "bytes"
 table true
 instanceprefix "Total-"
 instance "HOST-RESOURCES-MIB::hrStorageDescr"
 values "HOST-RESOURCES-MIB::hrStorageSize"
</Data>

Will prob the system for the size of the Storage Devices

<Data "CiscoWLC_Temp">
 type "temperature"
 table false
 Instance "WLC_Temp"
 scale 1
 values "1.3.6.1.4.1.14179.2.3.1.13.0"
</Data>

Will probe the temperatures of a Cisco Wireless LAN Controller.

So you can see here that you create probes for the information you wish to gather.

You can either define a MIB, or a full OID for the information youy wish to gather.
Then now that you have the probes, you apply them to the hosts,

For instance,
I want to know the CPU Usage and Hard drive size of my windows host, add the probes to the host in “Quotes”, you can have as many or as few probes as you like.

<Host "HV01">
 address "192.168.0.111"
 version 1
 community "public"
 interval 30
 collect  "hrStorageSize" "CPU_Usage"
</Host>

So now for another network device, such as my WLC Controller,

<Host "WLC">
 Address "192.168.112"
 version 2
 community "public"
 interval 60
 collect "CiscoWLC_Temp"
 </Host>

These need to be put between the <Plugin snmp> </Plugin snmp> Tags in the collectd.conf file.

Its as simple as that!

 

Lets now actually do it!
We need to uncomment a line at the beginning of the collectd.conf file,

#LoadPlugin smart
 LoadPlugin snmp
#LoadPlugin statsd

 

Here is my example of what i have in the SNMP tags:

<Plugin snmp>
 <Data "CPU_Usage">

type "percent"
 table true
 instanceprefix "CPUCore"
 # Instance "HOST-RESOURCES-MIB::hrProcessorEntry"
 scale 1
 values "HOST-RESOURCES-MIB::hrProcessorLoad"
 </Data>

<Data "hrStorageSize">
 type "bytes"
 table true
 instanceprefix "Total-"
 instance "HOST-RESOURCES-MIB::hrStorageDescr"
 values "HOST-RESOURCES-MIB::hrStorageSize"
 </Data>

<Host "SERVER">
 address "192.168.0.111"
 version 1
 community "public"
 interval 30
 collect "hrStorageSize" "CPU_Usage"
 </Host>
 </Plugin snmp>

After you have finished editing, restart the service

# sudo systemctl restart collectd
# sudo systemctl status collectd

Just remember, if it doesn’t look like this with the green text saying ‘active (running)’ you need to and check that config file.

Heading back to Grafana, you can now select the SNMP data and display it any way you want!
REMEMBER! You now need to select from snmp_value not the other fields that you have in there!

 

And that’s about the gist of it!

Still more to come!

Super Simple Simon Grafana setup PART 3 – SNMP (Collectd)

One thought on “Super Simple Simon Grafana setup PART 3 – SNMP (Collectd)

  • May 23, 2017 at 4:15 am
    Permalink

    Hi, how did you setup the graph? I have collectd working and grafana receiving the data but I cannot figure out how to display this properly.

    Reply

Leave a Reply

Your email address will not be published.