Snmp for apc (american power conversion)

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

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

Are you looking to ingest data using an snmp input? You'll need a copy of the APC MIB, which I think is here. 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

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. :slight_smile:

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 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.

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.

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",
,

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