LibreNMS SERVER 安裝筆記

 

安裝項目
1.ubuntu
3.webadmin
4.LibreNMS


1.ubuntu

下載新版ubuntu
http://www.ubuntu.com/download/server
LST 18.04 (2018.4.30)

rufus->ISO 燒進USB安裝


HDD規劃->自動給他規劃!選第一個,不要選LVM那一個!


這邊就要給定網路設定,才能自動安裝更新
主機名稱這邊要先給定,避免與線上mail server衝突

建立使用者帳號
Ubuntu 考量到安全性問題,預設把系統管理員 root 關閉,禁止直接登入。
Ubuntu 管理系統的方法是利用 sudo 應用程式鍵入自己的密碼,
來讓管理者暫時取得 root 權限去完成他的管理工作,而您在安裝系統的時候所建立的那個帳號就是預設的 sudoer 。
所以要給他一組新的帳密:kcc/26891005
以後可以將新的mis的user加入sudo群組,就有一樣效果,
考慮以後統一全集團的root帳密,
對新mis再由jacky或kevin另外設定帳號密碼,
以免MIS離職要全部換密碼...


裝完之後(執行#sudo -i,就不用每個指令都sudo)
A.昇級套件
先增加套件庫!

sudo add-apt-repository universe

vi /etc/apt/sources.list

deb http://free.nchc.org.tw/ubuntu/ cosmic main
deb-src http://free.nchc.org.tw/ubuntu/ cosmic main

apt autoremove
apt autoclean
apt clean
apt update
apt upgrade
apt update && apt upgrade

更改時區
dpkg-reconfigure tzdata

--改IP
root@ubuntu:~# vim /etc/netplan/50-cloud-init.yaml

network:
ethernets:
eth0:
addresses:
- 192.168.15.72/20
gateway4: 192.168.12.2
nameservers:
addresses:
- 223.5.5.5
search: []
optional: true
version: 2
执行命令 使配置生效

root@ubuntu:~# netplan apply
---------------------

6.webadmin
https://www.digitalocean.com/community/tutorials/how-to-install-webmin-on-ubuntu-18-04
http://blog.topspeedsnail.com/archives/5024

http://www.webmin.com/deb.html

vi /etc/apt/sources.list

add deb http://download.webmin.com/download/repository sarge contrib


wget http://www.webmin.com/jcameron-key.asc
apt-key add jcameron-key.asc
apt update
add-apt-repository universe
apt install webmin

7.LibreNMS

https://computingforgeeks.com/how-to-install-and-configure-librenms-on-ubuntu-18-04-lts-with-nginx/

date.timezone = Asia/Taipei

SET time_zone = '+8:00';

https://github.com/jasoncheng7115/librenms-cpatch


OPNE SNMP SETTING

https://docs.librenms.org/Support/SNMP-Configuration-Examples/

Linux (snmpd v2)
Replace your snmpd.conf file by the example below and edit it with appropriate community in "RANDOMSTRINGGOESHERE".


vi /etc/snmp/snmpd.conf

# Change RANDOMSTRINGGOESHERE to your preferred SNMP community string
com2sec readonly default RANDOMSTRINGGOESHERE

group MyROGroup v2c readonly
view all included .1 80
access MyROGroup "" any noauth exact all none none

syslocation Rack, Room, Building, City, Country [GPSX,Y]
syscontact Your Name <该 Email 地址已受到反垃圾邮件插件保护。要显示它需要在浏览器中启用 JavaScript。>

#Distro Detection
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro

#Hardware Detection (uncomment to enable)
#extend .1.3.6.1.4.1.2021.7890.2 hardware '/bin/cat /sys/devices/virtual/dmi/id/product_name'
#extend .1.3.6.1.4.1.2021.7890.3 manufacturer '/bin/cat /sys/devices/virtual/dmi/id/sys_vendor'
#extend .1.3.6.1.4.1.2021.7890.4 serial '/bin/cat /sys/devices/virtual/dmi/id/product_serial'

 

The binary /usr/bin/distro must be copied from the original source repository:
curl -o /usr/bin/distro https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro
chmod +x /usr/bin/distro


service snmpd restart

Windows Server 2008 R2
Log in to your Windows Server 2008 R2
Start "Server Manager" under "Administrative Tools"
Click "Features" and then click "Add Feature"
Check (if not checked) "SNMP Service", click "Next" until "Install"
Start "Services" under "Administrative Tools"
Edit "SNMP Service" properties
Go to the security tab
In "Accepted community name" click "Add" to add your community string and permission
In "Accept SNMP packets from these hosts" click "Add" and add your LibreNMS server IP address
Validate change by clicking "Apply"
Windows Server 2012 R2 and 2016
Log in to your Windows Server 2012 R2
Start "Server Manager" under "Administrative Tools"
Click "Manage" and then "Add Roles and Features"
Continue by pressing "Next" to the "Features" menu
Install (if not installed) "SNMP Service"
Start "Services" under "Administrative Tools"
Edit "SNMP Service" properties
Go to the security tab
In "Accepted community name" click "Add" to add your community string and permission
In "Accept SNMP packets from these hosts" click "Add" and add your LibreNMS server IP address
Validate change by clicking "Apply"