# Use Cisco MIB to fetch CPU and Memory using Logstash

**URL:** <https://discuss.elastic.co/t/use-cisco-mib-to-fetch-cpu-and-memory-using-logstash/255445>\
**Category:** Logstash\
**Created:** [November 15, 2020, 6:45pm UTC](https://discuss.elastic.co/t/use-cisco-mib-to-fetch-cpu-and-memory-using-logstash/255445 "2020-11-15T18:45:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ajay\_Singh2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ajay_singh2/32/68920_2.png) [@Ajay\_Singh2](https://discuss.elastic.co/u/Ajay_Singh2)\
**Post date:** [November 15, 2020, 6:45pm UTC](https://discuss.elastic.co/t/use-cisco-mib-to-fetch-cpu-and-memory-using-logstash/255445/1 "2020-11-15T18:45:38Z")

</div>

I have Cisco Switches and Routers.  
I have download their CPU and memory MIB's which are in .my format.  
How can i use logstash to utilize these MIB to fetch CPU and Memory status of cisco switches and routers ?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 15, 2020, 7:57pm UTC](https://discuss.elastic.co/t/use-cisco-mib-to-fetch-cpu-and-memory-using-logstash/255445/2 "2020-11-15T19:57:22Z")

</div>

If you search the forums you will find a number of threads that talk about doing this. [This one](https://discuss.elastic.co/t/what-oids-should-i-use-when-monitoring-routers-and-switches/203293), for example.

---

<div class="post-metadata">

**Author:** ![Ajay\_Singh2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ajay_singh2/32/68920_2.png) [@Ajay\_Singh2](https://discuss.elastic.co/u/Ajay_Singh2)\
**Post date:** [November 16, 2020, 10:27am UTC](https://discuss.elastic.co/t/use-cisco-mib-to-fetch-cpu-and-memory-using-logstash/255445/3 "2020-11-16T10:27:34Z")

</div>

Hi @Badger,

Below is my configuration as per the page suggested above:

```auto
input {
  snmp {
    get => [
      "1.3.6.1.4.1.9.9.109.1.1.1.1.25"
    ]
    walk => [
      ".1.3.6.1.4.1.9.2.1.58"
    ]
    hosts => [
      { host => "udp:<cisco_switch_ip>/161" community => "xxxxx" }
    ]
        mib_paths => [
          "/etc/logstash/mib/OLD-CISCO-CPU-MIB.dic"
        ]
  }
}
output {
  stdout { codec => rubydebug }
 }

```

I am getting below error:

```auto
[2020-11-16T13:25:34,355][ERROR][logstash.inputs.snmp][main][545792a196c2078f3ed8e47c45cd1036c32d1a35f1f39e44e5cf8f0191b37d2c] error invoking walk operation on OID: 1.3.6.1.4.1.9.2.1.58, ignoring {:exception=>#<LogStash::SnmpClientError: error sending snmp walk request to target <ip>/161: Request timed out.>, :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-snmp-1.2.7/lib/logstash/inputs/snmp/base_client.rb:67:in `block in walk'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-snmp-1.2.7/lib/logstash/inputs/snmp/base_client.rb:62:in `walk'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-snmp-1.2.7/lib/logstash/inputs/snmp.rb:179:in `block in run'", "org/jruby/RubyArray.java:1809:in `each'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-snmp-1.2.7/lib/logstash/inputs/snmp.rb:177:in `block in run'", "org/jruby/RubyArray.java:1809:in `each'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-snmp-1.2.7/lib/logstash/inputs/snmp.rb:167:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:405:in `inputworker'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:396:in `block in start_input'"]}

```

---

<div class="post-metadata">

**Author:** ![fadjar340](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fadjar340/32/43610_2.png) [@fadjar340](https://discuss.elastic.co/u/fadjar340)\
**Post date:** [November 16, 2020, 12:06pm UTC](https://discuss.elastic.co/t/use-cisco-mib-to-fetch-cpu-and-memory-using-logstash/255445/4 "2020-11-16T12:06:51Z")

</div>

Seems your configuration is correct..  
Please check the connection using snmpget from logstash machine...  
Or there are some firewall rules to prevent the logstash IP to connect to the routers.  
Or just use nc to check the port

```auto
nc -vvvv -u <cisco_router_ip> 161

```

---

<div class="post-metadata">

**Author:** ![Ajay\_Singh2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ajay_singh2/32/68920_2.png) [@Ajay\_Singh2](https://discuss.elastic.co/u/Ajay_Singh2)\
**Post date:** [November 18, 2020, 11:09am UTC](https://discuss.elastic.co/t/use-cisco-mib-to-fetch-cpu-and-memory-using-logstash/255445/5 "2020-11-18T11:09:38Z")

</div>

Thank you, seems like the issue is with Cisco which is not able to process the request.

One more quick question, i had cisco .my mib and i converted it to .dic using the below command as per documentation:

```auto
smidump --level=1 -k -f python CISCO-MEMORY-POOL-MIB.my > CISCO-MEMORY-POOL-MIB.dic
#########O/P##########
CISCO-MEMORY-POOL-MIB.my:30: failed to locate MIB module `CISCO-QOS-PIB-MIB'
CISCO-MEMORY-POOL-MIB.my:32: failed to locate MIB module `CISCO-SMI'
CISCO-MEMORY-POOL-MIB.my:66: unknown object identifier label `ciscoMgmt'
smidump: module `CISCO-MEMORY-POOL-MIB.my' contains errors, expect flawed output

```

Can it also be causing the issue?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 16, 2020, 11:09am UTC](https://discuss.elastic.co/t/use-cisco-mib-to-fetch-cpu-and-memory-using-logstash/255445/6 "2020-12-16T11:09:40Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
