Installing snmpd to an embedded system and then installing cacti to a client to monitor the device. Additionally, this tutorial covers one way to monitor a client without an snmpd server running on the client machine (ping only). The embedded OS is openWRT on a Netgear WNDR.

ssh -p ###### root@nameofembeddedhost 
opkg update
opkg install snmpd
cd /etc/config
nano snmpd
/etc/init.d/snmpd enable
/etc/init.d/snmpd restart

There are many customizations possible, but my colleagues recommend the minimum of changing the name of the public community to something indicative of the network purpose. Additionally, it is also adviseable to change three fields below that refer to the physical location, ip address, and the contact email for the system administrator in charge of managing the snmp server. Once you are done, continue to installing cacti on a network machine that will field the incoming snmp request

sudo apt install cacti

I used the default recommendations, however, when cacti failed repeatedly I was forced to use the reconfiguration command below. The OS I used in this case was Debian 9.2.1 Stretch.

sudo dpkg-reconfigure cacti
<Yes, rebuild database, default to other options>
<I chose matching MySQL pass because it failed with blank>

At this point, cacti should work so to speak, but it will need to be configured and have its license terms accepted. Since cacti utilizes a web server with which users may access its data, users must configure cacti within that interface. FYI - I chose defaults, and used apache2, as follows from within the Firefox web-browser:

localhost/cacti
<say yes to EULA, etc.>
<user: admin>
<pass: admin>

Since cacti's web server is running, its web server page can highlight information from the snmp server that it queries information from as a client (& many other queries too!). I would error on the side of portraying more information, not less, so consider the following configurations from within the web interface.

Create Devices
Add (upper right corner)
Host Template - ucd/net SNMP Host
Ping or SNMP
ICMP Ping 
Version 2
<name of public community chosen must match /etc/config/snmpd>
<fully qualified hostname must be the external domain name or local ip>
<for linux devices or the cacti server itself, use local ip or 127.0.0.1, snmpd version 1>

After it successfully creates the device, then scroll down to graphs and add them all unless you have a reason not to. Once you do that, click return, and then select to “Place Device on a Tree” using the defaults provided. Once that is done, go to Console, Create Graphs, select the router or host you just configured this for, and then select the box for all graphs, scroll down, select create. Once they are created, click Console, view graphs, hit the arrow on the Tree, and select the router or host you just created these graphs for.

During this install I had a conflict with a previously installed web server nginx, so I had to find its process and then kill it:

netstat -enpl
sudo kill -XXX PID

After that, I restarted the web-server apache2 as follows:

sudo /etc/init.d/apache2 restart

This tutorial is a designated “Invariant Section” of the “Technotronic” section of Haack's Wiki as described on the Start Page.

oemb1905 2019/01/13 12:24