Track5Wireless: librenms-install.htm

File librenms-install.htm, 25.4 KB (added by jon, 6 years ago)
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5  <meta http-equiv="Content-Style-Type" content="text/css" />
6  <meta name="generator" content="pandoc" />
7  <title></title>
8  <style type="text/css">code{white-space: pre;}</style>
9  <style type="text/css">
10div.sourceCode { overflow-x: auto; }
11table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
12  margin: 0; padding: 0; vertical-align: baseline; border: none; }
13table.sourceCode { width: 100%; line-height: 100%; }
14td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
15td.sourceCode { padding-left: 5px; }
16code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
17code > span.dt { color: #902000; } /* DataType */
18code > span.dv { color: #40a070; } /* DecVal */
19code > span.bn { color: #40a070; } /* BaseN */
20code > span.fl { color: #40a070; } /* Float */
21code > span.ch { color: #4070a0; } /* Char */
22code > span.st { color: #4070a0; } /* String */
23code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
24code > span.ot { color: #007020; } /* Other */
25code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
26code > span.fu { color: #06287e; } /* Function */
27code > span.er { color: #ff0000; font-weight: bold; } /* Error */
28code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
29code > span.cn { color: #880000; } /* Constant */
30code > span.sc { color: #4070a0; } /* SpecialChar */
31code > span.vs { color: #4070a0; } /* VerbatimString */
32code > span.ss { color: #bb6688; } /* SpecialString */
33code > span.im { } /* Import */
34code > span.va { color: #19177c; } /* Variable */
35code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
36code > span.op { color: #666666; } /* Operator */
37code > span.bu { } /* BuiltIn */
38code > span.ex { } /* Extension */
39code > span.pp { color: #bc7a00; } /* Preprocessor */
40code > span.at { color: #7d9029; } /* Attribute */
41code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
42code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
43code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
44code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
45  </style>
46  <link href="data:text/css;charset=utf-8,%0A%0A%0A%0Adiv%23header%2C%20header%0A%7B%0A%0Aborder%2Dbottom%3A%201px%20solid%20%23aaa%3B%0Amargin%2Dbottom%3A%200%2E5em%3B%0A%7D%0A%2Etitle%20%0A%7B%0Atext%2Dalign%3A%20center%3B%0A%7D%0A%2Eauthor%2C%20%2Edate%20%0A%7B%0Atext%2Dalign%3A%20center%3B%0A%7D%0A%0Adiv%23TOC%2C%20nav%23TOC%0A%7B%0A%0Aborder%2Dbottom%3A%201px%20solid%20%23aaa%3B%0Amargin%2Dbottom%3A%200%2E5em%3B%0A%7D%0A%40media%20print%0A%7B%0Adiv%23TOC%2C%20nav%23TOC%0A%7B%0A%0Adisplay%3A%20none%3B%0A%7D%0A%7D%0A%0Ah1%2C%20h2%2C%20h3%2C%20h4%2C%20h5%2C%20h6%0A%7B%0Afont%2Dfamily%3A%20%22Helvetica%20Neue%22%2C%20Helvetica%2C%20%22Liberation%20Sans%22%2C%20Calibri%2C%20Arial%2C%20sans%2Dserif%3B%20%0A%0Apage%2Dbreak%2Dafter%3A%20avoid%3B%20%0A%7D%0A%0Adiv%20div%2C%20section%20section%20%0A%7B%0Amargin%2Dleft%3A%202em%3B%20%0A%7D%0Ap%20%7B%7D%0Ablockquote%0A%7B%20font%2Dstyle%3A%20italic%3B%0A%7D%0Ali%20%0A%7B%0A%7D%0Ali%20%3E%20p%20%0A%7B%0Amargin%2Dtop%3A%201em%3B%20%0A%7D%0Aul%20%0A%7B%0A%7D%0Aul%20li%20%0A%7B%0A%7D%0Aol%20%0A%7B%0A%7D%0Aol%20li%20%0A%7B%0A%7D%0Ahr%20%7B%7D%0A%0Asub%20%0A%7B%0A%7D%0Asup%20%0A%7B%0A%7D%0Aem%20%0A%7B%0A%7D%0Aem%20%3E%20em%20%0A%7B%0Afont%2Dstyle%3A%20normal%3B%0A%7D%0Astrong%20%0A%7B%0A%7D%0A%0Aa%20%0A%7B%0A%0Atext%2Ddecoration%3A%20none%3B%0A%7D%0A%40media%20screen%0A%7B%0Aa%3Ahover%0A%7B%0A%0Atext%2Ddecoration%3A%20underline%3B%0A%7D%0A%7D%0A%40media%20print%0A%7B%0Aa%20%7B%0A%0Acolor%3A%20black%3B%0Abackground%3A%20transparent%3B%0A%7D%0Aa%5Bhref%5E%3D%22http%3A%2F%2F%22%5D%3Aafter%2C%20a%5Bhref%5E%3D%22https%3A%2F%2F%22%5D%3Aafter%0A%7B%0A%0Acontent%3A%20%22%20%28%22%20attr%28href%29%20%22%29%20%22%3B%0Afont%2Dsize%3A%2090%25%3B%0A%7D%0A%7D%0A%0Aimg%0A%7B%0A%0Avertical%2Dalign%3A%20middle%3B%0A%7D%0Adiv%2Efigure%20%0A%7B%0A%0Amargin%2Dleft%3A%20auto%3B%0Amargin%2Dright%3A%20auto%3B%0Atext%2Dalign%3A%20center%3B%0Afont%2Dstyle%3A%20italic%3B%0A%7D%0Ap%2Ecaption%20%0A%7B%0A%0A%7D%0A%0Apre%2C%20code%20%7B%0Abackground%2Dcolor%3A%20%23fdf7ee%3B%0A%0A%0A%0Awhite%2Dspace%3A%20pre%2Dwrap%3B%20%0Awhite%2Dspace%3A%20%2Dmoz%2Dpre%2Dwrap%20%21important%3B%20%0Awhite%2Dspace%3A%20%2Dpre%2Dwrap%3B%20%0Awhite%2Dspace%3A%20%2Do%2Dpre%2Dwrap%3B%20%0Aword%2Dwrap%3A%20break%2Dword%3B%20%0A%0A%7D%0Apre%20%0A%7B%0A%0Apadding%3A%200%2E5em%3B%20%0Aborder%2Dradius%3A%205px%3B%20%0A%0Aborder%3A%201px%20solid%20%23aaa%3B%0A%0Amargin%2Dleft%3A%200%2E5em%3B%0Amargin%2Dright%3A%200%2E5em%3B%0A%7D%0A%40media%20screen%0A%7B%0Apre%0A%7B%0A%0Awhite%2Dspace%3A%20pre%3B%0Aoverflow%3A%20auto%3B%0A%0Aborder%3A%201px%20dotted%20%23777%3B%0A%7D%0A%7D%0Acode%20%0A%7B%0A%7D%0Ap%20%3E%20code%2C%20li%20%3E%20code%20%0A%7B%0A%0Apadding%2Dleft%3A%202px%3B%0Apadding%2Dright%3A%202px%3B%0A%7D%0Ali%20%3E%20p%20code%20%0A%7B%0A%0Apadding%3A%202px%3B%0A%7D%0A%0Aspan%2Emath%20%0A%7B%0A%0A%7D%0Adiv%2Emath%20%0A%7B%0A%7D%0Aspan%2ELaTeX%20%0A%7B%0A%7D%20eq%20%0A%7B%0A%7D%20%0A%0Atable%0A%7B%0Aborder%2Dcollapse%3A%20collapse%3B%0Aborder%2Dspacing%3A%200%3B%20%0Aborder%2Dbottom%3A%202pt%20solid%20%23000%3B%0Aborder%2Dtop%3A%202pt%20solid%20%23000%3B%20%0A%0Amargin%2Dleft%3A%20auto%3B%0Amargin%2Dright%3A%20auto%3B%0A%7D%0Athead%20%0A%7B%0Aborder%2Dbottom%3A%201pt%20solid%20%23000%3B%0Abackground%2Dcolor%3A%20%23eee%3B%20%0A%7D%0Atr%2Eheader%20%0A%7B%0A%7D%20tbody%20%0A%7B%0A%7D%0A%0Atr%20%7B%0A%7D%0Atr%2Eodd%3Ahover%2C%20tr%2Eeven%3Ahover%20%0A%7B%0Abackground%2Dcolor%3A%20%23eee%3B%0A%7D%0A%0Atr%2Eodd%20%7B%7D%0Atr%2Eeven%20%7B%7D%0Atd%2C%20th%20%0A%7B%20vertical%2Dalign%3A%20top%3B%20%0Avertical%2Dalign%3A%20baseline%3B%20%0Apadding%2Dleft%3A%200%2E5em%3B%0Apadding%2Dright%3A%200%2E5em%3B%0Apadding%2Dtop%3A%200%2E2em%3B%0Apadding%2Dbottom%3A%200%2E2em%3B%0A%7D%0A%0A%0Ath%20%0A%7B%0Afont%2Dweight%3A%20bold%3B%20%7D%0Atfoot%20%0A%7B%0A%7D%0Acaption%20%0A%7B%0Acaption%2Dside%3A%20top%3B%0Aborder%3A%20none%3B%0Afont%2Dsize%3A%200%2E9em%3B%0Afont%2Dstyle%3A%20italic%3B%0Atext%2Dalign%3A%20center%3B%0Amargin%2Dbottom%3A%200%2E3em%3B%20%0Apadding%2Dbottom%3A%200%2E2em%3B%0A%7D%0A%0Adl%20%0A%7B%0Aborder%2Dtop%3A%202pt%20solid%20black%3B%0Apadding%2Dtop%3A%200%2E5em%3B%0Aborder%2Dbottom%3A%202pt%20solid%20black%3B%0A%7D%0Adt%20%0A%7B%0Afont%2Dweight%3A%20bold%3B%0A%7D%0Add%2Bdt%20%0A%7B%0Aborder%2Dtop%3A%201pt%20solid%20black%3B%0Apadding%2Dtop%3A%200%2E5em%3B%0A%7D%0Add%20%0A%7B%0Amargin%2Dbottom%3A%200%2E5em%3B%0A%7D%0Add%2Bdd%20%0A%7B%0Aborder%2Dtop%3A%201px%20solid%20black%3B%20%0A%7D%0A%0Aa%2Efootnote%2C%20a%2EfootnoteRef%20%7B%20%0Afont%2Dsize%3A%20small%3B%20vertical%2Dalign%3A%20text%2Dtop%3B%0A%7D%0Aa%5Bhref%5E%3D%22%23fnref%22%5D%2C%20a%2Ereversefootnote%20%0A%7B%0A%7D%0A%40media%20print%0A%7B%0Aa%5Bhref%5E%3D%22%23fnref%22%5D%2C%20a%2Ereversefootnote%20%0A%7B%0A%0Adisplay%3A%20none%3B%0A%7D%0A%7D%0Adiv%2Efootnotes%20%0A%7B%0A%7D%0Adiv%2Efootnotes%20li%5Bid%5E%3D%22fn%22%5D%20%0A%7B%0A%7D%0A%0A%40media%20print%0A%7B%0A%2Enoprint%0A%7B%0Adisplay%3Anone%3B%0A%7D%0A%7D%0A" rel="stylesheet" type="text/css" />
47</head>
48<body>
49<div id="TOC">
50<ul>
51<li><a href="#librenms"><span class="toc-section-number">1</span> LibreNMS</a></li>
52<li><a href="#installing-and-configure-librenms"><span class="toc-section-number">2</span> Installing and configure LibreNMS</a><ul>
53<li><a href="#goals"><span class="toc-section-number">2.1</span> Goals</a></li>
54<li><a href="#notes"><span class="toc-section-number">2.2</span> Notes</a></li>
55</ul></li>
56<li><a href="#create-database"><span class="toc-section-number">3</span> Create database</a></li>
57<li><a href="#install-librenms"><span class="toc-section-number">4</span> Install LibreNMS</a><ul>
58<li><a href="#cloning-the-librenms-source-code-with-git"><span class="toc-section-number">4.1</span> Cloning the LibreNMS source code with git</a></li>
59<li><a href="#web-interface"><span class="toc-section-number">4.2</span> Web Interface</a></li>
60<li><a href="#web-installer"><span class="toc-section-number">4.3</span> Web installer</a></li>
61<li><a href="#basic-configuration"><span class="toc-section-number">4.4</span> Basic configuration</a><ul>
62<li><a href="#setting-the-snmp-community"><span class="toc-section-number">4.4.1</span> Setting the SNMP community</a></li>
63<li><a href="#enabling-xdp-auto-discovery"><span class="toc-section-number">4.4.2</span> Enabling xDP auto-discovery</a></li>
64<li><a href="#tell-librenms-which-subnets-its-allowed-to-scan-automatically"><span class="toc-section-number">4.4.3</span> Tell LibreNMS which subnets it's allowed to scan automatically</a></li>
65<li><a href="#add-a-host."><span class="toc-section-number">4.4.4</span> Add a host.</a></li>
66</ul></li>
67<li><a href="#final-configuration"><span class="toc-section-number">4.5</span> Final configuration</a><ul>
68<li><a href="#test-poller"><span class="toc-section-number">4.5.1</span> Test poller</a></li>
69<li><a href="#create-cronjob"><span class="toc-section-number">4.5.2</span> Create cronjob</a></li>
70</ul></li>
71<li><a href="#install-complete"><span class="toc-section-number">4.6</span> Install complete</a></li>
72<li><a href="#for-reference-only-manual-installation"><span class="toc-section-number">4.7</span> For reference only: manual installation</a><ul>
73<li><a href="#configure"><span class="toc-section-number">4.7.1</span> Configure</a></li>
74<li><a href="#initialise-the-database"><span class="toc-section-number">4.7.2</span> Initialise the database</a></li>
75<li><a href="#create-admin-user"><span class="toc-section-number">4.7.3</span> Create admin user</a></li>
76</ul></li>
77<li><a href="#about-daily-updates"><span class="toc-section-number">4.8</span> About Daily Updates</a></li>
78</ul></li>
79</ul>
80</div>
81<h1 id="librenms"><span class="header-section-number">1</span> LibreNMS</h1>
82<h1 id="installing-and-configure-librenms"><span class="header-section-number">2</span> Installing and configure LibreNMS</h1>
83<h2 id="goals"><span class="header-section-number">2.1</span> Goals</h2>
84<ul>
85<li>Learn how to configure LibreNMS Network Management System</li>
86</ul>
87<h2 id="notes"><span class="header-section-number">2.2</span> Notes</h2>
88<ul>
89<li>Commands preceded with &quot;$&quot; imply that you should execute the command as a general user - not as root.</li>
90<li>Commands preceded with &quot;#&quot; imply that you should be working as root.</li>
91<li>Commands with more specific command lines (e.g. &quot;rtrX&gt;&quot; or &quot;mysql&gt;&quot;) imply that you are executing commands on remote equipment, or within another program.</li>
92<li>These instructions assume you are the root user. If you are not, prepend <code>sudo</code> to the shell commands (the ones that aren't at <code>mysql&gt;</code> prompts) or temporarily invoke root privileges with <code>sudo -s</code>.</li>
93</ul>
94<h1 id="create-database"><span class="header-section-number">3</span> Create database</h1>
95<p>NOTE: These instructions are based on the <a href="http://docs.librenms.org/Installation/Installation-(Debian-Ubuntu)/">official LibreNMS installation notes</a> and have been tested on a fresh install of Ubuntu 14.04.</p>
96<p>We will assume that the database is running on the same machine as your network management server (this is the most common initial deployment scenario).</p>
97<p>First become root:</p>
98<pre><code>    $ sudo bash</code></pre>
99<p>Then install mysql and configure:</p>
100<pre><code>    # apt-get install mysql-server mysql-client
101    # mysql -uroot -p</code></pre>
102<p>You can select any password for the mysql root user. But <em>be absolutely sure</em> that you remember what you choose here. You will use this later.</p>
103<p>Input the MySQL root password to enter the MySQL command-line interface where you will get a <code>mysql&gt;</code> prompt.</p>
104<p>Create the database:</p>
105<div class="sourceCode"><pre class="sourceCode sql"><code class="sourceCode sql"><span class="kw">CREATE</span> <span class="kw">DATABASE</span> librenms;
106<span class="kw">GRANT</span> <span class="kw">ALL</span> <span class="kw">PRIVILEGES</span> <span class="kw">ON</span> librenms.*
107  <span class="kw">TO</span> <span class="st">'librenms'</span>@<span class="st">'localhost'</span>
108  <span class="kw">IDENTIFIED</span> <span class="kw">BY</span> <span class="st">'&lt;CLASS_PASSWORD&gt;'</span>
109;
110<span class="kw">FLUSH</span> <span class="kw">PRIVILEGES</span>;
111exit</code></pre></div>
112<p><strong>PLEASE NOTE</strong></p>
113<p>Here we are using <code>&lt;CLASS_PASSWORD&gt;</code> as the password for librenms to access MySQL. Please replace <code>&lt;CLASS_PASSWORD&gt;</code> with, you guessed it, the class password :)</p>
114<h1 id="install-librenms"><span class="header-section-number">4</span> Install LibreNMS</h1>
115<p>The NMS is the host is where the web server and SNMP poller run.</p>
116<p>Install the required software:</p>
117<pre><code>    apt-get install libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-snmp \
118        php-pear php5-curl snmp graphviz php5-mcrypt php5-json apache2 fping \
119        imagemagick whois mtr-tiny nmap python-mysqldb snmpd mysql-client \
120        php-net-ipv4 php-net-ipv6 rrdtool git</code></pre>
121<p><strong>Here is the command above on a single line that may be easier to copy and paste in to your terminal:</strong></p>
122<hr />
123<p>apt-get install libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-snmp php-pear php5-curl snmp graphviz php5-mcrypt php5-json apache2 fping imagemagick whois mtr-tiny nmap python-mysqldb snmpd mysql-client php-net-ipv4 php-net-ipv6 rrdtool git</p>
124<hr />
125<p>The packages listed above are an all-inclusive list of packages that were necessary on a clean install of Ubuntu 14.04.</p>
126<p>You need to configure snmpd appropriately if you have not already done so. An absolute minimal config for snmpd is:</p>
127<pre><code>    rocommunity NetManage 127.0.0.1</code></pre>
128<p>Adding the above line to <code>/etc/snmp/snmpd.conf</code> and running <code>service snmpd restart</code> will activate this config, but please <em>DON'T</em> do this if you've already configured SNMP earlier!</p>
129<p>In <code>/etc/php5/apache2/php.ini</code> and <code>/etc/php5/cli/php.ini</code>, ensure <code>date.timezone</code> is set to your preferred time zone.</p>
130<p>See <a href="http://php.net/manual/en/timezones.php" class="uri">http://php.net/manual/en/timezones.php</a> or files under <code>/usr/share/zoneinfo</code> for a list of supported timezones. Valid examples are: &quot;America/New York&quot;, &quot;Australia/Brisbane&quot;, &quot;Etc/UTC&quot;.</p>
131<h2 id="cloning-the-librenms-source-code-with-git"><span class="header-section-number">4.1</span> Cloning the LibreNMS source code with git</h2>
132<p>LibreNMS is installed using git. If you're not familiar with git, check out the <a href="http://git-scm.com/book">git book</a> or the tips at <a href="http://gitready.com/">git ready</a>. The initial install from github.com is called a <code>git clone</code>; subsequent updates are done through <code>git pull</code>.</p>
133<p>The initial clone can take quite a while (nearly 3 minutes on a 10Mbps connection is typical), so for this workshop we have set up a local mirror for you to use.</p>
134<p>Run the following:</p>
135<pre><code>    # cd /opt
136    # git clone http://www.ws.nsrc.org/git/librenms.git</code></pre>
137<p>Normally the URL to clone would be <code>https://github.com/librenms/librenms.git</code></p>
138<h2 id="web-interface"><span class="header-section-number">4.2</span> Web Interface</h2>
139<p>To prepare the web interface (and adding devices shortly), you'll need to create and change the ownership of a directory as well as create an Apache Virtul Host definition.</p>
140<p>First, create and chown the <code>rrd</code> directory and create the <code>logs</code> directory:</p>
141<pre><code>    # cd /opt/librenms
142    # mkdir rrd logs
143    # chown www-data:www-data logs/ rrd/</code></pre>
144<p>Next, create <code>/etc/apache2/sites-available/librenms.conf</code> containing the following:</p>
145<pre><code>     # editor /etc/apache2/sites-available/librenms.conf</code></pre>
146<p>Add the following lines:</p>
147<div class="sourceCode"><pre class="sourceCode apache"><code class="sourceCode apache"><span class="fu">&lt;VirtualHost</span><span class="ot"> *:80</span><span class="fu">&gt;</span>
148  DocumentRoot<span class="st"> /opt/librenms/html/</span>
149  ServerName<span class="st">  librenmsN.ws.nsrc.org</span>
150  CustomLog<span class="st"> /opt/librenms/logs/access_log combined</span>
151  ErrorLog<span class="st"> /opt/librenms/logs/error_log</span>
152  <span class="ot">AllowEncodedSlashes</span><span class="ch"> NoDecode</span>
153  <span class="fu">&lt;Directory</span><span class="ot"> &quot;/opt/librenms/html/&quot;</span><span class="fu">&gt;</span>
154    Require<span class="st"> all granted</span>
155    <span class="ot">AllowOverride</span><span class="ch"> </span><span class="kw">All</span>
156    <span class="ot">Options</span><span class="ch"> </span><span class="kw">FollowSymLinks</span><span class="ch"> </span><span class="kw">MultiViews</span>
157  <span class="fu">&lt;/Directory&gt;</span>
158<span class="fu">&lt;/VirtualHost&gt;</span></code></pre></div>
159<p>Change the N in <code>librenmsN.ws.nsrc.org</code> to your PC number.</p>
160<p>On Ubuntu 14.04, <code>mcrypt</code> is not enabled on install. Run the following to enable it:</p>
161<pre><code>    # php5enmod mcrypt</code></pre>
162<p>Now enable the Virtual Host, and restart Apache</p>
163<pre><code>    # a2ensite librenms
164    # a2enmod rewrite
165    # service apache2 restart</code></pre>
166<h2 id="web-installer"><span class="header-section-number">4.3</span> Web installer</h2>
167<p>You can choose either a web configuration or manual configuration at the command line. We're going to use the Web installer, which is by far the easiest, but we'll include the manual configuration as a reference at the end of this document.</p>
168<p>To make the web installation easier, at this point you can give access to the <code>www-data</code> user to write to the <code>/opt/librenms</code> directory so LibreNMS can create the configuration file. Run the following command:</p>
169<pre><code>    # chown www-data /opt/librenms</code></pre>
170<p>We'll change this back to <code>root</code>, which is safer, once we are done.</p>
171<p>At this stage you can launch the web installer by going to</p>
172<p><a href="http://librenmsN.ws.nsrc.org/install.php" class="uri">http://librenmsN.ws.nsrc.org/install.php</a></p>
173<p>Follow the onscreen instructions.</p>
174<ul>
175<li>Stage 1 prompts you for the database settings. Enter
176<ul>
177<li>DB Host: localhost</li>
178<li>DB User: librenms</li>
179<li>DB Pass: <code>&lt;CLASS_PASSWORD&gt;</code></li>
180<li>DB Name: librenms</li>
181</ul></li>
182<li>Stage 3: enter a username, password and E-mail address. This will become the login you use to access the web interface.</li>
183</ul>
184<p>We suggest you use <code>sysadm</code>, the class password, and your own E-mail address.</p>
185<ul>
186<li><p>Stage 5: the interface should show, at this point:</p>
187<p>&quot;The config file has been created&quot;</p></li>
188</ul>
189<p>Note: <em>IF</em> the installer tells you it can't write the configuration file, it may be that you forgot to run <code>chown www-data /opt/librenms</code>.</p>
190<p>You should try and fix the problem, and reload <a href="http://librenmsX.ws.nsrc.org/install.php" class="uri">http://librenmsX.ws.nsrc.org/install.php</a>.</p>
191<p>If it still doesn't work, you will need to copy the generated config the configuration from the browser window, create a new file <code>/opt/librenms/config.php</code> with a text editor, and paste the config into this file).</p>
192<p>(Remember if you are using &quot;vi&quot; to enter insert mode before you paste)</p>
193<p>We can now secure the <code>/opt/librenms</code> directory again:</p>
194<pre><code>    # chown root /opt/librenms</code></pre>
195<h2 id="basic-configuration"><span class="header-section-number">4.4</span> Basic configuration</h2>
196<p>We're going to make a few changes to the configuration file:</p>
197<ul>
198<li>Change the default SNMP community</li>
199<li>Allow xDP (CDP/LLDP) autodiscovery of the network</li>
200<li>Tell LibreNMS which networks it's allowed to scan/discover</li>
201</ul>
202<h3 id="setting-the-snmp-community"><span class="header-section-number">4.4.1</span> Setting the SNMP community</h3>
203<p>First, let's change the SNMP community that LibreNMS will try when discovering and adding new devices.</p>
204<p>Edit the file <code>/opt/librenms/config.php</code>, and find the line:</p>
205<pre><code>    $config['snmp']['community'] = array(&quot;public&quot;);</code></pre>
206<p>And set it to:</p>
207<pre><code>    $config['snmp']['community'] = array(&quot;NetManage&quot;);</code></pre>
208<h3 id="enabling-xdp-auto-discovery"><span class="header-section-number">4.4.2</span> Enabling xDP auto-discovery</h3>
209<p>Still in the file <code>/opt/librenms/config.php</code>, under the line:</p>
210<pre><code>        $config['snmp']['community'] = array(&quot;NetManage&quot;);</code></pre>
211<p>... add the following:</p>
212<pre><code>    $config['autodiscovery']['xdp']            = TRUE;</code></pre>
213<p>This tells LibreNMS to use CDP and LLDP to find and discover &quot;neighbor&quot; devices automatically.</p>
214<p>We have one more change...</p>
215<h3 id="tell-librenms-which-subnets-its-allowed-to-scan-automatically"><span class="header-section-number">4.4.3</span> Tell LibreNMS which subnets it's allowed to scan automatically</h3>
216<p>To be safe and not scan the Internet by mistake, LibreNMS needs to be tolds which subnets it's allowed to scan for new devices.</p>
217<p>Still in the file <code>/opt/librenms/config.php</code>, find the line:</p>
218<pre><code>    #$config['nets'][] = &quot;10.0.0.0/8&quot;;</code></pre>
219<p>... and remove tjhe <code>#</code> in front so it looks like:</p>
220<pre><code>    $config['nets'][] = &quot;10.0.0.0/8&quot;;</code></pre>
221<p>Save the file and exit - we're nearly done!</p>
222<h3 id="add-a-host."><span class="header-section-number">4.4.4</span> Add a host.</h3>
223<p>Let's add localhost (i.e.: YOUR virtual server), using the following commands. Later you'll do this from the Web interface:</p>
224<pre><code>    # cd /opt/librenms
225        # php addhost.php localhost NetManage v2c</code></pre>
226<p>Notice we explicitly tell LibreNMS which SNMP community to use. We also assume it's SNMP v2c. If you're using v3, there are additional steps which aren't provided here.</p>
227<h2 id="final-configuration"><span class="header-section-number">4.5</span> Final configuration</h2>
228<h3 id="test-poller"><span class="header-section-number">4.5.1</span> Test poller</h3>
229<p>We need to tell LibreNMS to discover localhost, and poll it for the first time: do this at the command line so you can see if it is working properly.</p>
230<pre><code>        # cd /opt/librenms
231        # php discovery.php -h all &amp;&amp; php poller.php -h all</code></pre>
232<h3 id="create-cronjob"><span class="header-section-number">4.5.2</span> Create cronjob</h3>
233<p>Create the cronjob which will run periodic tasks required by LibreNMS:</p>
234<pre><code>    # cd /opt/librenms
235        # cp librenms.cron /etc/cron.d/librenms</code></pre>
236<h2 id="install-complete"><span class="header-section-number">4.6</span> Install complete</h2>
237<p>That's it! You now should be able to log in to <a href="http://librenmsN.ws.nsrc.org/" class="uri">http://librenmsN.ws.nsrc.org/</a>. Please note that we have not covered HTTPS setup in this example, so your LibreNMS install is not secure by default. Please do not expose it to the public Internet unless you have configured HTTPS and taken appropriate web server hardening steps.</p>
238<h2 id="for-reference-only-manual-installation"><span class="header-section-number">4.7</span> For reference only: manual installation</h2>
239<p>If you want to continue the setup manually then follow these instructions. <em>DON'T</em> follow these instructions if you've already done this via the Web install above!</p>
240<pre><code>        # cd /opt/librenms
241        # cp config.php.default config.php
242        # editor config.php</code></pre>
243<h3 id="configure"><span class="header-section-number">4.7.1</span> Configure</h3>
244<p>Change the values to the right of the equal sign for lines beginning with <code>$config[db_]</code> to match your database information as setup above.</p>
245<pre><code>$config['db_host'] = &quot;localhost&quot;;
246$config['db_user'] = &quot;librenms&quot;;
247$config['db_pass'] = &quot;&lt;CLASS_PASSWORD&gt;&quot;;
248$config['db_name'] = &quot;librenms&quot;;</code></pre>
249<h3 id="initialise-the-database"><span class="header-section-number">4.7.2</span> Initialise the database</h3>
250<p>Initiate the follow database with the following command:</p>
251<pre><code>        # php build-base.php</code></pre>
252<h3 id="create-admin-user"><span class="header-section-number">4.7.3</span> Create admin user</h3>
253<p>Create the admin user - priv should be 10</p>
254<pre><code>        # php adduser.php &lt;name&gt; &lt;pass&gt; 10</code></pre>
255<p>Substitute your desired username and password -- and leave the angled brackets off. We suggest you use <code>sysadm</code> and the class password.</p>
256<h2 id="about-daily-updates"><span class="header-section-number">4.8</span> About Daily Updates</h2>
257<p>LibreNMS performs daily updates by default. At 00:15 system time every day, a <code>git pull --no-edit --quiet</code> is performed. If you don't want this, change the default by editing your <code>config.php</code> file. Remove the comment (the <code>#</code> mark) on the line:</p>
258<pre><code>#$config['update'] = 0;</code></pre>
259<p>so that it looks like this:</p>
260<pre><code>$config['update'] = 0;</code></pre>
261</body>
262</html>