KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Cisco Router Bandwidth

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
samplejs



Joined: 30 Apr 2002
Posts: 7
Location: samplejs

PostPosted: Wed Jan 07, 2004 11:28 am    Post subject: Cisco Router Bandwidth Reply with quote

I have read all of the other posts about using SNMP tests for Cisco routers and have almost everything I need.

I am still stuck on trying to figure out how to get a view of Bytes/Sec from the router though. The only OID's I see are for Packets in and out and Octets in and out. Am I just missing a simple conversion or is there some other OID's that my walk is not showing.

Thanks,
James
Back to top
View user's profile Send private message Send e-mail Visit poster's website
timn



Joined: 20 Nov 2003
Posts: 183
Location: United States

PostPosted: Wed Jan 07, 2004 3:40 pm    Post subject: Reply with quote

While we use AHM to monitor router basics (interface up?, errors?), we use MRTG for monitoring bandwidth utilization on both Cisco routers and Cisco PIX.

I believe MRTG is retrieving "octets in, octets out" from each interface, then calculating bandwidth rates base on these values.

MRTG is a bit of a standard and generates nice graphs. While written for UNIX boxes there is a Windows version that works great. Tobias provides a huge number of links to help resources.

We're a fairly small company but we recently implemented dual DS3 lines w/BGP from separate ISPs (i.e. multi-homed). Since true 'load balancing' is not directly supported in BGP, we configure our primary gateway router to perform outbound 'load sharing' - based on source network address(i.e. using route maps). This is a bit of a pain because you first have to figure out how to divide outbound packets 'evenly'. The short of this is that MRTG is great at letting us know when we've gotten our 'formula' right.

Oh, and it's free.
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12454
Location: USA

PostPosted: Wed Jan 07, 2004 4:37 pm    Post subject: Reply with quote

SNMP test has "increases /sec" option. If you set this option for "octets in" parameter, HostMonitor will display incoming traffic (octents / sec). You can use the same option for "octets out" counter.
Unfortunatelly HostMonitor cannot display sum of 2 different counters (octets in + octets out).

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
timn



Joined: 20 Nov 2003
Posts: 183
Location: United States

PostPosted: Wed Jan 07, 2004 5:27 pm    Post subject: Reply with quote

I've thought it might be nice if I could duplicate a small bit of the MRTG functionality in AHM. For example:

Code:

Max  In: 2462.8 kb/s (5.6%)   Average  In: 325.2 kb/s (0.7%)   Current  In: 1174.2 kb/s (2.7%) 
Max  Out: 3825.2 kb/s (8.7%)   Average  Out: 1796.2 kb/s (4.1%)   Current  Out: 2467.7 kb/s (5.6%) 


Then alert if bandwidth approached, say 90% of maximum possible utilization. Trouble is, I'm not sure just exactly what I'd do to fix it (if this was the result of legitimate traffic). My supervisor might not be to happy if I told him "our routers are too busy, I'm going to shut them off for an hour or two..."

Might be useful for detecting dDOS attacks but then again, in either case, so many other things would be going wrong, I'd have a hard time missing it.

I would think that it would be possible to write a fairly simply piece of software that allowed you to 'glue' MRTG output to AHM for the purpose of alerting when bandwidth (or anything monitored by MRTG - over 5 minute average) exceeds a desired value. The cleanest way might be to access the MRTG .log files directly with a script.
Back to top
View user's profile Send private message
samplejs



Joined: 30 Apr 2002
Posts: 7
Location: samplejs

PostPosted: Thu Jan 08, 2004 5:35 am    Post subject: Reply with quote

Alex:

Octets in and octets out per second would be just fine... I can add the two together using a SQL query, since I am logging to a SQL server. But is there a way to convert from Octets to Bytes so that my report is in Bytes or KBytes per seconds?

Once I figure out that conversion it would be easy to write a SQL query to give me the same info that MRTG is providing.

Timn: Thanks for the Info I had looked at MRTG in the past but since I thought it only graphed the data. All I want are average and peak usage for a defined period of time. For example I have a frame circuit that shows 30% average usage, but if you shorten the time period to Business hours only, it jumps to 82%.

Thanks,
James
Back to top
View user's profile Send private message Send e-mail Visit poster's website
iis5_rulez



Joined: 17 Dec 2002
Posts: 32

PostPosted: Thu Jan 08, 2004 10:17 am    Post subject: Reply with quote

i believe an octet is 3 bits. byte is 8. u can do the math ^^
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12454
Location: USA

PostPosted: Thu Jan 08, 2004 9:32 pm    Post subject: Reply with quote

Actually octet is 8 bits == byte.

http://community.roxen.com/developers/idocs/rfc/rfc1392.html
Quote:

octet
An octet is 8 bits. This term is used in networking, rather than
byte, because some systems have bytes that are not 8 bits long.


Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
KS-Soft



Joined: 03 Apr 2002
Posts: 12454
Location: USA

PostPosted: Thu Jan 08, 2004 9:38 pm    Post subject: Reply with quote

Timm,

Quote:
I would think that it would be possible to write a fairly simply piece of software that allowed you to 'glue' MRTG output to AHM for the purpose of alerting when bandwidth (or anything monitored by MRTG - over 5 minute average) exceeds a desired value. The cleanest way might be to access the MRTG .log files directly with a script.


Or probably better implement (in HM) some script language that will be able to retrive SNMP counters and perform simple operations: +, -, *, /
?

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
iis5_rulez



Joined: 17 Dec 2002
Posts: 32

PostPosted: Mon Jan 12, 2004 8:22 am    Post subject: Reply with quote

KS-Soft wrote:
Actually octet is 8 bits == byte.

http://community.roxen.com/developers/idocs/rfc/rfc1392.html
Quote:

octet
An octet is 8 bits. This term is used in networking, rather than
byte, because some systems have bytes that are not 8 bits long.


Regards
Alex


lol yeah that makes sense... guess i was confused by octal maths (opposed to hexadecimal or binary)
Back to top
View user's profile Send private message
samplejs



Joined: 30 Apr 2002
Posts: 7
Location: samplejs

PostPosted: Mon Jan 12, 2004 2:47 pm    Post subject: Reply with quote

Thank you so much for the help...It will be easy now to write the SQL queries to give me the info I need.

James
Back to top
View user's profile Send private message Send e-mail Visit poster's website
timn



Joined: 20 Nov 2003
Posts: 183
Location: United States

PostPosted: Fri Jan 16, 2004 9:10 am    Post subject: Reply with quote

James:

Interesting. Are you saying you will accomplish this by having HM log the replies to a DB, then query the db to determin bandwidth?

I would be interested in how that turns out.

I've used the same approach to display the total number of users on a web farm.
Back to top
View user's profile Send private message
timn



Joined: 20 Nov 2003
Posts: 183
Location: United States

PostPosted: Fri Jan 16, 2004 11:47 am    Post subject: Reply with quote

(cross posted from thread "Monitoring PIX interfaces using SNMP")

Looks like I may be wrong WITH RESPECT TO CISCO ROUTERS on both the Interface and CPU utilization issue. I've just discovered:

OID_Variable Type Value

1.3.6.1.4.1.9.2.1.56.0 busyPer INTEGER

- CPU busy percentage in the last 5 second period. Not the last 5 realtime seconds but the last 5 second period in the scheduler.


1.3.6.1.4.1.9.2.1.57.0 avgBusy1 INTEGER

- 1 minute exponentially-decayed moving average of the CPU busy percentage.

1.3.6.1.4.1.9.2.1.58.0 avgBusy5 INTEGER

- 5 minute exponentially-decayed moving average of the CPU busy percentage.


For bits/sec see:

OID Variable Type Value
1.3.6.1.4.1.9.2.2.1.1.8.1 locIfOutBitsSec INTEGER
1.3.6.1.4.1.9.2.2.1.1.8.2 locIfOutBitsSec INTEGER
.... (increments with each interface)

OID Variable Type Value
1.3.6.1.4.1.9.2.2.1.1.6.1 locIfInBitsSec INTEGER
1.3.6.1.4.1.9.2.2.1.1.6.2 locIfInBitsSec INTEGER
.... (increments with each interface)

Described as:

Five minute exponentially-decayed moving
average of input bits per second.
Back to top
View user's profile Send private message
Jax



Joined: 12 Jan 2004
Posts: 13

PostPosted: Sun Jan 18, 2004 7:05 pm    Post subject: Reply with quote

I use a script launched from HM to check the bandwidth on interfaces, this works for Cisco,Novell,Windows,Unix systems.

There is certain small issues with the Scripts that Alex is looking at but it does work.


const statusAlive = "Host is alive:"
const statusDead = "No answer:"
const statusUnknown = "Unknown:"
const statusNotResolved = "Unknown host:"
const statusOk = "Ok:"
const statusBad = "Bad:"
const statusBadContents = "Bad contents:"

' Checks the bandwidth used on an interface via SNMP
' The hostname or IP must be added in CommentLine1 of the test
' The oid must be added in CommentLine2 of the test
' Sample oid for IN Bytes on Interface 1 oid = ".1.3.6.1.2.1.2.2.1.10.1"
' Sample oid for OUT Bytes on Interface 1 oid = ".1.3.6.1.2.1.2.2.1.16.1"
' The sample period is about 2 seconds, the longer the more accurate

' Due to some misfunctionality that will be fixed in the future were we cant use WScript.sleep
' for the delay and instead we call and exteral VB script (delay.vbs) for the delay
' delay.vbs only contains one line "Wscript.sleep(2000)"


FUNCTION PerformTest()

target = "%CommentLine1%"
community = "public"
oid = "%CommentLine2%"
prog = "snmpget.exe"

snmpcmd = prog & " " & target & " " & community & " " & oid

'Get first value of counter
Set WshShell = CreateObject("WScript.Shell")
set oExec = WshShell.Exec(snmpcmd)
sStdout1 = oExec.StdOut.ReadAll

' Start to count the elapsed time
StartTime = Timer

'call external delay 2 sec
Set WshShell = CreateObject("WScript.Shell")
set oExec = WshShell.Exec("cscript.exe c:\progra~1\hostmonitor4\scripts\Delay.vbs")
Dummy = oExec.StdOut.ReadAll

'Get second value of counter
Set WshShell = CreateObject("WScript.Shell")
set oExec = WshShell.Exec(snmpcmd)
sStdout2 = oExec.StdOut.ReadAll

'Get the elasped time
EndTime = Timer
ElapsedTime = EndTime - StartTime

' Check if the 32 Bit counter cycled and if so we fix it to a wrong value but not a negative value
If sStdout1 > sStdout2 then
sStdout1 = 1
End If

' Calculate the Bandwidth in KBytes/Sec
TrfRate = cStr(Round(((sStdout2 - sStdout1)/ElapsedTime/1000),2)) & " Kb/Sec"
status = statusOk

'Return the Bandwidth
PerformTest = status+TrfRate 'return the Status and Value to HM

END FUNCTION
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index