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
SNMPGET(1)							     Net-SNMP								SNMPGET(1)

NAME
snmpget - communicates with a network entity using SNMP GET requests SYNOPSIS
snmpget [COMMON OPTIONS] [-Cf] AGENT OID [OID]... DESCRIPTION
snmpget is an SNMP application that uses the SNMP GET request to query for information on a network entity. One or more object identifiers (OIDs) may be given as arguments on the command line. Each variable name is given in the format specified in variables(5). OPTIONS
-Cf If -Cf is not specified, some applications (snmpdelta, snmpget, snmpgetnext and snmpstatus) will try to fix errors returned by the agent that you were talking to and resend the request. The only time this is really useful is if you specified a OID that didn't exist in your request and you're using SNMPv1 which requires "all or nothing" kinds of requests. In addition to this option, snmpget takes the common options described in the snmpcmd(1) manual page. Note that snmpget REQUIRES an argu- ment specifying the agent to query and at least one OID argument, as described there. EXAMPLES
The command: snmpget -c public zeus system.sysDescr.0 will retrieve the variable system.sysDescr.0 from the host zeus using the community string public : system.sysDescr.0 = "SunOS zeus.net.cmu.edu 4.1.3_U1 1 sun4m" If the network entity has an error processing the request packet, an error packet will be returned and a message will be shown, helping to pinpoint in what way the request was malformed. If there were other variables in the request, the request will be resent without the bad variable. Here is another example. The -c and -v options are defined in the snmpcmd(1) manual page. (Note that system.sysUpTime is an incomplete OID, as it needs the .0 index appended to it): snmpget -v1 -Cf -c public localhost system.sysUpTime system.sysContact.0 This example will return the following: Error in packet Reason: (noSuchName) There is no such variable name in this MIB. This name doesn't exist: system.sysUpTime Similarly, the command: snmpget -v1 -c public localhost system.sysUpTime system.sysContact.0 Will return: Error in packet Reason: (noSuchName) There is no such variable name in this MIB. This name doesn't exist: system.sysUpTime system.sysContact.0 = STRING: root@localhost With the -Cf flag specified the application will not try to fix the PDU for you. SEE ALSO
snmpcmd(1), snmpwalk(1), variables(5). V5.6.2.1 18 Jun 2007 SNMPGET(1)
All times are GMT -4. The time now is 06:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy