2013-10-27 23:44:26 -07:00
NOTE: What follows is a very rough list of commands. This works on a fresh install of Ubuntu 12.04.
2013-10-28 18:20:13 -07:00
NOTE: These instructions assume you are the root user. If you are not, prepend `sudo` to all shell commands (the ones that aren't at `mysql>` prompts) or temporarily become a user with root privileges with `sudo -s` .
2013-10-27 23:44:26 -07:00
## On the DB Server ##
2013-10-29 09:27:24 +11:00
apt-get install mysql-server mysql-client snmpd
2013-10-27 23:44:26 -07:00
mysql -uroot -p
enter root mysql password
Create database
CREATE DATABASE librenms;
GRANT ALL PRIVILEGES ON librenms.*
TO 'librenms'@'< ip > '
IDENTIFIED BY '< password > '
;
FLUSH PRIVILEGES;
exit
2013-10-28 18:51:48 -07:00
Replace `<ip>` above with the IP of the server running LibreNMS. If your database is on the same server as LibreNMS, you can just use `localhost` as the IP address.
If you are deploying a separate database server, you need to change the `bind-address` . If your MySQL database resides on the same server as LibreNMS, you should skip this step.
2013-10-27 23:44:26 -07:00
vim /etc/mysql/my.cnf
2013-10-28 18:51:48 -07:00
Find the line: `bind-address = 127.0.0.1`
2013-10-27 23:44:26 -07:00
2013-10-28 18:51:48 -07:00
Change `127.0.0.1` to the IP address that your MySQL server should listen on. Restart MySQL:
2013-10-27 23:44:26 -07:00
2013-10-28 18:51:48 -07:00
service mysql restart
2013-10-27 23:44:26 -07:00
## On the NMS ##
2013-10-28 18:20:13 -07:00
apt-get install libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-snmp php-pear snmp graphviz php5-mcrypt apache2 fping imagemagick whois mtr-tiny nmap python-mysqldb snmpd mysql-client php-net-ipv4 php-net-ipv6 rrdtool
2013-10-28 00:58:00 -07:00
cd /opt
2013-10-28 01:08:01 -07:00
git clone https://github.com/librenms/librenms.git librenms
2013-10-27 23:44:26 -07:00
cd /opt/librenms
cp config.php.default config.php
vim config.php
2013-10-28 18:51:48 -07:00
Change the values to the right of the equal sign for lines beginning with `$config[db_]` to match your database information as setup above.
2013-10-27 23:44:26 -07:00
2013-10-28 18:51:48 -07:00
Change the value of `$config['snmp']['community']` from `public` to whatever your read-only SNMP community is. If you have multiple communities, set it to the most common.
2013-10-27 23:44:26 -07:00
2013-10-28 18:51:48 -07:00
Initiate the follow database with the following command:
2013-10-27 23:44:26 -07:00
2013-10-28 18:51:48 -07:00
php build-base.php
2013-10-27 23:44:26 -07:00
## On the NMS ##
Create admin user - priv should be 10
php adduser.php < name > < pass > 10
Substitute your desired username and password--and leave the angled brackets off.
### Web Interface ###
To prepare the web interface (and adding devices shortly), you'll need to create and chown a directory as well as create an Apache vhost.
First, create and chown the `rrd` directory and create the `logs` directory
mkdir rrd logs
chown www-data:www-data rrd/
Note that if you're not running Ubuntu, you may need to change the owner to whomever the webserver runs as.
Next, add the following to `/etc/apache2/available-sites/librenms.conf`
< VirtualHost * :80 >
DocumentRoot /opt/librenms/html/
2013-10-28 01:04:00 -07:00
ServerName librenms.example.com
2013-10-27 23:44:26 -07:00
CustomLog /opt/librenms/logs/access_log combined
ErrorLog /opt/librenms/logs/error_log
< Directory " / opt / librenms / html / " >
AllowOverride All
Options FollowSymLinks MultiViews
< / Directory >
< / VirtualHost >
2013-10-28 18:51:48 -07:00
Don't forget to change 'example.com' to your domain, then enable the vhost and restart Apache:
2013-10-27 23:44:26 -07:00
a2ensite librenms.conf
2013-10-28 00:58:00 -07:00
a2enmod rewrite
2013-10-27 23:44:26 -07:00
service apache2 restart
### Add localhost ###
php addhost.php localhost public v2c
This assumes you haven't made community changes--if you have, replace `public` with your community. It also assumes SNMP v2c. If you're using v3, there are additional steps (NOTE: instructions for SNMPv3 to come).
2013-10-28 18:51:48 -07:00
Discover localhost and poll it for the first time:
2013-10-27 23:44:26 -07:00
2013-10-28 18:51:48 -07:00
php discovery.php -h all & & php poller.php -h all
2013-10-27 23:44:26 -07:00
Create the cronjob
cp librenms.cron /etc/cron.d/librenms