# Snmp for apc (american power conversion)

**URL:** <https://discuss.elastic.co/t/snmp-for-apc-american-power-conversion/167194>\
**Category:** Logstash\
**Created:** [February 5, 2019, 9:20pm UTC](https://discuss.elastic.co/t/snmp-for-apc-american-power-conversion/167194 "2019-02-05T21:20:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [February 5, 2019, 9:20pm UTC](https://discuss.elastic.co/t/snmp-for-apc-american-power-conversion/167194/1 "2019-02-05T21:20:16Z")

</div>

Hi  
I have never work with snmp and trying to get power information from apc unit.  
after a day of digging around I found it's OID. ran snmpwalk command to grab ton of information. how do I interprete this? what is all this number means to me

Only few value make sense to me. where is high load/usage etc..

as following seems start time of the unit.  
[root@ ~]# snmpwalk -v 2c -c public \<host\_id\> 1.3.6.1.4.1.318.1.1.26.4.3.1.10  
SNMPv2-SMI::enterprises.318.1.1.26.4.3.1.10.1 = STRING: "08/09/2018 00:18:00"

Anyone has experience with it? I can't find proper guide about this anywere

---

<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:** [February 5, 2019, 9:47pm UTC](https://discuss.elastic.co/t/snmp-for-apc-american-power-conversion/167194/2 "2019-02-05T21:47:42Z")

</div>

That's not really a logstash question, now, is it?

Are you looking to ingest data using an [snmp](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-snmp.html) input? You'll need a copy of the APC MIB, which I think is [here](https://www.apc.com/us/en/tools/download/download.cfm?sw_sku=SFPMIB428&software_id=VAGL-B6UNV9&family=&part_num=&swfam=55_251&tsk=). Loading that up in a MIB browser (I used iReasoning's free Personal Edition) tells me that .1.3.6.1.4.1.318.1.1.26.4.3.1.10 is rPDU2DeviceStatusEnergyStartTime

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [February 5, 2019, 10:14pm UTC](https://discuss.elastic.co/t/snmp-for-apc-american-power-conversion/167194/3 "2019-02-05T22:14:24Z")

</div>

That is good to know.  
checking out that MIB program and MIB.

Now question is how do I read all these information in to elk and work on it?  
do I have to read one value at a time? do I need to setup trap? or just simple reading value will do. so confuse with snmp. 🙂

---

<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:** [February 5, 2019, 11:04pm UTC](https://discuss.elastic.co/t/snmp-for-apc-american-power-conversion/167194/4 "2019-02-05T23:04:45Z")

</div>

Well, it depends on your use case. A MIB contains data. Your can use a snmp input to poll the MIB and fetch values, or the device that you are monitoring may generate "traps" when those values change, or move beyond thresholds. Those would be collected using an [snmptrap](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-snmptrap.html) input.

Assuming you want to poll, you would configure the snmp input. This polls the uptime from the snmpd listening on localhost.

```
input {
    snmp {
        hosts => [{ host => "udp:127.0.0.1/161" }]
        walk => ["1.3.6.1.2.1.1.3"]
    }
}

```

This will result in a new event every 30 seconds

```
{
                                                        "@timestamp" => 2019-02-05T22:58:15.602Z,
"iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.sysUpTimeInstance" => 104401,
                                                              "host" => "127.0.0.1",
                                                          "@version" => "1"
}
{
                                                        "@timestamp" => 2019-02-05T22:58:45.604Z,
"iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.sysUpTimeInstance" => 107402,
                                                              "host" => "127.0.0.1",
                                                          "@version" => "1"
}

```

If you change that walk to

```
walk => ["1.3.6.1.2.1.1"]

```

It would fetch all of the values under that id in the MIB and the event would have about 30 fields on it. If you give it the IP address of an APC PDU then

```
walk => [".1.3.6.1.4.1.318.1.1.26.10"]

```

should get some interesting data. You will probably need to configure authentication.

Note that for events generated by the snmp input the host field is set to the host that was polled, unlike most other inputs where host is the server that logstash is running on.

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [February 6, 2019, 2:39pm UTC](https://discuss.elastic.co/t/snmp-for-apc-american-power-conversion/167194/5 "2019-02-06T14:39:05Z")

</div>

Thank you Badger,  
I already has login setup and I can poll whole subtree.  
let me work out and see what each value means, also have to figure out which field will help me.  
I have also install program that you suggesting iReasoning and MIB file.

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [February 6, 2019, 2:57pm UTC](https://discuss.elastic.co/t/snmp-for-apc-american-power-conversion/167194/6 "2019-02-06T14:57:05Z")

</div>

Got hunderds of line here is my config looks like. Now I will have to find out what all these means LOL

input {  
snmp {  
hosts =\> [{host =\> "udp:\<ip\_address\>/161" community =\> "public" version =\> "2c" }]  
#walk =\> ["1.3.6.1.2.1.1"]  
walk =\> ["1.3.6.1.4.1.318.1.1.26"]  
mib\_paths =\> ["/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-snmp-1.0.1/lib/mibs/ietf/"]  
}  
}

filter {  
}

output {  
stdout { codec =\> rubydebug }  
}

{  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedPropertiesTable.rPDU2OutletSwitchedPropertiesEntry.rPDU2OutletSwitchedPropertiesBank.4" =\> 1,  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedConfigTable.rPDU2OutletSwitchedConfigEntry.rPDU2OutletSwitchedConfigModule.27" =\> 1,  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedControlTable.rPDU2OutletSwitchedControlEntry.rPDU2OutletSwitchedControlNumber.33" =\> 33,  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Device.rPDU2DeviceConfigTable.rPDU2DeviceConfigEntry.rPDU2DeviceConfigDevicePeakPowerReset.1" =\> 1,  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedStatusTable.rPDU2OutletSwitchedStatusEntry.rPDU2OutletSwitchedStatusModule.1" =\> 1,  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedStatusTable.rPDU2OutletSwitchedStatusEntry.rPDU2OutletSwitchedStatusName.14" =\> "Outlet 14",  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedStatusTable.rPDU2OutletSwitchedStatusEntry.rPDU2OutletSwitchedStatusNumber.19" =\> 19,  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedConfigTable.rPDU2OutletSwitchedConfigEntry.rPDU2OutletSwitchedConfigNumber.40" =\> 40,  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedStatusTable.rPDU2OutletSwitchedStatusEntry.rPDU2OutletSwitchedStatusName.3" =\> "Outlet 3",  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedPropertiesTable.rPDU2OutletSwitchedPropertiesEntry.rPDU2OutletSwitchedPropertiesPhaseLayout.9" =\> 5,  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedConfigTable.rPDU2OutletSwitchedConfigEntry.rPDU2OutletSwitchedConfigNumber.36" =\> 36,  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedPropertiesTable.rPDU2OutletSwitchedPropertiesEntry.rPDU2OutletSwitchedPropertiesPhaseLayout.30" =\> 4,  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedConfigTable.rPDU2OutletSwitchedConfigEntry.rPDU2OutletSwitchedConfigRebootDuration.20" =\> 5,  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Bank.rPDU2BankStatusTable.rPDU2BankStatusEntry.rPDU2BankStatusIndex.6" =\> 6,  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Phase.rPDU2PhaseStatusTable.rPDU2PhaseStatusEntry.rPDU2PhaseStatusPeakCurrentStartTime.1" =\> "08/09/2018 00:17:46",  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedConfigTable.rPDU2OutletSwitchedConfigEntry.rPDU2OutletSwitchedConfigNumber.44" =\> 44,  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedControlTable.rPDU2OutletSwitchedControlEntry.rPDU2OutletSwitchedControlIndex.39" =\> 39,  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedStatusTable.rPDU2OutletSwitchedStatusEntry.rPDU2OutletSwitchedStatusState.43" =\> 2,  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedStatusTable.rPDU2OutletSwitchedStatusEntry.rPDU2OutletSwitchedStatusName.13" =\> "Outlet 13",  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedStatusTable.rPDU2OutletSwitchedStatusEntry.rPDU2OutletSwitchedStatusCommandPending.47" =\> 2,  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedConfigTable.rPDU2OutletSwitchedConfigEntry.rPDU2OutletSwitchedConfigNumber.31" =\> 31,  
"iso.org.dod.internet.private.enterprises.apc.products.hardware.rPDU2.rPDU2Outlet.rPDU2OutletSwitched.rPDU2OutletSwitchedConfigTable.rPDU2OutletSwitchedConfigEntry.rPDU2OutletSwitchedConfigName.15" =\> "Outlet 15",  
,

---

<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:** [March 6, 2019, 2:57pm UTC](https://discuss.elastic.co/t/snmp-for-apc-american-power-conversion/167194/7 "2019-03-06T14:57:16Z")

</div>

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