Monitoring the traffic on hourly basis

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
seenutn
Posts: 2
Joined: Thu Nov 27, 2014 3:40 am

Monitoring the traffic on hourly basis

Post by seenutn »

Hi All,
I am using nagios 3.5.1 on centos 7 and it is working for most of my use cases.

I am able to plot the network usage of an interface in my router using check_snmp plugin. The In/Out octets are collected from router every 2 secs and nagiosgraph is generating the plot. Now my question is how can I calculate the "Bytes Used" using this data? I want to see the bytes used in last hour, last day, last mon, etc.. (Any example configuration is helpful).

Regards,
Seenu.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Monitoring the traffic on hourly basis

Post by jdalrymple »

Are you looking for something like this?

http://www.linuxhacker.at/opensource-pr ... -iftraffic
Total RX Bytes: 102752022.00 B, Total TX Bytes: 244384944.00 B<br>Average
Traffic: 1020.87 B/s (0.0%) in, 967.92 B/s (0.0%) out|inUsage=0.0%;85;100;;
outUsage=0.0%;85;100;; inAbsolut=99581192B;114085069;134217728;;
outAbsolut=241378570B;114085069;134217728;;
seenutn
Posts: 2
Joined: Thu Nov 27, 2014 3:40 am

Re: Monitoring the traffic on hourly basis

Post by seenutn »

Hi,
My requirement is to store the result (offcourse, after calculation) in nagios.

Say, at T1, Tx = 1000 Rx = 500
at T2 (T1 + 5sec), Tx = 1400, Rx = 900
at T3 (T2 + 5s), Tx = 2000, Rx = 1700
.
.
Now I want to store time as well as Tx,Rx (T1, 1000, 500 - T2, 400, 400 - T3, 600, 800 - ...) Nagios already stores this (I am using check_snmp plugin), but how can I tell how many bytes were Rx/Tx in last 10 sec or last 1 hour or so on. (I guess I want some means to retrieve the data stored in nagios, do computation, and store it back).

Regards,
Seenu.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Monitoring the traffic on hourly basis

Post by tmcdonald »

I don't think the plugin posted will work since there does not appear to be any option for specifying a time range. I hate to say it but this sounds like a use case that will require a custom plugin. It will need to know the RRD settings in order to determine how many entries are made in an hour, and then use that to properly calculate usage over time.
Former Nagios employee
Locked