Page 1 of 2

show traffic rate in packet per second

Posted: Thu Jan 29, 2015 4:02 pm
by lisashan
is there a way to monitor interface traffic in pps(packet per second)?

for example, i am monitoring a cisco router

i tried using network switch/router wizard, it can only return me the traffic rate in bps/Bps

i also tried snmp wizard, however, it cannot automatically calculate the traffic rate, but returning me the total packet number it collected from OID.

could anyone help me out of here? i am open to any possible solution.

Thanks in advance,
Lisa

Re: show traffic rate in packet per second

Posted: Thu Jan 29, 2015 4:37 pm
by slansing
Do you have a specific OID which gives you that information? If so you could run the SNMP wizard against it to grab the table's query response in an integer. Your manual should have a list of OIDs, or Cisco would have them listed.

Re: show traffic rate in packet per second

Posted: Thu Jan 29, 2015 5:26 pm
by lisashan
slansing wrote:Do you have a specific OID which gives you that information? If so you could run the SNMP wizard against it to grab the table's query response in an integer. Your manual should have a list of OIDs, or Cisco would have them listed.

right now, i am using OID: IF-MIB::ifInUcastPkts.4 = Counter32: 704774682

which implies the totall income packet from interface 4

but what i am looking for is the rate, not the total number.

the way i can think of to get the rate is using (Counter32 - Counter32_1_min_ago)/60

but i dont know how to do thsi on nagios.

Thanks,
Lisa

Re: show traffic rate in packet per second

Posted: Thu Jan 29, 2015 5:48 pm
by scottwilkerson
We don't have that built-in, but you could write your own custom plugin that saves the previous amounts and does the math, and add it to Nagios XI.
https://nagios-plugins.org/doc/guidelines.html
http://assets.nagios.com/downloads/nagi ... ios_XI.pdf

If you would like a plugin created, please contact [email protected] for a quote.

Re: show traffic rate in packet per second

Posted: Mon Feb 02, 2015 9:51 am
by lisashan
scottwilkerson wrote:We don't have that built-in, but you could write your own custom plugin that saves the previous amounts and does the math, and add it to Nagios XI.
https://nagios-plugins.org/doc/guidelines.html
http://assets.nagios.com/downloads/nagi ... ios_XI.pdf

If you would like a plugin created, please contact [email protected] for a quote.

Thanks for your update, plugin should be a good idea.

i am also thinking of making a plugin/script like check_load for NRDP/NRDS, which can help me send data from my NRDS(like a linux computer) to NRDP every specific period. Is there any documenation about this? what the outpout data format should look like(can be accepted by NRDP)?

Thanks,
lisa

Re: show traffic rate in packet per second

Posted: Mon Feb 02, 2015 11:41 am
by slansing
You can actually use the exact same plugins you would use with NRPE, or any other method. The difference here is that NRDS actually executes them on a cron, and then sends the data up to XI. You would want to follow these guidelines:

https://nagios-plugins.org/doc/guidelines.html#AEN200

Re: show traffic rate in packet per second

Posted: Mon Feb 02, 2015 3:25 pm
by lisashan
slansing wrote:You can actually use the exact same plugins you would use with NRPE, or any other method. The difference here is that NRDS actually executes them on a cron, and then sends the data up to XI. You would want to follow these guidelines:

https://nagios-plugins.org/doc/guidelines.html#AEN200
Hi,

thanks for your reply,

ok let me go througt this problem:

i am able to add my plug/script in by adding python script under /usr/local/nagios/libexec + adding command + adding service, and now if i go to service status, i can see the service i added under localhost.

However, if i go to graph explorer, i select localhost, i cannot find the service i just added. which means i can not plot the service/plugin.

could you kindly give me some advice? the ultimate purpose is to plot, not just give me some word.

Thanks,
Lisa

Re: show traffic rate in packet per second

Posted: Mon Feb 02, 2015 5:30 pm
by abrist
Are you reporting performance data? What is a sample output of the check?

Re: show traffic rate in packet per second

Posted: Tue Feb 03, 2015 10:38 am
by lisashan
abrist wrote:Are you reporting performance data? What is a sample output of the check?
the output of my script/plugin in as follow:

TRAFFIC RATE OK: is 296.0 pps

this is shown on service status page as:

A-interface Ok 19h 19m 1s 1/5 2015-02-03 10:36:59 TRAFFIC RATE OK: is 291.0 pps

how do i make 296.0 recognized by your graph function?

Thanks,
Lisa

Re: show traffic rate in packet per second

Posted: Tue Feb 03, 2015 11:12 am
by scottwilkerson
Make your plugin outout this

Code: Select all

A-interface Ok 19h 19m 1s 1/5 2015-02-03 10:36:59 TRAFFIC RATE OK: is 291.0 pps|'packets'=291.0pps
adding
|'packets'=291.0pps

As per
https://nagios-plugins.org/doc/guidelines.html#AEN200