From c0a6f7808a85001b0afbbca781e128d75645fd27 Mon Sep 17 00:00:00 2001 From: pandom Date: Tue, 29 Oct 2013 09:27:24 +1100 Subject: [PATCH 1/9] Update INSTALL.md Updated aptitude to apt-get install mysql-server mysql-client snmpd. Dropped sudo - assumption user is authorized. --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 10547911e..3f23c3edd 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -3,7 +3,7 @@ NOTE: These instructions assume you are using a separate server for your databas ## On the DB Server ## - aptitude install mysql-server mysql-client snmpd + apt-get install mysql-server mysql-client snmpd mysql -uroot -p enter root mysql password From 4eb90d1eb553806965702e46f4d8b3c840d5b06e Mon Sep 17 00:00:00 2001 From: Tyler Christiansen Date: Mon, 28 Oct 2013 18:20:13 -0700 Subject: [PATCH 2/9] Add root disclaimer, replace `aptitude` with `apt-get` --- INSTALL.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 3f23c3edd..c971c463a 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,6 +1,9 @@ NOTE: What follows is a very rough list of commands. This works on a fresh install of Ubuntu 12.04. + NOTE: These instructions assume you are using a separate server for your database. You will need to adjust the instructions if you are running the database on the same server. +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`. + ## On the DB Server ## apt-get install mysql-server mysql-client snmpd @@ -30,7 +33,7 @@ now restart MySQL ## On the NMS ## - aptitude 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 + 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 cd /opt git clone https://github.com/librenms/librenms.git librenms cd /opt/librenms From 481d7a3c9f9206dcd9a9a3451095287dd2b3dadc Mon Sep 17 00:00:00 2001 From: Tyler Christiansen Date: Mon, 28 Oct 2013 18:40:48 -0700 Subject: [PATCH 3/9] create new method for populating database --- build-base.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 build-base.php diff --git a/build-base.php b/build-base.php new file mode 100644 index 000000000..99f23a0f3 --- /dev/null +++ b/build-base.php @@ -0,0 +1,20 @@ + From e58575b1a1ecb40d20c44651531850cdb7e82336 Mon Sep 17 00:00:00 2001 From: Tyler Christiansen Date: Mon, 28 Oct 2013 18:51:48 -0700 Subject: [PATCH 4/9] update instructions to use new database builder. clarify instructions. --- INSTALL.md | 40 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index c971c463a..faa31a19b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,7 +1,5 @@ NOTE: What follows is a very rough list of commands. This works on a fresh install of Ubuntu 12.04. -NOTE: These instructions assume you are using a separate server for your database. You will need to adjust the instructions if you are running the database on the same server. - 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`. ## On the DB Server ## @@ -20,17 +18,18 @@ Create database FLUSH PRIVILEGES; exit -allow MySQL to listen on local LAN +Replace `` 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. vim /etc/mysql/my.cnf -edit line 47 (should be `bind-address = 127.0.0.1`) -and change it to your IP address -now restart MySQL +Find the line: `bind-address = 127.0.0.1` + +Change `127.0.0.1` to the IP address that your MySQL server should listen on. Restart MySQL: service mysql restart - ## On the NMS ## 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 @@ -40,21 +39,13 @@ now restart MySQL cp config.php.default config.php vim config.php -change lines 6-9 to match your db config -change lines 17 and 20 to 'librenms' -change line 31 to match your most common read-only SNMP community string +Change the values to the right of the equal sign for lines beginning with `$config[db_]` to match your database information as setup above. -copy sql commands to db server +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. - scp -r build.sql : +Initiate the follow database with the following command: -Subsitute your database server's IP address. If it's local host, the above step is unnecessary. - -## On DB Server ## - - mysql -ulibrenms -p < build.sql - -This assumes you used the username `librenms`. If you used something different, adjust here. + php build-base.php ## On the NMS ## @@ -88,8 +79,7 @@ Next, add the following to `/etc/apache2/available-sites/librenms.conf` -Don't forget to change 'example.com' to your domain -Enable the vhost and restart Apache +Don't forget to change 'example.com' to your domain, then enable the vhost and restart Apache: a2ensite librenms.conf a2enmod rewrite @@ -101,13 +91,9 @@ Enable the vhost and restart Apache 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). -Discover localhost +Discover localhost and poll it for the first time: - php discovery.php -h all - -First poller - - php poller.php -h all + php discovery.php -h all && php poller.php -h all Create the cronjob From 00f7b337ddaf6ccc3f137da9e0f8fce826c292d3 Mon Sep 17 00:00:00 2001 From: Tyler Christiansen Date: Mon, 28 Oct 2013 18:54:06 -0700 Subject: [PATCH 5/9] remove redundant `on the nms` line and general formatting improvements --- INSTALL.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index faa31a19b..71f5f0ede 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -7,8 +7,9 @@ NOTE: These instructions assume you are the root user. If you are not, prepend apt-get install mysql-server mysql-client snmpd mysql -uroot -p -enter root mysql password -Create database +Enter the MySQL root password to enter the MySQL command-line interface. + +Create database. CREATE DATABASE librenms; GRANT ALL PRIVILEGES ON librenms.* @@ -47,9 +48,7 @@ Initiate the follow database with the following command: php build-base.php -## On the NMS ## - -Create admin user - priv should be 10 +Create the admin user - priv should be 10 php adduser.php 10 From 0cc675089fb2f29f3c07bbbd65653dfdfd73443b Mon Sep 17 00:00:00 2001 From: Tyler Christiansen Date: Mon, 28 Oct 2013 19:17:43 -0700 Subject: [PATCH 6/9] update INSTALL.md with minor corrections and updates correct location of Apache config add SSH method of git cloning the repo add disclaimer that port needs to be open for chosen git cloning method. --- INSTALL.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 71f5f0ede..013b86939 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -33,12 +33,21 @@ Change `127.0.0.1` to the IP address that your MySQL server should listen on. R ## On the NMS ## +Install necessary software. The packages listed below are an all-inclusive list of packages that were necessary on a clean install of Ubuntu 12.04. + 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 + +### Cloning ### + +You can clone the repository via HTTPS or SSH. In either case, you need to ensure the appropriate port (443 for HTTPS, 22 for SSH) is open in the outbound direction for your server. + cd /opt git clone https://github.com/librenms/librenms.git librenms cd /opt/librenms cp config.php.default config.php vim config.php + +NOTE: The recommended method of cloning a git repository is HTTPS. If you would like to clone via SSH instead, use the command `git clone git@github.com:librenms/librenms.git librenms` instead. Change the values to the right of the equal sign for lines beginning with `$config[db_]` to match your database information as setup above. @@ -65,7 +74,7 @@ First, create and chown the `rrd` directory and create the `logs` directory 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` +Next, add the following to `/etc/apache2/sites-available/librenms.conf` DocumentRoot /opt/librenms/html/ From f4ed4eb2422dd71a5471c05d69ec59852b13241b Mon Sep 17 00:00:00 2001 From: Tyler Christiansen Date: Mon, 28 Oct 2013 20:21:22 -0700 Subject: [PATCH 7/9] add CentOS/RHEL install instructions --- INSTALL_RHEL.md | 123 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 INSTALL_RHEL.md diff --git a/INSTALL_RHEL.md b/INSTALL_RHEL.md new file mode 100644 index 000000000..635354146 --- /dev/null +++ b/INSTALL_RHEL.md @@ -0,0 +1,123 @@ +NOTE: What follows is a very rough list of commands. This works on a fresh install of CentOS 6.4. + +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`. + +## On the DB Server ## + + yum install net-snmp mysql-server + service snmpd start + service mysqld start + chkconfig --levels 235 mysqld on + chkconfig --levels 235 snmpd on + mysql_secure_installation + mysql -uroot -p + +Enter the MySQL root password to enter the MySQL command-line interface. + +Create database. + + CREATE DATABASE librenms; + GRANT ALL PRIVILEGES ON librenms.* + TO 'librenms'@'' + IDENTIFIED BY '' + ; + FLUSH PRIVILEGES; + exit + +Replace `` 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. + + vim /etc/my.cnf + +Add the following line: + + bind-address = + +Change `` to the IP address that your MySQL server should listen on. Restart MySQL: + + service mysqld restart + +## On the NMS ## + +Install necessary software. The packages listed below are an all-inclusive list of packages that were necessary on a clean install of CentOS 6.4. It also requires the EPEL repository. + + rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm + yum install php php-cli php-gd php-mysql php-snmp php-pear httpd net-snmp graphviz graphviz-php mysql ImageMagick jwhois nmap mtr rrdtool MySQL-python net-snmp-utils vixie-cron php-mcrypt fping git + pear install Net_IPv4-1.3.4 + pear install Net_IPv6-1.2.2b2 + chkconfig --levels 235 httpd on + service httpd start + +### Cloning ### + +You can clone the repository via HTTPS or SSH. In either case, you need to ensure the appropriate port (443 for HTTPS, 22 for SSH) is open in the outbound direction for your server. + + cd /opt + git clone https://github.com/librenms/librenms.git librenms + cd /opt/librenms + cp config.php.default config.php + vim config.php + +NOTE: The recommended method of cloning a git repository is HTTPS. If you would like to clone via SSH instead, use the command `git clone git@github.com:librenms/librenms.git librenms` instead. + +Change the values to the right of the equal sign for lines beginning with `$config[db_]` to match your database information as setup above. + +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. + +Add the following line to the end of `config.php`: + + $config['fping'] = "/usr/sbin/fping"; + +Initiate the follow database with the following command: + + php build-base.php + +Create the admin user - priv should be 10 + + php adduser.php 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 apache:apache 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/sites-available/librenms.conf` + + + DocumentRoot /opt/librenms/html/ + ServerName librenms.example.com + CustomLog /opt/librenms/logs/access_log combined + ErrorLog /opt/librenms/logs/error_log + + AllowOverride All + Options FollowSymLinks MultiViews + + + +Don't forget to restart Apache to make this active: + + service httpd 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). + +Discover localhost and poll it for the first time: + + php discovery.php -h all && php poller.php -h all + +Create the cronjob + + cp librenms.cron /etc/cron.d/librenms + From 4b1d536501aab352e919e03309b5818d3da667c4 Mon Sep 17 00:00:00 2001 From: Tyler Christiansen Date: Mon, 28 Oct 2013 22:01:43 -0700 Subject: [PATCH 8/9] prevent 'ET phone home' for now, simply commenting out the $dataHandle variable will prevent LibreNMS from sending stats. --- includes/versioncheck.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/versioncheck.inc.php b/includes/versioncheck.inc.php index a6583405d..a91f26413 100644 --- a/includes/versioncheck.inc.php +++ b/includes/versioncheck.inc.php @@ -17,7 +17,7 @@ foreach (dbFetch("SELECT COUNT(*) AS count,os from devices group by `os`") as $d $stat_serial = base64_encode(serialize($stats)); $url = "http://www.observium.org/latest.php?i=".$stats['ports']."&d=".$stats['devices']."&stats=".$stat_serial."&v=".$config['version']; -$dataHandle = fopen($url, r); +#$dataHandle = fopen($url, r); if ($dataHandle) { From a33db38f025f7ea5058c1a765137b4d33d86eafd Mon Sep 17 00:00:00 2001 From: Paul Gear Date: Tue, 29 Oct 2013 21:06:32 +1000 Subject: [PATCH 9/9] Remove remaining live references to observium.org --- CHANGELOG | 4 ++-- html/pages/bill/pdf_history.inc.php | 2 +- html/pdf.php | 2 +- includes/defaults.inc.php | 1 + includes/versioncheck.inc.php | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5bdf8fb18..64ade1f03 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,3 @@ -Please check http://www.observium.org/wiki/Changelog for an up to date changelog. +A summary changelog will be provided in future. -You can also browse the subversion repository commit logs for more granular updates. \ No newline at end of file +For now, please see the git commit logs at https://github.com/librenms/librenms/commits/master diff --git a/html/pages/bill/pdf_history.inc.php b/html/pages/bill/pdf_history.inc.php index b02f862ee..66c4f0b23 100644 --- a/html/pages/bill/pdf_history.inc.php +++ b/html/pages/bill/pdf_history.inc.php @@ -217,7 +217,7 @@ } // Html template - $logo = $pdf->serializeTCPDFtagParameters(array('images/observium-logo.png', 15, 18, 100, '', '', 'www.observium.org', 'T')); + $logo = $pdf->serializeTCPDFtagParameters(array('images/dummy-logo.png', 15, 18, 100, '', '', 'www.example.com', 'T')); $html .= ""; $html .= "

Billing Report

"; $html .= "

"; diff --git a/html/pdf.php b/html/pdf.php index a092f66ee..b4306a341 100644 --- a/html/pdf.php +++ b/html/pdf.php @@ -54,7 +54,7 @@ class ObsPDF extends TCPDF // Set Font $this->SetFont('helvetica', 'N', 8); // Set Footer text - $this->Cell(0, 0, 'Created by Observium (www.observium.org)', 0, false, 'L', 0, 'http://www.observium.org/', 0, false, 'M', 'M'); + $this->Cell(0, 0, 'Created by '.$config['project_name'], 0, false, 'L', 0, $config['project_url'], 0, false, 'M', 'M'); $this->Cell(10, 0, 'Page '.$this->getAliasNumPAge().' of '.$this->getAliasNbPages(), 0, false, 'R', 0, '', 0, false, 'M', 'M'); } } diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index be295f32f..6fcdc23b1 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -99,6 +99,7 @@ if (isset($_SERVER["SERVER_NAME"]) && isset($_SERVER["SERVER_PORT"])) } $config['project_name'] = "LibreNMS"; +$config['project_url'] = "https://github.com/librenms/"; $config['title_image'] = ""; $config['stylesheet'] = "css/styles.css"; $config['mono_font'] = "DejaVuSansMono"; diff --git a/includes/versioncheck.inc.php b/includes/versioncheck.inc.php index a91f26413..abf8e83db 100644 --- a/includes/versioncheck.inc.php +++ b/includes/versioncheck.inc.php @@ -16,7 +16,7 @@ foreach (dbFetch("SELECT COUNT(*) AS count,os from devices group by `os`") as $d $stat_serial = base64_encode(serialize($stats)); -$url = "http://www.observium.org/latest.php?i=".$stats['ports']."&d=".$stats['devices']."&stats=".$stat_serial."&v=".$config['version']; +#$url = "http://www.observium.org/latest.php?i=".$stats['ports']."&d=".$stats['devices']."&stats=".$stat_serial."&v=".$config['version']; #$dataHandle = fopen($url, r); if ($dataHandle)