In this little HowTo series “Monitor Linux Server with Cacti” we are going to look into configuring a Linux server to be monitored by Cacti and how to create the graphs within Cacti itself.
This first part is going to look into setting up the SNMP configuration in order to monitor some basic performance data like CPU, memory, storage and interface traffic.
HowTo – Monitor Linux Server with Cacti – Part 1 – Setting up SNMP
The default snmp settings only provide a very limited view on the SNMP OIDs.
Default SNMP Settings
Let’s look at this default setting of a CentOS 5 system( comments have been removed ):
com2sec notConfigUser default public group notConfigGroup v1 notConfigUser group notConfigGroup v2c notConfigUser view systemview included .184.108.40.206.2.1.1 view systemview included .220.127.116.11.18.104.22.168.1 access notConfigGroup "" any noauth exact systemview none none
Based on this, we can see that there’s a “user” called “notConfigUser” with the community string named “public”, a group called “notConfigGroup” and a view called “systemview”.
The “notConfigUser” belongs to the “notConfigGroup” and is able to connect to the system using SNMP version 1 and 2c.
The systemview is limited to view only OIDs at or below .22.214.171.124.2.1.1 (System MIB) and .126.96.36.199.188.8.131.52.1 (hostResources MIB)
The notConfigGroup itself ca access this systemview.
So based on this, the SNMP community “public” will give you a very limited view on the system.
SNMP Settings required for Cacti monitoring
Now that we have seen the default settings, let’s change them so Cacti is able to read some additional data from this Linux system.
First, we are going to change the SNMP community from it’s default of “public” to something more secret:
com2sec notConfigUser default ef2b068ad9ad0cbc63ca3d2c4a6fb669
We can leave the group settings as is and change the systemview part to be more open. Therefore we are going to delete all the systemview lines and add the other the following:
view allview included .1
We will also have to change the access line accordingly:
access notConfigGroup "" any noauth exact allview none none
Now your complete SNMP config should look like this:
com2sec notConfigUser default ef2b068ad9ad0cbc63ca3d2c4a6fb669 group notConfigGroup v1 notConfigUser group notConfigGroup v2c notConfigUser view allview included .1 access notConfigGroup "" any noauth exact allview none none
All you now have to do is to restart the SNMP daemon:
service snmpd restart
The next part in this “Monitor Linux Server with Cacti” series will show you how to add some Graphs to Cacti for monitoring this Linux system.