Sys265NetMGMT‐Tools - ConnorEast/Tech-Journal GitHub Wiki

<< Previous Page

System Admin & Network Services 2

~~ Tool: LibreNMS ~~ Team Name: Codell ~~


LibreNMS is an open source network monitoring/management system designed to track stats such as health and performance of network connected devices. This can include switches routers, servers and other networked hardware. It is a relatively well known tool which allows for features such as automatic device discovery, Customicable Alerts, Network Monitoring, and customizable dashboards. It uses CDP, FDP, LLDP, OSPF,BGP,SNMP, and ARP respectively. Its notifactions can be sent via email, irc, slack or through other platforms. If you would like to read more about its functionality click the link located here

Command Used Explanation of Command
sudo yum update -y This command updates all dependencies on Linux based devices/VM's/Et;all
sudo yum install epel-release -y Installs the Extra Packages for Enterprise Linux [EPEL] Repository
sudo yum install dnf -y Installs the Dandified YUM module used for more modern linux systems. Not fully neccessary
dnf –version Checks the version number of DNF for cross comparison
sudo dnf update -y Incase an older model was downloaded, this will check and install newer dependencies
dnf list installed Lists all of the installed packages on your local machine
alias yum=dnf creates an alias for the word yum to overide yum to use the dnf command
source ~/.bashrc This command reloads the bash shell environment allowing for your device to properly reload the new dependencies
dnf -y install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm downloads the dnf-utils package and the remi-release repository
dnf module reset php removes any preconfigured settings for PHP. Used to remove Nagios Core settings
yum module enable php:remi-8.2 Sets the php download to look for version 8.2 when its installed
yum install -y php php-cli php-common php-opcache php-mcrypt php-gd php-curl php-mysql php-zip php-xml Installs PHP and all of the other dependencies necessary
systemctl restart httpd Restarts the MariaDB server if applicable
dnf install bash-completion cronie fping git ImageMagick mariadb-server mtr net-snmp net-snmp-utils nginx nmap php-fpm php-cli php-common php-curl php-gd php-gmp php-json php-mbstring php-process php-snmp php-xml php-zip php-mysqlnd python3 python3-PyMySQL python3-redis python3-memcached python3-pip python3-systemd rrdtool unzip

Downloads the following:

  • Bash-Completion: Allows bash command autocompletion
  • Cronie: Allows the scheduling of jobs to run periodically
  • Fping: Faster efficient ping
  • git: a tool for the distribution and management of source code.
  • ImageMagick: Creates, edits, and converts Bitmap Images
  • mariadb-server: DB-Server used for data organization
  • mtr: a network diagnostic tool combing ping and traceroute
  • net-snmp: SNMP manager
  • net-snmp-utils: Tools used by net-snmp to manage SNMP packates
  • nginx: High performance web server
  • nmap: Network exploration and security auditing tool
  • Et;all
sudo systemctl stop sssd Stops the SSSD service
rm -rf /var/lib/sss/db/* Removes all data logged at "/var/lib/sss/db/"
sudo systemctl enable sssd Enables the SSSD Service
sudo systemctl restart sssd Restarts the SSSD SErvice
useradd librenms -d /opt/librenms -M -r -s "$(which bash)" Creates a new user named librenms with a specified home directory of /opt/librenms and set their shell to default as a bash script shell.
cd /opt Go to the opt directory
git clone https://github.com/librenms/libernms.git Clone the librenms.git file from github.com and save it to /opt
chown -R libernms:libernms /opt/librenms Give the newly downloaded file full access from user/directory libernms
chmod 771 /opt/librenms Give Librenms user & members Read Write Execute functionality
setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/ sets the default ACL group read write and execute permisions for all 3 directories specified
setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/ Same as above but recursively
Sudo yum install gcc python3-devel Installs and downloads the python3-devel module
  • su - librenms
  • ./scripts/composer_wrapper.php install --no-dev
  • exit
Logs into the librenms user and run the composer_wrapper.php install script
wget https://getcomposer.org/composer-stable.phar mv composer-stable.phar /usr/bin/composer chmod +x /usr/bin/composer
timedatectl set-timezone America/New_York
vi /etc/my.cnf.d/mariadb-server.cnf

Append the following information

  • innodb_file_per_table=1
  • lower_case_table_names=0
systemctl enable mariadb Enables the Database Server
systemctl restart mariadb Restarts the Database Server
mysql -u root
CREATE DATABASE librenms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost'; exit Create a database user and give them Privilege's to call and add data to the database. Change password to match your desired password
cp /etc/php-fpm.d/www.conf /etc/php-fpm.d/librenms.conf
vi /etc/php-fpm.d/librenms.conf

Change the following information:

  • Change “www” to [librenms]
  • Change "user" to [librenms]
  • Change "group" = [librenms]
  • listen = /run/php-fpm-librenms.sock
vi /etc/nginx/conf.d/librenms.conf

Confirm the following information in librenms.conf

  • server { listen 80; server_name Librenms.east.local; root /opt/librenms/html; index index.php;

    charset utf-8; gzip on; gzip_types text/css application/javascript text/javascript application/x-javascript image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ [^/].php(/|$) { fastcgi_pass unix:/run/php-fpm-librenms.sock; fastcgi_split_path_info ^(.+.php)(/.+)$; include fastcgi.conf; } location ~ /.(?!well-known).* { deny all; } }

systemctl enable --now nginx Enables NGINX as your web interface
systemctl enable --now php-fpm Enables php-form
Sudo cp /opt/librenms/dist/librenms-scheduler.service /opt/librenms/dist/librenms-scheduler.timer /etc/systemd/system/ Copies the timer service and schedule for librenms in order to the have them manageable via systemd
Sudo systemctl enable librenms-scheduler.timer Enables the timer
Open your NMOM01 server ip address in a web browser in order to complete the rest of your setup.

Deliverable 4: Alert Setup

  • sudo mv composer-stable.phar /usr/bin/composer
  • chmod +x /usr/php.ini
  • chmod +x /usr/bin/composer
  • vi /etc/php.ini

Pros And Cons

Sources Used:

  • “How to Set up Timezone and NTP Synchronization on Ubuntu 14.04 [Quickstart].” DigitalOcean, www.digitalocean.com/community/tutorials/how-to-set-up-timezone-and-ntp-synchronization-on-ubuntu-14-04-quickstart. Accessed 1 Feb. 2025.

  • “Install DNF in Rhel/Centos 7 ⋆ ALexHost Srl.” ALexHost SRL, 6 Dec. 2024, alexhost.com/faq/install-dnf-in-rhel-centos-7/#:~:text=While%20RHEL%2FCentOS%207%20does,power%20and%20flexibility%20of%20DNF!

  • LibreNMS. “Home.” Home - LibreNMS Docs, docs.librenms.org/index. Accessed 1 Feb. 2025.

  • LibreNMS. “Install Librenms.” Installing LibreNMS - LibreNMS Docs, docs.librenms.org/Installation/Install-LibreNMS/#configure-php-fpm. Accessed 1 Feb. 2025.
  • Email Sent From TERMINAL





    ~~ Depricated Documentation: NAGIOS Core ~~

    Nagios Core Overview:

    Nagios Core is an open-source Linux-based network monitoring tool which monitors and checks the availability, performance, and applications used by the hosts connected to it. The main purpose being to alert the system administrator should an issue occur on a network host. In regards to OS compatibility, Nagios Core can run on both Linux systems as well as Unix-like Systems. When compared to other similar network monitoring tools Nagios meets the following criterium:

    • IP SLA Reports [IP Service Level Agreement]: Nagios measures network service performance, Latency, Jitter, Packet Loss, et;alls when the proper plug in is installed. ([Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems)).
    • Logical Grouping: Logical Groupings, which allow for the segregation of hosts into user-defined groups, is natively available ([Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems)).
    • Trending: Trending, Which tells you what network data is most actively used over the network , is natively available ([Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems)).
    • Trend Prediction: Trend Prediction, Algorithmic prediction of future network statistics, is not available using Nagios Core ([Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems)).
    • Auto Discovery: Auto Discovery, Automatically locates network devices and hosts on the network, is available Via Plugins ([Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems)).
    • SNMP compatibility: Nagios is able to Natively retrieve and report on SNMP statistics ([Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems)).
    • Syslog Compatibility: Nagios is able to receive and report on Syslog files with the appropriate Plugins. ([Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems)).
    • Triggers: Triggers alerting the administrator of various threshold violations in network data is Natively Available. ([Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems)).
    • MIB compiler: MIB data can be Natively managed by NAGIOS core ([Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems)).
    • Web app: There is not a web based application available on Nagios core ([Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems)).
    • Distributed Monitoring: Distributed Monitoring is natively available and it Can be used on more than one server in order to increase monitoring capabilities ([Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems)).
    • Inventory: Nagios core natively keeps records on hardware/software inventories for the devices being monitored ([Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems)).
    • Platform: The Platform was written in C ([Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems)).
    • DATA storage method: Data is stored in either a FlatFile or SQL format ([Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems)).
    • License: Nagios was released under the GNUGPL License ([Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems)).
    • IPv6 Compatibility: Nagios Core Natively supports IPv6 monitoring of hosts ([Wikipedia](https://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems)).

    Terminal Commands

    Commandcd /tmp/nagios-plugins-2.1.1
    SystemReasoning
    Nmon > term setenforce 0
    Nmon > term Cd /etc/selinux/config Change “enforcing” to “disabled” to turn off SELinux
    Nmon > term yum install httpd php php-cli gcc glibc glibc-common gd gd-devel net-snmp openssl-devel wget unzip -y This command installs the dependencies needed
    Nmon > term useradd nagios
    Nmon > term groupadd nagcmd
    Nmon > term usermod -a -G nagcmd nagios
    Nmon > term usermod -a -G nagcmd apache
    Nmon01 > TMP Wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.1.1.tar.gz
    Nmon01 > TMP Wget https://www.nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz
    Nmon01 > TMP tar zxf nagios-plugins-2.1.1.tar.gz
    Nmon01 > TMP Cd nagios-4.1.1
    Nmon01 > nagios-4.1.1 ./configure –with-command-group=nagcmd
    Nmon01 > nagios-4.1.1 Sudo yum install make -y
    Nmon01 > nagios-4.1.1 Make all
    Nmon01 > nagios-4.1.1 Make install
    Nmon01 > nagios-4.1.1 Make install-init
    Nmon01 > nagios-4.1.1 Make install-commandmode
    Nmon01 > nagios-4.1.1 Make install-webconf
    Nmon01 > nagios-4.1.1 htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
    Nmon01 > nagios-4.1.1
    Nmon01 > nagios-plug… ./configure –with-nagios-user=nagios –with-nagios-group=nagios –with-openssl
    Nmon01 > nagios-plug… make all
    Nmon01 > nagios-plug… make install
    Nmon01 > nagios-plug… /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
    Nmon01 > nagios-plug… chkconfig –add-nagios
    Nmon01 > nagios-plug… chkconfig –level 35 nagios on
    Nmon01 > nagios-plug… firewall-cmd –zone=public –add-port=80/tcp –permanent
    Nmon01 > nagios-plug… firewall-cmd –reload
    Nmon01 > nagios-plug… vi /etc/httpd/conf/httpds.conf
    Nmon01 > nagios-plug… service http enable
    Nmon01 > nagios-plug… Service http start
    Nmon01 > nagios-plug… Service nagios enable
    Nmon01 > nagios-plug… Service nagios start
    WKS01 Navigate to web browser “10.0.5.11/nagios”
    ⚠️ **GitHub.com Fallback** ⚠️