Sponsored Content
Full Discussion: trouble with snmpwalk script
Top Forums UNIX for Dummies Questions & Answers trouble with snmpwalk script Post 302529818 by chancho on Friday 10th of June 2011 02:19:48 PM
Old 06-10-2011
trouble with snmpwalk script

I am using a line of code that I borrowed from someone else's script, in a script to monitor changes in my local network. It works but it takes too long to pick up the changes.
Code:
 snmpwalk -v 2c -c PASSWORD -Oq 10.0.1.1 RFC1213-MIB::atPhysAddress

The snmp server is my apple router. If I monitor the network from Airport utility (Apple's software, GUI) The changes are shown almost immediately. (devices connecting and disconnecting)
I thought it may have to do with the DHCP leases. I have that set to renew every 12 hrs, but it doesn't take nearly that long. (sometimes 30 secs , sometimes 1 hr)
other than that the script is doing everything that I want. Thank You for any suggestions or comments Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

trouble with script

I'm having a little trouble finishing up this script any help would be great. My system is SCO OpenServer Enterprise System (ver 5.0.5m) and i'm using sh This script checks todays date and goes and downloads a file with yesterdays date in the name. ---start---- Server="ipaddresshere"... (4 Replies)
Discussion started by: whegra
4 Replies

2. UNIX for Advanced & Expert Users

snmpget/snmpwalk for dskPercent not working.

snmpwalk -v1 -c myname {ip address} dskPercent. Error in packet Reason: (noSuchName) There is no such variable name in this MIB. Failed object: UCD-SNMP-MIB::dskPercentNode snmpget -v1 -c myname {ip address} dskPercent.1 Error in packet Reason: (noSuchName) There is no such variable... (0 Replies)
Discussion started by: ynilesh
0 Replies

3. Solaris

Net-SNMP v5.4 - sub-id not found in log, but can query with snmpget and snmpwalk

Hi everyone, I'm configuring Net-SNMP v5.4 on Solaris 10, sending traps to OpenNMS 1.2.9-0.20061212.0. I'm setting up disk monitoring (% of space free) for 5 directories. Here's what I'm working with: (snmpd.conf - disk and monitoring portions) # # Disk Usage monitoring: # disk / 20%... (0 Replies)
Discussion started by: Mariognarly
0 Replies

4. Infrastructure Monitoring

snmpwalk on solaris 8

hello, I want to know how can I find the path of snmpwalk under sun solaris 5.8. I have snmp protocol installed.when I write this on a terminal I have this result: bash: snmpwalk: command not found but when I wrote this command At a distance,it works good. urgent please help me thanks (4 Replies)
Discussion started by: lamou23
4 Replies

5. Shell Programming and Scripting

snmpwalk timeout

can somoene please tell me how to tell snmpwalk how many seconds it has to timeout? i searched the web for this but i can't find it. i'm incorporating this into a script, and I'd like to have snmpwalk timeout within a certain amount of seconds. the -t option doesn't seem to work because... (1 Reply)
Discussion started by: SkySmart
1 Replies

6. UNIX for Dummies Questions & Answers

snmpwalk or maximum connection

what is the simplest command to check if a server already reached it's maximum connection? ( regardless if it's database, mail, etc). system: solaris (9/20) machine: sparc/x86 thanks, larey (5 Replies)
Discussion started by: lhareigh890
5 Replies

7. Homework & Coursework Questions

unix script trouble

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Hi I am new to unix and need some help, the main reason I am here is because i need basic unix knowledge The... (2 Replies)
Discussion started by: krolike
2 Replies

8. AIX

NET-SNMP not responding to snmpwalk

We are using net-snmp on AIX 5.3 TL12 with CACTi for monitoring. Recently we are facing a problem. When we start net-snmp the snmpwalk to the localhost is working. But after a few minutes the snmpwalk gives a timeout to localhost. The snmp process is running. We recently upgraded the TL on the... (1 Reply)
Discussion started by: wibhore
1 Replies

9. AIX

snmp genError with snmpwalk

Hi Admins, I am new member here. I am using IAX 5.3 trying to configure snmpv3. Conf file /etc/snmpdv3.conf contents given below VACM_GROUP group1 SNMPv1 public - VACM_GROUP group1 SNMPv1 sbmviking - VACM_VIEW defaultView internet - included -... (0 Replies)
Discussion started by: newaix
0 Replies

10. UNIX for Dummies Questions & Answers

Help with SNMPWALK

Hi when I do the SNMPwalk, it doesn't seem to work. Please advice what I am doing wrong? On my snmpd.conf file, I have this. rocommunity badboy xx.x.x.x # Traverse Server Also I have MIB files under /usr/share/snmp/mibs # service snmpd status snmpd (pid 23756)... (3 Replies)
Discussion started by: samnyc
3 Replies
DHCLIENT-SCRIPT(8)					    BSD System Manager's Manual 					DHCLIENT-SCRIPT(8)

NAME
dhclient-script -- DHCP client network configuration script DESCRIPTION
The DHCP client network configuration script is invoked from time to time by dhclient(8). This script is used by the DHCP client to set each interface's initial configuration prior to requesting an address, to test the address once it has been offered, and to set the interface's final configuration once a lease has been acquired. If no lease is acquired, the script is used to test predefined leases, if any, and also called once if no valid lease can be identified. In general, customizations specific to a particular computer should be done in the /etc/dhclient.conf file. OPERATION
When dhclient(8) needs to invoke the client configuration script, it sets up a number of environment variables and runs dhclient-script. In all cases, $reason is set to the name of the reason why the script has been invoked. The following reasons are currently defined: MEDIUM, PREINIT, ARPCHECK, ARPSEND, BOUND, RENEW, REBIND, REBOOT, EXPIRE, FAIL and TIMEOUT. MEDIUM The DHCP client is requesting that an interface's media type be set. The interface name is passed in $interface, and the media type is passed in $medium. PREINIT The DHCP client is requesting that an interface be configured as required in order to send packets prior to receiving an actual address. This means configuring the interface with an IP address of 0.0.0.0 and a broadcast address of 255.255.255.255. The interface name is passed in $interface, and the media type in $medium. If an IP alias has been declared in dhclient.conf(5), its address will be passed in $alias_ip_address, and that IP alias should be deleted from the interface, along with any routes to it. ARPSEND The DHCP client is requesting that an address that has been offered to it be checked to see if somebody else is using it, by send- ing an ARP request for that address. It is not clear how to implement this, so no examples exist yet. The IP address to check is passed in $new_ip_address, and the interface name is passed in $interface. ARPCHECK The DHCP client wants to know if a response to the ARP request sent using ARPSEND has been received. If one has, the script should exit with a nonzero status, indicating that the offered address has already been requested and should be declined. The $new_ip_address and $interface variables are set as with ARPSEND. BOUND The DHCP client has done an initial binding to a new address. The new IP address is passed in $new_ip_address, and the interface name is passed in $interface. The media type is passed in $medium. Any options acquired from the server are passed using the option name described in dhcp-options(5), except that dashes ('-') are replaced by underscores ('_') in order to make valid shell variables, and the variable names start with ``new_''. So for example, the new subnet mask would be passed in $new_subnet_mask. When a binding has been completed, a lot of network parameters are likely to need to be set up. A new /etc/resolv.conf needs to be created, using the values of $new_domain_name and $new_domain_name_servers (which may list more than one server, separated by spa- ces). A default route should be set using $new_routers, and static routes may need to be set up using $new_static_routes. If an IP alias has been declared, it must be set up here. The alias IP address will be written as $alias_ip_address, and other DHCP options that are set for the alias (e.g., subnet mask) will be passed in variables named as described previously except start- ing with ``$alias_'' instead of ``$new_''. Care should be taken that the alias IP address not be used if it is identical to the bound IP address ($new_ip_address), since the other alias parameters may be incorrect in this case. RENEW When a binding has been renewed, the script is called as in BOUND, except that in addition to all the variables starting with ``$new_'', there is another set of variables starting with ``$old_''. Persistent settings that may have changed need to be deleted - for example, if a local route to the bound address is being configured, the old local route should be deleted. If the default route has changed, the old default route should be deleted. If the static routes have changed, the old ones should be deleted. Otherwise, processing can be done as with BOUND. REBIND The DHCP client has rebound to a new DHCP server. This can be handled as with RENEW, except that if the IP address has changed, the ARP table should be cleared. REBOOT The DHCP client has successfully reacquired its old address after a reboot. This can be processed as with BOUND. EXPIRE The DHCP client has failed to renew its lease or acquire a new one, and the lease has expired. The IP address must be relin- quished, and all related parameters should be deleted, as in RENEW and REBIND. FAIL The DHCP client has been unable to contact any DHCP servers, and any leases that have been tested have not proved to be valid. The parameters from the last lease tested should be deconfigured. This can be handled in the same way as EXPIRE. TIMEOUT The DHCP client has been unable to contact any DHCP servers. However, an old lease has been identified, and its parameters have been passed in as with BOUND. The client configuration script should test these parameters and, if it has reason to believe they are valid, should exit with a value of zero. If not, it should exit with a nonzero value. Before taking action according to $reason, dhclient-script will check for the existence of /etc/dhclient-enter-hooks. If found, it will be sourced (see sh(1)). After taking action according to $reason, dhclient-script will check for the existence of /etc/dhclient-exit-hooks. If found, it will be sourced (see sh(1)). These hooks scripts can be used to dynamically modify the environment at appropriate times during the DHCP negotiations. For example, if the administrator wishes to disable alias IP numbers on the DHCP interface, they might want to put the following in /etc/dhclient-enter-hooks: [ ."$reason" = .PREINIT ] && ifconfig $interface 0.0.0.0 The usual way to test a lease is to set up the network as with REBIND (since this may be called to test more than one lease) and then ping the first router defined in $routers. If a response is received, the lease must be valid for the network to which the interface is currently connected. It would be more complete to try to ping all of the routers listed in $new_routers, as well as those listed in $new_static_routes, but current scripts do not do this. SEE ALSO
sh(1), dhclient.conf(5), dhclient.leases(5), dhclient(8), dhcpd(8), dhcrelay(8) AUTHORS
The original version of dhclient-script was written for the Internet Software Consortium by Ted Lemon <mellon@fugue.com> in cooperation with Vixie Enterprises. The OpenBSD implementation of dhclient-script was written by Kenneth R. Westerback <krw@openbsd.org>. BUGS
If more than one interface is being used, there is no obvious way to avoid clashes between server-supplied configuration parameters - for example, the stock dhclient-script rewrites /etc/resolv.conf. If more than one interface is being configured, /etc/resolv.conf will be repeatedly initialized to the values provided by one server, and then the other. Assuming the information provided by both servers is valid, this should not cause any real problems, but it could be confusing. BSD
September 6, 2010 BSD
All times are GMT -4. The time now is 05:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy