Combine 2 SNMP Service Checks into a graph & calculation

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
perric
Posts: 161
Joined: Fri Mar 28, 2014 10:37 am

Combine 2 SNMP Service Checks into a graph & calculation

Post by perric »

I searched and found this post... "Aggregate / consolidated graph of many links".

This looks exactly like what I need. I have a service that collects SNMP ifinoctets from a Cisco router's ethernet interface. And a service that also collects ifoutoctets. This provides inbound and outbound bandwidth values for each port, but I have been asked to consolidate this to one graph under reports and change the graph to show utilization as a percentage of the link size. So, I need to divide the value by the link size.

While the post mentioned above was helpful, there was a recommended solution proposed. Can I have assistance with how to do the recommended solution with variables, etc.? I have no problem modifying scripts, etc., but I am just not should how to begin.

David
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Combine 2 SNMP Service Checks into a graph & calculation

Post by Box293 »

perric wrote:I have a service that collects SNMP ifinoctets from a Cisco router's ethernet interface. And a service that also collects ifoutoctets. This provides inbound and outbound bandwidth values for each port, but I have been asked to consolidate this to one graph under reports and change the graph to show utilization as a percentage of the link size.
What plugin are you using for this and can you post a service definition of two of the ports please?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
perric
Posts: 161
Joined: Fri Mar 28, 2014 10:37 am

Re: Combine 2 SNMP Service Checks into a graph & calculation

Post by perric »

Hello,

I use the check_snmp command with "-C xxxxxx -o .1.3.6.1.2.1.2.2.1.10.15" as a value for Inbound bandwidth and "-C xxxxxx-o .1.3.6.1.2.1.2.2.1.16.15" as a value for Outbound Bandwidth.

My hope was to see both values (inbound and outbound) with the calculation (dividing value by link size) on one "Performance graph" under Views, Service Details.

Thanks.

David
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Combine 2 SNMP Service Checks into a graph & calculation

Post by BanditBBS »

You could always write a wrapper script to run the two commands, grab the data and then output as you desire.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
perric
Posts: 161
Joined: Fri Mar 28, 2014 10:37 am

Re: Combine 2 SNMP Service Checks into a graph & calculation

Post by perric »

Would you have an example script that would work?

David
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Combine 2 SNMP Service Checks into a graph & calculation

Post by BanditBBS »

No, but I could probably throw something together super quick. Show me the example output from the two checks please.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Combine 2 SNMP Service Checks into a graph & calculation

Post by tmcdonald »

Thanks Bandit!
Former Nagios employee
perric
Posts: 161
Joined: Fri Mar 28, 2014 10:37 am

Re: Combine 2 SNMP Service Checks into a graph & calculation

Post by perric »

Sure. Do you mean the graphed output? If so, see inline below.
Inbound.png
Outbound.png
David
You do not have the required permissions to view the files attached to this post.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Combine 2 SNMP Service Checks into a graph & calculation

Post by BanditBBS »

I actually meant the output on the command line so I can know what I have to parse out. Get me that information and I'll work on the script tomorrow as I am out of office today on a personal day.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
perric
Posts: 161
Joined: Fri Mar 28, 2014 10:37 am

Re: Combine 2 SNMP Service Checks into a graph & calculation

Post by perric »

Sorry. Do you mean this?

Inbound:

[root@cawlkl21 libexec]# ./check_snmp 10.197.0.11 -C public -o 1.3.6.1.2.1.2.2.1.10.15
SNMP OK - 3788642629 | iso.3.6.1.2.1.2.2.1.10.15=3788642629c

Outbound:

[root@call1 libexec]# ./check_snmp 10.197.0.11 -C public -o 1.3.6.1.2.1.2.2.1.16.15
SNMP OK - 4243923118 | iso.3.6.1.2.1.2.2.1.16.15=4243923118c
[root@call1 libexec]#

David
Locked