How SNMP Interface Statistics Works

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
gasperazzo
Posts: 29
Joined: Wed Oct 08, 2008 11:51 am

How SNMP Interface Statistics Works

Post by gasperazzo »

Hello all,

We know that the OIDs (ifinoctets and ifoutoctets) don't represent a traffic information with only one value. We need two values to determine the traffic across a period of time.

I want to know how SNMP Interface Statistic are implemented. How the data querie gets the two values to determine the traffic issues.

If anyone have an idea or tell me what script is used from cacti to get that values from devices i'll appreciate.

Sorry for my precious english. :)
gasperazzo
Posts: 29
Joined: Wed Oct 08, 2008 11:51 am

Post by gasperazzo »

I have this questions because I have some interfaces from one Switch Core monitoring in Cacti.

In a beautiful day one of this interfaces gone working at 100% until one day. When I look the graphic at Cacti I saw that the 100% utilization are not graphed. The utilization still in 40 to 50%.

RRAs configuration:

Name Steps Rows Timespan**
Class 3 Minutes - Hourly (3 minutes average) 1 28800 7204
Class 3 Minute - Daily (6 minute average) 2 43200 86404
Class 3 Minute - Weekly (30 minute average) 10 17520 2419204
Class 3 Minute - Monthly (12 hour average) 240 1460 15552004
Class 3 Minute - Yearly (24 hour average) 480 1095 63072004
User avatar
lcano
Cacti User
Posts: 190
Joined: Thu Oct 09, 2008 5:46 pm
Location: Spain

Post by lcano »

That vbles are counters in the device, which are incremented with any packet across the interfaz (in or out). Cacti issues a snmp query to that counters (The OID that represents that interfaz), and gets the difference between both in that period of time. This way, only knowing how many seconds are there in that period of time, you know the traffic across the interface in bits per second, which is what cacti print in the graphs.

Basic example: (lets say we are polling the device each 5 min = 5*60=300 sec)

Time 1: Counter = 0 bytes
Time 2: Counter = 300 bytes -> 300*8=2400 bits

That means that interface in that period of time had (2400-0)/300 bits/sec, so cacti should print in your graph 2400/300 = 8 bits/sec
gasperazzo
Posts: 29
Joined: Wed Oct 08, 2008 11:51 am

Post by gasperazzo »

Icano,

Thans for reply. I want to know what is this period of time.

For example:

If the Snmp Interface Statistics queries the device and get the TIME1, wait for 1 sec (sleep 1) and get the TIME2. Thus the script will able to calculate the traffic. Alright?

But if the script get TIME1, store this value, wait for polling interval (5 minutes) and get TIME2 to calculate the traffic, like (TIME2-TIME1)/300(secs). I think that result aren't good because in 5 minutes we can get high values of traffic or low values. Do you agree?

Thanks
User avatar
lcano
Cacti User
Posts: 190
Joined: Thu Oct 09, 2008 5:46 pm
Location: Spain

Post by lcano »

Hi gasperazzo,

polling time is, if i'm not wrong, configurable. I'm running cacti with cmd.php, so it's working like a cron job:

Code: Select all

*/5 * * * * www-data /usr/share/cacti/site/poller.php >/dev/null 2>/var/log/cacti/poller-error.log
So you can configure the interval between pollings.

I did't change to cactid/spine yet, so I don't know how you can change if you use any of them. :wink:

Regarding you comment about loosing information between pollings, of course you will lose information about peaks (high or low). If you want to be more accurate, just reduce that interval. But you will ALWAYS lose peaks. If you configure 1 sec..., what happens with peaks inside that second? :wink:
hamish
Posts: 29
Joined: Tue Aug 05, 2008 7:40 am
Location: London

Post by hamish »

Are your interfaces Gb? If so, make sure you're collecting 65bit counters, and not the default. Otherwise when the load gets too high, they wrap before you can poll them again.

H
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests