{"id":2304,"date":"2019-03-01T00:03:06","date_gmt":"2019-03-01T00:03:06","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=2304"},"modified":"2023-02-08T15:36:27","modified_gmt":"2023-02-08T21:36:27","slug":"install-oxidized-on-librenms","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/install-oxidized-on-librenms\/","title":{"rendered":"Install Oxidized on LibreNMS"},"content":{"rendered":"\n<p><strong>Install Oxidized<\/strong><\/p>\n\n\n\n<p>Install Instructions from <a href=\"https:\/\/github.com\/ytti\/oxidized#centos-oracle-linux-red-hat-linux\">here<\/a><\/p>\n\n\n\n<p><strong>Install prerequisites <\/strong><\/p>\n\n\n\n<p>For CentOS, RockyLinux, and Alma Linux.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo yum -y install make cmake which sqlite-devel openssl-devel libssh2-devel ruby gcc ruby-devel libicu-devel gcc-c++<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Install Ruby Gems<\/strong><\/p>\n\n\n\n<p>If you run into issues with installing the oxidized-web gem because of a ruby version, try installing ruby 2.6.1 via <a href=\"http:\/\/www.incredigeek.com\/home\/install-ruby-2-1-2-via-rvm-on-centos\/\">rvm<\/a> the docs say install 2.1.2, but was having issues with it.  2.6.1 seems fine.<\/p>\n\n\n\n<p><strong>Install Oxidized<\/strong><\/p>\n\n\n\n<p>Note: If you run into issues with oxidized not being able to ssh into devices, and showing &#8220;OpenSSL::PKey::PKeyError with msg &#8220;dh#set_pqg= is incompatible with OpenSSL 3.0&#8243;&#8221; in the log, try <a href=\"https:\/\/www.incredigeek.com\/home\/oxidized-error-opensslpkeypkeyerror-with-msg-dhset_pqg-is-incompatible-with-openssl-3-0\/\">installing from git<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">gem install oxidized \ngem install oxidized-script\ngem install oxidized-web <\/pre>\n\n\n\n<p>Run Oxidized twice to generate the config<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">oxidized<\/pre>\n\n\n\n<p>If you have issues running oxidized due to an invalid or self signed ssl cert, you can either fix the cert or ignore it in the oxidized config. <a href=\"https:\/\/github.com\/ytti\/oxidized\/pull\/618\/files\">https:\/\/github.com\/ytti\/oxidized\/pull\/618\/files<\/a><\/p>\n\n\n\n<p>Modify the Oxidized config file in &#8220;\/root\/.config\/oxidized\/config&#8221; to look like this.<\/p>\n\n\n\n<p>Modify the http portion of the config file to look like the following.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">http:<br>\n    url: https:\/\/localhost\/api\/v0\/oxidized<br>\n    scheme: https<br>\n    secure: false<\/pre>\n\n\n\n<p><strong>Setup Config<\/strong><\/p>\n\n\n\n<p>Put the config file in the users home directory.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">vi .config\/oxidized\/config<\/pre>\n\n\n\n<p>Setup the config, Basic config below, edit as needed<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">---<br>username: admin<br>password: password<br>model: airos<br>resolve_dns: true<br>interval: 3600<br>use_syslog: false<br>debug: false<br>threads: 30<br>timeout: 20<br>retries: 3<br>prompt: !ruby\/regexp \/^([\\w.@-]+[#&gt;]\\s?)$\/<br>rest: 127.0.0.1:8888<br>next_adds_job: false<br>vars: {}<br>groups:<br>   airos:<br>     username: ubnt<br>     password: ubnt<br>   routeros:<br>     username: admin<br>     password: <br>     vars:<br>       ssh_port: 2222<br> models: {}<br> pid: \/home\/incredigeek\/.config\/oxidized\/pid<br> crash:<br>   directory: \/home\/incredigeek\/.config\/oxidized\/crashes<br>   hostnames: false<br> stats:<br>   history_size: 10<br> input:<br>   default: ssh, telnet<br>   debug: false<br>   ssh:<br>     secure: false<br>   ftp:<br>     passive: true<br>   utf8_encoded: true<br> output:<br>   default: file<br>   file:<br>     directory: \/home\/incredigeek\/.config\/oxidized\/configs<br> source:<br>   default: http<br>   debug: false<br>   http:<br>     secure: false<br>     scheme: https<br>     url: https:\/\/localhost\/api\/v0\/oxidized<br>     map:<br>       name: hostname<br>       model: os<br>       group: group<br>     headers:<br>       X-Auth-Token: '3wq2b87fj4e6fb5987b5812t6ej9709g'<br> model_map:<br>   cisco: ios<br>   juniper: junos<br>   mikrotik: routeros<\/pre>\n\n\n\n<p><strong>Setup as system service<\/strong><\/p>\n\n\n\n<p>Find the &#8220;oxidized.service&#8221; file, should be in <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">  \/usr\/local\/rvm\/gems\/ruby-2.6.1\/gems\/oxidized-0.25.1\/extra\/oxidized.service<\/pre>\n\n\n\n<p>or <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/usr\/local\/share\/gems\/gems\/oxidized-0.28.0\/extra\/oxidized.service<\/pre>\n\n\n\n<p>and copy it to <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">  \/usr\/lib\/systemd\/system\/<\/pre>\n\n\n\n<p>Edit it and change the user and try to launch it<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl start oxidized<\/pre>\n\n\n\n<p>If it fails, you may need to substitute the ExecStart= variable to the following <a href=\"https:\/\/stackoverflow.com\/questions\/26247926\/how-to-solve-usr-bin-env-ruby-executable-hooks-no-such-file-or-directory\">more info<\/a><\/p>\n\n\n\n<p class=\"has-text-align-left\">ExecStart=\/usr\/local\/rvm\/gems\/ruby-2.6.1\/wrappers\/oxidize<\/p>\n\n\n\n<p><em>Change the ruby number if yours is different.<\/em><\/p>\n\n\n\n<p>Enable the service on system boot up and start<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl enable --now oxidized<\/pre>\n\n\n\n<p>Check that oxidized is running<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl status oxidized<\/pre>\n\n\n\n<p><strong>LibreNMS config<\/strong><\/p>\n\n\n\n<p>Add the following to your \/opt\/librenms\/config.php config file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Oxidized configuration\n $config['oxidized']['enabled']                  = TRUE;\n $config['oxidized']['url']                      = 'http:\/\/127.0.0.1:8888';\n $config['oxidized']['features']['versioning']   = true;\n $config['oxidized']['group_support']            = true;\n $config['oxidized']['default_group']            = 'default';\n $config['oxidized']['reload_nodes']             = true;\n $config['oxidized']['ignore_os'] = array('linux','windows');\n $config['oxidized']['ignore_types'] = array('server','power');<\/pre>\n\n\n\n<p>LibreNMS should now feed Oxidized the devices.  <\/p>\n\n\n\n<p>You can check in the LibreNMS interface to see if it is getting the configs.  https:\/\/librenms\/oxidized<\/p>\n\n\n\n<p>Where librenms is your LibreNMS servers ip\/hostname.<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Install Oxidized Install Instructions from here Install prerequisites For CentOS, RockyLinux, and Alma Linux. sudo yum -y install make cmake which sqlite-devel openssl-devel libssh2-devel ruby gcc ruby-devel libicu-devel gcc-c++ Install Ruby Gems If you run into issues with installing the &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/install-oxidized-on-librenms\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[352],"tags":[75,353,134,389,585],"class_list":["post-2304","post","type-post","status-publish","format-standard","hentry","category-librenms","tag-backup","tag-librenms","tag-monitoring","tag-nms","tag-oxidized"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=2304"}],"version-history":[{"count":16,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2304\/revisions"}],"predecessor-version":[{"id":4828,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/2304\/revisions\/4828"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=2304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=2304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=2304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}