Sponsored Content
Special Forums IP Networking SNMP OID for Network Utilization measurement Post 302604404 by franzramadhan on Monday 5th of March 2012 01:28:10 AM
Old 03-05-2012
SNMP OID for Network Utilization measurement

Hi everyone,

I've just copied a snmpget script from somewhere. This script is basically used to collect basic router information. Ex: syscontact,syslocation,etc. And I want to extend the script to be able to collect some network information and utilization of some machines ex: bandwith usage, throughput, jitter, latency, routing tables,vlan id, and many other running configuration on the machines.
Here is the script,

Code:
#!/usr/bin/perl
#
#    inventory.pl -- a script to extract valuable information
#                    from a Router.  (Name, Location, Contact, S/N)
#
#
# Set behavior
$workingdir = "/home/nms";
$snmpro     = "snmpisat";
$rtrlist    = "$workingdir/RTR_LIST";

#
#
open( RTR, "$rtrlist" )            || die "Can't open $rtrlist file";
open( LOG, ">$workingdir/RESULT" ) || die "Can't open $workingdir/RESULT file";
printf "  Router\t\t Location\t\t\tContact\t\t  Serial\n";
printf LOG "  Router\t\t; Location\t\t\t;Contact\t\t  ;Serial\n";
while (<RTR>) {
    chomp( $rtr = "$_" );
    $snmpget = "/usr/local/bin/snmpget -v1 c $snmpro $rtr ";
    $rtr     = " $snmpget .1.3.6.1.4.1.9.2.1.3.0 ";
    $loc     = " $snmpget .1.3.6.1.2.1.1.6.0 ";
    $con     = " $snmpget .1.3.6.1.2.1.1.4.0";
    $sin     = " $snmpget .1.3.6.1.4.1.9.3.6.3.0";
    $ifdesc  = " $snmpget .1.3.6.1.4.1.9.3.6.3.0 ";
    
    chomp( ( $foo, $RTR )    = split( /"/,  $rtr ) );
    chomp( ( $foo, $LOC )    = split( /= /, $loc ) );
    chomp( ( $foo, $CON )    = split( /= /, $con ) );
    chomp( ( $foo, $SIN )    = split( /"/,  $sin ) );
    chomp( ( $foo, $IFDESC ) = split( /"/,  $ifdesc ) );
    printf( "%-12.12s  %-30.30s  %-25.25s  %-12.12s\n", $RTR, $LOC, $CON, $SIN );
    printf LOG ( "%-12.12s; %-30.30s; %-25.25s; %-12.12s\n", $RTR, $LOC, $CON, $SIN );
}

My question is, does anybody know what oid's I have to added on??

Last edited by franzramadhan; 03-05-2012 at 10:39 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Server NIC/network utilization

Hi, as topic. We have 2 NIC in the server. How can I check the utilization/network load for each individual NIC? using netstat seems not showing any percentage. Is there any command which is able to do so? Thx! (3 Replies)
Discussion started by: *Jess*
3 Replies

2. Solaris

current CPU usage, memory usage, disk I/O oid(snmp)

Hi, I want to monitor the current cpu usage, monitor usage , disk I/o and network utlization for solaris using SNMP. I want the oids for above tasks. can you please tell me that Thank you (2 Replies)
Discussion started by: S_venkatesh
2 Replies

3. Infrastructure Monitoring

SNMP OID for System Status LED's

I am trying to locate the proper MIB and OID location, to determine if the system attention light is on IBM-702x servers running 5.x. Currently, we get this on our Blade Centers Management Modules at location: 1.3.6.1.4.1.2.3.51.2.2.8.2.1.1.7.xx were xx is the actual Blade number. A value of 1... (0 Replies)
Discussion started by: stamfdf
0 Replies

4. Infrastructure Monitoring

Solaris 10 Snmp command to MiB OID

Hi guys, I am doing follow this guy Tech deposits. : iostat monitoring for zenoss and such I stuck at this step: Add a line into /etc/snmp/snmpd.conf file: pass .1.3.6.1.4.1.2021.255.1 /usr/local/bin/sar_iostat_snmp.sh -m 1 -d dev253 -o .1.3.6.1.4.1.2021.255.1 and test snmp by the... (1 Reply)
Discussion started by: tien86
1 Replies

5. UNIX for Advanced & Expert Users

Monitor % utilization of the network card

Hello, How to we typically monitor the % of utilization of network cards on a Unix box,basically the % utilization of the bytes transfered of the network card. This is required on all the flavours of OS - HP, AIX, RHEL, Sun etc. Please let me know. Thanks. (1 Reply)
Discussion started by: devtakh
1 Replies

6. Solaris

Sysedge SNMP OID

I'll preface this by saying I'm just a novice, with just basic knowledge of shell scripting, as well as basic knowledge in SNMP. I working on a script that takes the motd file on a solaris 5.x box and parses the information out into an OID to be passed to the SNMP server. We're using SysEDGE client... (0 Replies)
Discussion started by: jsoper1
0 Replies

7. IP Networking

OID for Bandwith and Throughput Measurement

Hey Guys, Does anybody know, which OID's of Net-SNMP is used to collect throughput and bandwith usage of machine?? I got these OID's ..iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifOutOctets ..1.3.6.1.2.1.2.2.1.16 ... (1 Reply)
Discussion started by: franzramadhan
1 Replies

8. UNIX for Dummies Questions & Answers

Cacti SNMP Generic OID template, NaN problem

Hello All, I have installed cacti and I have Nan values on created graph. I really appreciate any help. I have done the following: 1. Linux Ubuntu 12.04.2 LTS 64 bits 2. apt-get install cacti // the cacti Version 0.8.7i was installed 3. Accessed "http://MyIP/cacti/index.php" 4. Set SNMP... (0 Replies)
Discussion started by: AndreiM
0 Replies

9. UNIX for Dummies Questions & Answers

Need to transfer all kernel logs (var/log/messages) to the snmp listener as snmp trap

i am working with embedded system -Dell DCS management sub system. my question is as below: currently we are using linux kernel 2.6.30 build and we have a kernel logs stored to the /var/log/messages path. now we have to transfer all this logs to the specified SNMP target as a part of SNMP... (4 Replies)
Discussion started by: vipul_prajapati
4 Replies

10. Red Hat

CPU Utilization and Memory Utilization of Services and Applications

Hi, i am new to linux/RHEL 6.0 and i have two questions. 1) How to get the CPU utilization and Memory Utilization of all Services running currently? 2) How to get the CPU utilization and Memory Utilization of all Applications running currently? Please help me to find the script. ... (2 Replies)
Discussion started by: nossam
2 Replies
SNMPGETNEXT(1)							     Net-SNMP							    SNMPGETNEXT(1)

NAME
snmpgetnext - communicates with a network entity using SNMP GETNEXT requests SYNOPSIS
snmpgetnext [COMMON OPTIONS] [-Cf] OID [OID]... DESCRIPTION
snmpget is an SNMP application that uses the SNMP GETNEXT request to query for information on a network entity. One or more object identi- fiers (OIDs) may be given as arguments on the command line. Each variable name is given in the format specified in variables(5). For each one, the variable that is lexicographically "next" in the remote entity's MIB will be returned. For example: snmpgetnext -c public zeus interfaces.ifTable.ifEntry.ifType.1 will retrieve the variable interfaces.ifTable.ifEntry.ifType.2: interfaces.ifTable.ifEntry.ifType.2 = softwareLoopback(24) If the network entity has an error processing the request packet, an error message will be shown, helping to pinpoint in what way the request was malformed. OPTIONS
snmpgetnext takes the common options described in the snmpcmd(1) manual page and also the -Cf option described in the snmpget(1) manual page. SEE ALSO
snmpcmd(1), snmpget(1), variables(5). 4th Berkeley Distribution 08 Feb 2002 SNMPGETNEXT(1)
All times are GMT -4. The time now is 02:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy