{"id":13027,"date":"2022-06-01T13:04:20","date_gmt":"2022-06-01T10:04:20","guid":{"rendered":"https:\/\/kifarunix.com\/?p=13027"},"modified":"2024-03-09T15:52:14","modified_gmt":"2024-03-09T12:52:14","slug":"add-hosts-to-librenms-server-for-monitoring","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/add-hosts-to-librenms-server-for-monitoring\/","title":{"rendered":"Add Hosts to LibreNMS Server for Monitoring"},"content":{"rendered":"\n<p>In this tutorial, you will learn how to add hosts to LibreNMS server for monitoring. <a href=\"https:\/\/www.librenms.org\/#features\" target=\"_blank\" rel=\"noreferrer noopener\">LibreNMS<\/a>&nbsp;is a fully featured MySQL\/PHP and SNMP based network monitoring system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Add Hosts to LibreNMS Server for Monitoring<\/h2>\n\n\n\n<p>If you haven&#8217;t installed LibreNMS server, you can check our guides on how to <a href=\"https:\/\/kifarunix.com\/?s=librenms\" target=\"_blank\" rel=\"noreferrer noopener\">install and setup LibreNMS server<\/a>.<\/p>\n\n\n\n<p>Once you have LibreNMS server up and running, proceed to add hosts for monitoring.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Install SNMP on Hosts to Monitor<\/h3>\n\n\n\n<p>Before you can add hosts to LibreNMS server, you need to install and configure SNMP on the remote hosts to monitor.<\/p>\n\n\n\n<p>You can use SNMP v3 or SNMP v2c as you so wish.<\/p>\n\n\n\n<p>See sample guides on how to configure SNMP v2c and SNMP v3 on various hosts;<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-and-configure-snmp-on-ubuntu-debian\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install and Configure SNMP on Ubuntu 22.04\/Debian 11<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-and-configure-snmp-on-rocky-linux-8\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install and Configure SNMP on Rocky Linux 8<\/a><\/p>\n\n\n\n<p>There are two ways in which you can add hosts to LibreNMS server.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"#add-host-via-web-ui\">Add hosts to LibreNMS server via Web UI<\/a><\/li>\n\n\n\n<li><a href=\"#add-host-via-cli\">Add hosts to LibreNMS server via CLI<\/a><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-host-via-web-ui\">Add hosts to LibreNMS server via Web UI<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To begin with, ensure you can ping the host from the LibreNMS server.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>fping 192.168.58.26<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>192.168.58.26 is alive<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Next, login to LibreNMS web interface and navigate to <strong>Devices &gt; Add Device<\/strong>.<\/li>\n<\/ul>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/add-hosts-librenms.png\" class=\"td-modal-image\"><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1907\" height=\"656\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/add-hosts-librenms.png\" alt=\"Add Hosts to LibreNMS Server for Monitoring\" class=\"wp-image-13032\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/add-hosts-librenms.png?v=1654077407 1907w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/add-hosts-librenms-768x264.png?v=1654077407 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/add-hosts-librenms-1536x528.png?v=1654077407 1536w\" sizes=\"(max-width: 1907px) 100vw, 1907px\" \/><\/figure><\/div><\/a><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Next;\n<ul class=\"wp-block-list\">\n<li>specify the hostname\/IP of the remote host,<\/li>\n\n\n\n<li>SNMP: ON\n<ul class=\"wp-block-list\">\n<li>Turn it off if you just want to check aliveness of the host via ping. Also if the host doesn&#8217;t support SNMP.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>SNMP version, port and protocol.<\/li>\n\n\n\n<li>Port Association mode: We will leave the default: <strong>IfIndex<\/strong>.<\/li>\n\n\n\n<li>Configure specific SNMP version details.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>LibreNMS hosts\/devices using SNMP v2c sample configuration details;<\/p>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/librenms-snmp-v2c-host.png\" class=\"td-modal-image\"><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1910\" height=\"814\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/librenms-snmp-v2c-host.png\" alt=\"Add Hosts to LibreNMS Server for Monitoring\" class=\"wp-image-13035\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/librenms-snmp-v2c-host.png?v=1654077582 1910w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/librenms-snmp-v2c-host-768x327.png?v=1654077582 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/librenms-snmp-v2c-host-1536x655.png?v=1654077582 1536w\" sizes=\"(max-width: 1910px) 100vw, 1910px\" \/><\/figure><\/div><\/a><\/div>\n\n\n\n<p>LibreNMS hosts\/devices using SNMP v3 sample configuration details;<\/p>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/add-snmp-v3-host-linrenms.png\" class=\"td-modal-image\"><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1880\" height=\"937\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/add-snmp-v3-host-linrenms.png\" alt=\"Add Hosts to LibreNMS Server for Monitoring\" class=\"wp-image-13034\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/add-snmp-v3-host-linrenms.png?v=1654077461 1880w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/add-snmp-v3-host-linrenms-768x383.png?v=1654077461 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/add-snmp-v3-host-linrenms-1536x766.png?v=1654077461 1536w\" sizes=\"(max-width: 1880px) 100vw, 1880px\" \/><\/figure><\/div><\/a><\/div>\n\n\n\n<p>You can check <a href=\"https:\/\/kifarunix.com\/install-and-configure-snmp-on-ubuntu-debian\/#snmp-v3\" target=\"_blank\" rel=\"noreferrer noopener\">how to configure SNMP v3<\/a>.<\/p>\n\n\n\n<p>Click <strong>Add Device<\/strong> once done with settings configuration.<\/p>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/add-snmp-v2c-host-linrenms.png\" class=\"td-modal-image\"><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1876\" height=\"940\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/add-snmp-v2c-host-linrenms.png\" alt=\"Add Hosts to LibreNMS Server for Monitoring\" class=\"wp-image-13033\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/add-snmp-v2c-host-linrenms.png?v=1654077434 1876w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/add-snmp-v2c-host-linrenms-768x385.png?v=1654077434 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/add-snmp-v2c-host-linrenms-1536x770.png?v=1654077434 1536w\" sizes=\"(max-width: 1876px) 100vw, 1876px\" \/><\/figure><\/div><\/a><\/div>\n\n\n\n<p>If all is well, the host will be added to LibreNMS server.<\/p>\n\n\n\n<p>You can click on the host link to check host details;<\/p>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/librenms-host-details.png\" class=\"td-modal-image\"><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1891\" height=\"932\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/librenms-host-details.png\" alt=\"Add Hosts to LibreNMS Server for Monitoring\" class=\"wp-image-13036\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/librenms-host-details.png?v=1654077635 1891w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/librenms-host-details-768x379.png?v=1654077635 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/librenms-host-details-1536x757.png?v=1654077635 1536w\" sizes=\"(max-width: 1891px) 100vw, 1891px\" \/><\/figure><\/a><\/div>\n\n\n\n<p>To list all the devices, you can navigate to Devices &gt; All Devices &gt; Servers.<\/p>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/all-devices-librenms.png\" class=\"td-modal-image\"><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1912\" height=\"371\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/all-devices-librenms.png\" alt=\"Add Hosts to LibreNMS Server for Monitoring\" class=\"wp-image-13037\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/all-devices-librenms.png?v=1654077659 1912w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/all-devices-librenms-768x149.png?v=1654077659 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/all-devices-librenms-1536x298.png?v=1654077659 1536w\" sizes=\"(max-width: 1912px) 100vw, 1912px\" \/><\/figure><\/a><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-host-via-cli\">Add Host via Command Line<\/h3>\n\n\n\n<p>To add hosts via the command line, login to LibreNMS via SSH.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Switch to librenms user;<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo su - librenms<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Run the <code><strong>.\/lnms device:add<\/strong><\/code> command to add the hosts to LibreNMS server.<\/li>\n<\/ul>\n\n\n\n<p>You can see how to use this command by reading the help page.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/lnms device:add --help<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\nDescription:\n  Add a new device\n\nUsage:\n  device:add [options] [--] <device spec>\n\nArguments:\n  device spec                                        Hostname or IP to add\n\nOptions:\n  -1, --v1                                           Use SNMP v1\n  -2, --v2c                                          Use SNMP v2c\n  -3, --v3                                           Use SNMP v3\n  -c, --community=COMMUNITY                          SNMP v1 or v2 community\n  -r, --port=PORT                                    SNMP transport port [default: 161]\n  -t, --transport=TRANSPORT                          Transport to connect to the device [udp, udp6, tcp, tcp6] [default: \"udp\"]\n  -d, --display-name=DISPLAY-NAME                    A string to display as the name of this device, defaults to hostname.\n                                                     May be a simple template using replacements: {{ $hostname }}, {{ $sysName }}, {{ $sysName_fallback }}, {{ $ip }}\n  -u, --security-name=SECURITY-NAME                  SNMPv3 security username [default: \"root\"]\n  -A, --auth-password=AUTH-PASSWORD                  SNMPv3 authentication password\n  -a, --auth-protocol=AUTH-PROTOCOL                  SNMPv3 authentication protocol [SHA, SHA-224, SHA-256, SHA-384, SHA-512, MD5] [default: \"MD5\"]\n  -X, --privacy-password=PRIVACY-PASSWORD            SNMPv3 privacy password\n  -x, --privacy-protocol=PRIVACY-PROTOCOL            SNMPv3 privacy protocol [AES, AES-192, AES-256, AES-256-C, DES] [default: \"AES\"]\n  -f, --force                                        Just add the device, do not make any safety checks\n  -b, --ping-fallback                                Add the device as ping only if it does not respond to SNMP\n  -g, --poller-group=POLLER-GROUP                    commands.device:add.options.poller-group [default: 0]\n  -p, --port-association-mode=PORT-ASSOCIATION-MODE  Sets how ports are mapped. ifName is suggested for Linux\/Unix [ifIndex, ifName, ifDescr, ifAlias] [default: \"ifIndex\"]\n  -P, --ping-only                                    Add a ping only device\n  -o, --os=OS                                        Ping only: specify OS\n  -w, --hardware=HARDWARE                            Ping only: specify hardware\n  -s, --sysName=SYSNAME                              Ping only: specify sysName\n  -h, --help                                         Display help for the given command. When no command is given display help for the list command\n  -q, --quiet                                        Do not output any message\n  -V, --version                                      Display this application version\n      --ansi|--no-ansi                               Force (or disable --no-ansi) ANSI output\n  -n, --no-interaction                               Do not ask any interactive question\n      --env[=ENV]                                    The environment the command should run under\n  -v|vv|vvv, --verbose                               Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add SNMP v2c Host via Command Line<\/li>\n<\/ul>\n\n\n\n<p>If your host is using SNMP v2c, then run the command below to add it to LibreNMS server. Replace the <strong>string<\/strong> and the <strong>IP address<\/strong> accordingly.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/lnms device:add -2 -c Ex@mPL3 -r 161 -t udp 192.168.60.22<\/code><\/pre>\n\n\n\n<p>Sample output;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Added device 192.168.60.22 (4)<\/code><\/pre>\n\n\n\n<p>You can remove the device using <code>.\/lnms device:remove<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/lnms device:remove --help<\/code><\/pre>\n\n\n\n<p>You can remove the device using <code>.\/lnms device:rename<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/lnms device:rename --help<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add SNMP v2 Host via Command Line<\/li>\n<\/ul>\n\n\n\n<p>To add SNMP v3 host via command line, run the command below;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/lnms device:add -3 -u snmpadmin -A STrP@SSWRD -a SHA -X STr0ngP@SSWRD -x AES -r 161 -t udp 192.168.58.26<\/code><\/pre>\n\n\n\n<p><strong>Replace the username, authentication password\/protocol, privacy password\/protocol, host IP accordingly.<\/strong><\/p>\n\n\n\n<p>You can then go back to the dashboard to view collected details about your hosts.<\/p>\n\n\n\n<p>Sample memory health status.<\/p>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/sample-memory-health-status.png\" class=\"td-modal-image\"><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1906\" height=\"578\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/sample-memory-health-status.png\" alt=\"Add Hosts to LibreNMS Server for Monitoring\" class=\"wp-image-13038\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/sample-memory-health-status.png?v=1654077690 1906w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/sample-memory-health-status-768x233.png?v=1654077690 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/06\/sample-memory-health-status-1536x466.png?v=1654077690 1536w\" sizes=\"(max-width: 1906px) 100vw, 1906px\" \/><\/figure><\/div><\/a><\/div>\n\n\n\n<p>You can also add the dashboard for various events under <strong>Overview &gt; Dashboards<\/strong>.<\/p>\n\n\n\n<p>That marks the end of our tutorial on how to monitor remote hosts with LibreNMS server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will learn how to add hosts to LibreNMS server for monitoring. LibreNMS&nbsp;is a fully featured MySQL\/PHP and SNMP based network monitoring<\/p>\n","protected":false},"author":1,"featured_media":12965,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[72,121],"tags":[5338,5286,5288,5289,5337],"class_list":["post-13027","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-monitoring","category-howtos","tag-add-hosts-for-monitoring-librenms","tag-add-hosts-to-librenms-server","tag-librenms-add-hosts-via-command-line","tag-librenms-add-hosts-via-web-ui","tag-lnms-deviceadd","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/13027"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=13027"}],"version-history":[{"count":3,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/13027\/revisions"}],"predecessor-version":[{"id":20578,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/13027\/revisions\/20578"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/12965"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=13027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=13027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=13027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}