Community discussions

MikroTik App
 
dknuckles
just joined
Topic Author
Posts: 11
Joined: Sun Dec 02, 2012 1:07 am

How to make sense of "Bytes Out" OID

Tue Oct 29, 2013 4:18 pm

I'm trying to monitor my MikroTik with Icinga (A nagios fork for those who don't know). I know that The Dude is the go-to for MikroTik monitoring, but I don't want to maintain 3 or 4 monitoring services (vCenter for vsphere, Icinga for servers / hardware, the Dude for MikroTik, etc).

I've been looking into reading the OID's from the output of an SNMP command from Icinga and have NO idea how to make any sense of it or how I can guage what's worth noting as a warning and as critical.

The command I've been running for testing is
/usr/lib/nagios/plugins/check_snmp -H 10.0.0.1 -C public -o .1.3.6.1.2.1.2.2.1.10.599
The output is as follows: iso.3.6.1.2.1.2.2.1.10.599=3263003375c

My assumption means that 3263003375 (ignoring the c, which I'm not sure why that's there) is the number of bytes crossing the wire. Dividing that number by 1024 should therefore produce the MB crossing the wire however I definitely don't have 3186526 MB running over my ether13.

Can someone point me in the correct direction? Where am I going wrong here?
 
User avatar
skot
Long time Member
Long time Member
Posts: 584
Joined: Wed Nov 30, 2011 3:05 am

Re: How to make sense of "Bytes Out" OID

Tue Oct 29, 2013 5:36 pm

Assuming 3263003375 is bytes, dividing by 1024 gives you kilobytes, and dividing again by 1024 gives you megabytes = 3111.84 MB / 1024 = 3.03 GB
 
dknuckles
just joined
Topic Author
Posts: 11
Joined: Sun Dec 02, 2012 1:07 am

Re: How to make sense of "Bytes Out" OID

Tue Oct 29, 2013 5:56 pm

I think I'm seeing where my error might be. I was assuming that the byte's in / out were the realtime Tx / Rx (which is what I was hoping to monitor).

With that said does anyone know if this is possible? I would like to monitor traffic going over the wire so if it reaches a certain threshold i get a warning or critical notification?

If I print oid in the interfaces section I get

- name
- mtu
- mac-address
- admin-status
- oper-status
- bytes-in
- packets-in
- discards-in
- errors-in
- bytes-out
- packets-out
- discards-out
- errors-out
 
usdmatt
Frequent Visitor
Frequent Visitor
Posts: 52
Joined: Tue Oct 29, 2013 6:18 pm

Re: How to make sense of "Bytes Out" OID

Tue Oct 29, 2013 6:42 pm

The ifInOctets, ifOutOctets (Octets = bytes) SNMP values are counters that will continue to rise while the interface is up.

What usually happens is that you read the value every few minutes (5 is common), then use the difference between the current value and the last reading to see the average transfer rate over the past 5 minutes.

For example, if the reading is 1GB higher than is was 5 minutes ago, then that interface has been doing an average of ~27Mbps over that period.

Of course this gets complicated when you realise that the counters are quite often 32bit (~4GB) and will cycle back round to 0 when they hit the limit. Also a reset of the interface or device will also reset the counter. These things have to be considered when you try and report based on these counters.

There's generally no such thing as 'real-time' monitoring. All you can do is take multiple reading at a small an interval as you dare, and see what was used between them.