Ubuntu installing Cacti

Installing Cacti

To install the Cacti package from the distribution software repositories, issue the following command:

apt-get install cacti

You will be presented with several prompts during this installation. On the "libphp-adodb" prompt you can safely select "Ok". During the "Configuring Cacti" prompt, make sure to select "Apache2". You will be presented with an additional "Configuring cacti" prompt that will ask if you'd like to configure your database with dbconfig-common. Select "Yes" and continue. On the MySQL prompt, enter the root password you created earlier. On the next screen, either create your own password for cacti's database access, or leave it blank for it to automatically generate one for you.

From here we'll continue configuring Cacti through the browser. Visit the domain you have pointed at your Linode or your Linode's IP address, and add /cacti. Follow the instructions shown on each page. Make sure to select RRDTool 1.2.x in the "RRDTool Utility Version" drop down. You should be able to continue through these pages into the login page without alteration.

At the login screen, enter admin/admin for the username/password combination. You'll be prompted to change your password on the next screen. At this point, Cacti is installed and ready to be configured.

Configuring Cacti

At this point Cacti will contain an entry for localhost, which we'll need to modify. Click the "Console" tab in the top left corner, and select "Create Devices for network". Click the "Localhost" entry to begin making the needed changes. Select the Host Template drop down and pick the "ucd/net SNMP Host". Scroll down to SNMP Options and click the drop down box for SNMP Version, picking "Version 1". Enter "Bucknell" (or the community name you created above) in the box for the "SNMP Community" field. The "Associated Graph Templates" section allows you to add additional graphs. Hit "Save" to keep the changes.

Click "Settings" under "Configuration" and set your "SNMP Version" to "Version 1" in the drop down box. Type the name of your community for the "SNMP Community" (in this example, "Bucknell") and save.

Configuring Client Machines

This section is optional and for those looking to use Cacti to monitor additional devices. These steps are written for Debian-based distributions, but with modification, they will work on any flavor of Linux. You will need to follow these instructions for each client machine you'd like to monitor with Cacti. Client machines need an SNMP daemon in order to serve Cacti information. First, install snmp and snmpd on the client:

apt-get install snmp snmpd

Next we'll need to modify the /etc/snmp/snmpd.conf file with the name of our community. Run the following commands to backup your existing snmpd.conf file and replace the contents with the name of your community:

mv /etc/snmp/snmpd.conf /etc/snmp/old.snmpd.conf
echo "rocommunity mycommunity" > /etc/snmp/snmpd.conf

Note that the format is "rocommunity community_name", where community_name is the name of the community you originally used with Cacti. Next, we'll open the /etc/default/snmpd file and remove the binding on localhost. Like the "Configuring SNMP" section above, you'll want to find the line that begins with SNMPDOPTS and remove the reference to 127.0.0.1 at the end. This line should now resemble the one below:

File:/etc/default/snmpd

SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid'

Finally, restart the SNMP daemon to push the changes you've made to these files:

/etc/init.d/snmpd restart

At this point your machine is ready for polling. Go into the Cacti interface to add the new "Device". Under the "Console" tab, select "New Graphs" and then "Create New Host". Enter the pertinent information in the fields required. Make sure to select "Ping" for "Downed Device Detection". Additionally, ensure that you've typed the right community name in the "SNMP Community" field. Click the "create" button to save your configuration. On the "save successful" screen, select your newly created device and from the drop down next to "Choose an Action" select "Place on a Tree" and then click "go". Hit "yes" on the next screen. On the "New Graphs" screen, you'll be able to create several different types of graphs of your choice. Follow the on-screen instructions to add these graphs to your tree.

Using the Spine Polling Daemon

By default, Cacti uses a PHP script to poll the devices it tracks. "Spine" is a faster replacement for the default polling script written in C++. Installing Spine is relatively easy and a good idea if you plan on keeping track of many hosts. Begin the Spine installation by running the following command

apt-get install cacti-spine

After the installation completes, go back to the Cacti administrative panel and click "Settings" under "Configuration". Click the "Paths" tab and check to see that Cacti found your spine binary correctly. Click the "Poller" tab and choose "Spine" from the drop-down for "Poller Type". Click "Save" to keep these changes. You are now successfully using Spine.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章