SNMPD
Installing The SNMP Server
The only package which is required on the server site is snmpd, the SNMP daemon.
To install it type:
$ sudo apt-get install snmpd
snmpd is now installed but we still have to tweak it a little bit to make it work as we want.
Configuring SNMPD
The first thing we want to make sure is that snmpd is only going to wait for connections on localhost. To do this, edit file /etc/default/snmpd and make sure those values are set:
If you want your server to listen on all interfaces, remove the 127.0.0.1 bit.
This setting will make sure that the service will be started and that the service is going to bind to localhost.
Finally, we are going to configure snmpd in such a way that it will only return datas to trusted host for a specific community.
Edit /etc/snmp/snmpd.conf and make sure that com2sec it only set to:
com2sec readonly localhost mycommunity
If you want a remote machine to be able to gather information for the community mycommunity, make sure you replace localhost by mynetwork, where mynetwork can be of the form: 1.1.1.1 or 1.1.0.0/16.
Checking SNMP Configuration:
We are going to use the snmpwalk utility to verify that the server is working as wanted.
Here we want snmp to reply only to localhost for the community mycommunity.
From localhost
# Restart snmpd to load de new config #####
$ sudo /etc/init.d/snmpd restart
# Test the SNMP Server #####
$ sudo apt-get install snmp
$ snmpwalk -Os -c mycommunity -v 1 localhost system
Should return a lot of output and:
If the second command returns result, it might be because you did not comment the line starting with com2sec.
Installing Cacti
Cacti displays system statistics through a PHP/MySQL web interface.
To gather informations, it runs a script which is going to poll the servers you registered in cacti: /usr/share/cacti/site/poller.php.
So, let's get started an install cacti.
Installing Cacti Packages And Dependencies
# apt-get install mysql-server apache2 libapache2-mod-php5 php5-mysql php5-cli php5-snmp
# apt-get install cacti
Note: because I am using php5, I had to install all the required php5-xx packages before I installed cacti. If you don't install those first, cacti will fall back to apache2 with php4.
While installing cacti, you are going to be asked a few question, answer as follow:
configuring libphp-adodb
-> press ok
configuring cacti
configure database for cacti with dbconfig-common
-> press yes
password of your database's administrative user
-> mysql root password (empty by default, fill accordingly)
mysql application password for cacti
-> give the password you would like cacti to connect to mysql with
webserver type
-> Apache2
Now, cacti is installed, let's configure it:
Configuring Cacti
Now, cacti is installed as well as its database. We still need through a few configuration screens before we can start adding servers to monitor.
Let's go to http://your-manager-server.ip/cacti/
- Click next to the first screen
- Select new install and check that the found informations are correct
- Check that everything is [FOUND]
- Click Finish
Finally, you should be landing on the login page. Log in with username: admin and password: admin. The next screen will force you to change your password.
On the first login, the default account is admin with password admin
Voila, our manager is up and running, the last step is to create new Devices (adding new hosts to our manager).
Enjoy ubuntu.... ;)
No comments:
Post a Comment