Cacti

From OpenSimulator

Jump to: navigation, search
Cacti Tree View

Overview

In order to monitor a whole array of servers(or just your own homeserver), you can use Cacti. Cacti is an advanced rrdtool, which can be used in combination with netsnmp. This way you have a powerful monitoring tool, that can keep track of all kinds of data. The graphics can be imported into opensim, or machines can be manipulated using snmp and python scripts soon(with modrex).

Procedure

  • Install RRDTools; Probably in your distro's repo, otherwise download with:
svn co svn://svn.oetiker.ch/rrdtool/branches/1.2/program

Check the instuctions how to build rrdtools

  • Install net-snmp; Probably in your distro's repo, otherwise download with:
svn co https://net-snmp.svn.sourceforge.net/svnroot/net-snmp net-snmp 

Check the instuctions how to build net-snmp

  • Download cacti
  • Copy cacti into your Apache's www directory (/srv/http in this tutorial)
  • Add a cacti database into mysql, and add give a cacti-user all privileges for that database
  • Edit /srv/http/cacti/include/config.php, and fill in the mysql info
  • Create a crontab
crontab -e
# paste this line in, and save
* * * * * php /srv/http/serverstats/poller.php > /dev/null 2>&1
  • Login to cacti from the browser with admin,admin and change the password

Ok, this was the first part. Cacti is running, and you've installed all necessary software. Get yourself a nice cup of coffee if you wish, so we can proceed to the next level: Setting up snmp to return the stats that we so desperatly want...

Snmp comes in three flavors: version 1,2 and ...3 . Suppose you want to manage machines across the internet, you should check out version 3; which has user authentication and protection. For now, we'll use version 2.

Cacti Detailed View
  • Add this envpath to '/etc/profile'. Net-SNMP uses this to determin where the config file is
SNMPCONFPATH=/etc/snmp:/usr/local/etc/snmp
  • Create the file '/etc/snmp/snmpd.conf' and fill with this:
# rwuser: a SNMPv3 read-write user
# arguments: user [noauth|auth|priv] [restriction_oid]
rwuser rwos auth
# rouser: a SNMPv3 read-only user
# arguments: user [noauth|auth|priv] [restriction_oid]
rouser roos noauth .1.3.6.1.4.1.8072
# rocommunity: a SNMPv1/SNMPv2c read-only access community name
# arguments: community [default|hostname|network/bits] [oid]
rocommunity public .1.3.6.1.2.1.1
# rwcommunity: a SNMPv1/SNMPv2c read-write access community name
# arguments: community [default|hostname|network/bits] [oid]
rwcommunity private 127.0.0.1
 
syslocation "My Wicked OpenSimulator Datacenter"
syscontact "Your evil admin - evil@hell.org"
agentaddress tcp:161,udp:161
  • Restart the SNMP-Daemon, and test whether you can receive data(You should get a list of data here):
snmpwalk -v 2c -c private localhost
  • Go to Cacti, and modify the host called localhost(or add a new one, if none is there)

Some important settings: hostname tcp: 127.0.0.1 host template: Generic SNMP-enabled host SNMP version: 2 SNMP community: private

  • On top of the host, you should see some SNMP-information.
  • From here you need to add some graphing options. This can be done by adding things to Associated Data Queries(in the hostconfig), and then go to 'Create graphs for this host' (at the top). You will see some additional options here, that are linked to the data queries. Add graphing options here...
  • From now on, I suggest you get used to the cacti-interface by exploring all of it's settings

Next is the customizing of stats to reflect opensim specific information

Informational Links

NET-SNMP Wiki

Create and Use Templates in Cacti

OpenSimulator Specific Stats

Other stats facilities

OsGetRegionStats

ServerStats

Cacti

Collectd

Personal tools
General
About This Wiki