Load MIBs to log server

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
robjohn
Posts: 4
Joined: Fri Jan 22, 2016 9:23 am

Load MIBs to log server

Post by robjohn »

I'd like to know how to load mibs to log server. We have two clustered servers.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Load MIBs to log server

Post by hsmith »

What are you trying to load MIBs to Logserver for?
Former Nagios Employee.
me.
Envera IT
Posts: 159
Joined: Wed Jun 19, 2013 10:21 am

Re: Load MIBs to log server

Post by Envera IT »

If you're trying to import mibs for the snmptrap input you need to convert the mib's to YAML.

https://discuss.elastic.co/t/mib-oid-translation/29710

The import script lives in

Code: Select all

/usr/local/nagioslogserver/logstash/vendor/jruby/lib/ruby/1.9/dl/import.rb
I tried running this on a directory of mibs in /tmp/mibs/ but it failed : (

Code: Select all

/usr/local/nagioslogserver/logstash/vendor/jruby/lib/ruby/1.9/dl/import.rb: line 1: require: command not found
/usr/local/nagioslogserver/logstash/vendor/jruby/lib/ruby/1.9/dl/import.rb: line 2: require: command not found
/usr/local/nagioslogserver/logstash/vendor/jruby/lib/ruby/1.9/dl/import.rb: line 3: require: command not found
/usr/local/nagioslogserver/logstash/vendor/jruby/lib/ruby/1.9/dl/import.rb: line 4: require: command not found
/usr/local/nagioslogserver/logstash/vendor/jruby/lib/ruby/1.9/dl/import.rb: line 6: module: command not found
/usr/local/nagioslogserver/logstash/vendor/jruby/lib/ruby/1.9/dl/import.rb: line 7: class: command not found
/usr/local/nagioslogserver/logstash/vendor/jruby/lib/ruby/1.9/dl/import.rb: line 8: syntax error near unexpected token `('
/usr/local/nagioslogserver/logstash/vendor/jruby/lib/ruby/1.9/dl/import.rb: line 8: `    def initialize(handlers)'
Hopefully the Nagios guys can point us in the right direction.
I like graphs...
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Load MIBs to log server

Post by jolson »

I believe I got this working using the following procedure:

Code: Select all

yum install libsmi libsmi-devel -y
gem install snmp
gem install dl
wget https://raw.githubusercontent.com/hallidave/ruby-snmp/master/import.rb
mkdir mibs
(move your mibs into the mibs folder)
ruby import.rb mibs/
cd data/ruby/snmp/mibs/
ls -ltr
Note that your mibs have been imported, you can verify this with the output of ls -ltr:

Code: Select all

-rwxrwxr-x. 1 nagios nagios   728 Jan 18 16:20 CIRCUIT-IF-MIB.yaml
-rwxrwxr-x. 1 nagios nagios   742 Jan 18 16:20 ATM-TC-MIB.yaml
-rwxrwxr-x. 1 nagios nagios  5135 Mar 18 08:16 DS1-MIB.yaml
Note that there is a file datestamped with March 18th, meaning that the YAML file was created today. Success!
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Locked