Set IP address of L3 switch using SNMP

HI,
 I am using cisco catalust 3560-x series swtiches. And I am new to SNMP. I want to assign IP address to interfaces of this switch, using SNMP.  Kindly help me. Any help, any sugession, is most welcome.
Thanks in advance
Jeni A

hi,
Thanks for your response.
Our requirement is as follows.
I want to assign IP address to Switch fro my Java Application. I have implemented  a Telnet Client Code in Java, by which i can configure IP address in switch from my java application.
But my boss said, Telnet is not secure and try using SNMP to do the same.
When I was searching in Internet, I got this page https://supportforums.cisco.com/discussion/12090896/snmp-how-get-list-ip-addresses-and-corresponding-interface-names
The above thread gives object ID to GET IP address of Switch interface. This Object is Read-only.
In the similar way, is there any object, using which I can SET / assign IP address to switch interfaces.
waiting for your response.
Thanks in advance :)

Similar Messages

  • Collecting information from Cisco switchs using SNMP

    Dear All,
    I have a wide network with more than 250 sites connected using the DSL. the WAN devices are under the provider responsability and the LAN devices are directly in my responsability. In each site, I have :
    1 or 2 Cisco switchs (2960 or 3560), connecting via fibr.
    or
    Linksys switch connected via ethernet cable
    and
    cisco 877 router connected to switch
    cisco 881G router conected to switch
    pc and printers
    In order to improve the availibilty of our network, we lauch every day a script from local pc to test connectivity of LAN equipements :
    ping to switchs (Vlan 1), ping to ip fa0/0 cisco router1, ip cisco router2, ping to HSRP address (of two router). the resulting ini file will be inserted in a database and exported to excel for analysing.
    I'm asking if someone can help in order to implement SNMP and let me know the name of cisco MIB to implement to :
    - to have from SNMP information, the result of show cdp nei, show interface status, show ip int brief,...
    - to have if wan router LAN interface are up,connected
    -  others usefuls informations.
    Thanks and regards,
    AA

    Hi,
    the basic SNMP config for 2960 and 3560 is:
         snmp-server community <> RO
    The configuration for SNMP traps to get alerts from the device if there is for example a failure with a fan is:
              snmp-server enable traps
              snmp-server host <> <>
    This enables all traps available with your IOS version. You can the disable not wanted traps by using the "no"-command like this.
    Example for dot1x traps:
              no snmp-server enable traps dot1x
    With a snmp client you can then do a snmpwalk (or snmp get) without a specific OID to get all the SNMP information from the device:
    On a Linux server the following command should work:
         snmpwalk -v 2c -c <> -T <>
    -v = use SNMP version 2c
    -c = use the community string you configured on the device
    -T = output in the dotted decimal format
    But be careful, this will be a lot of data output.
    Here you will find a docu for configuring SNMP on a Cisco device:
    http://www.cisco.com/en/US/docs/ios/12_2/configfun/configuration/guide/fcf014.html
    Sven

  • Unable to set IP address for VM creation using createVmBasedOnTemplate

    Hi,
    I'm trying to create VM using LifeCycleService - createVmBasedOnTemplate api
    The VM gets created and i m able to power on
    The ethernet cards are inactive when i checked thorugh console and IP address is not set
    So i'm unable to login to the VM using the IP address
    Below is the code snippet for reference
    // CreateLifeCycleServiceClient lifeCycleServiceClient
    LifecycleService.TemplateVmConfig templateVMConfig = new VirtualMachineController.LifecycleService.TemplateVmConfig();
    templateVMConfig.serverPoolName = "server pool name";
    templateVMConfig.templateName = "mytemplate";
    templateVMConfig.consolePassword = "password1";
    templateVMConfig.guestLogin = "guestuser1";
    templateVMConfig.guestLoginPassword = "password1";
    templateVMConfig.vmName = "rhel5_sample";
    templateVMConfig.haEnable = false;
    LifecycleService.NICConfig nic = new VirtualMachineController.LifecycleService.NICConfig();
    nic.name = "VIF0";
    nic.bridge = "xenbr0";
    nic.ipAddress = "10.10.10.227";
    nic.subnetMask = "255.255.255.128";
    nic.defaultGateway = "10.10.10.129";
    nic.domainName = "localhost.localdomain";
    nic.hostName = "rhel5_sample";
    nic.macAddress = "00:16:3E:09:56:C2";
    nic.dnsServer = "";
    nic.frontEndName = "rhel5_sample";
    nic.qosEnabled = true;
    nic.rateLimit = 100;
    LifecycleService.NetworkConfType oNetworkConfType = new LifecycleService.NetworkConfType();
    oNetworkConfType.type = "Static";
    nic.networkConfType = oNetworkConfType;
    LifecycleService.NetworkType oNetworkType = new VirtualMachineController.LifecycleService.NetworkType();
    oNetworkType.networkType = "ioemu";
    nic.networkType = oNetworkType;
    //nic.set
    LifecycleService.NICConfig\[] vifs = new VirtualMachineController.LifecycleService.NICConfig[] { nic };
    templateVMConfig.vif = vifs;
    vm = lifeCycleServiceClient.createVmBasedOnTemplate(templateVMConfig);
    Please help
    Edited by: user12180212 on Nov 6, 2009 5:16 AM
    Edited by: user12180212 on Nov 6, 2009 5:17 AM
    Edited by: user12180212 on Nov 6, 2009 5:18 AM

    Hi,
    I checked out the log file but there were no exceptions
    Am i missing something to set the IpAddress ?
    Log - for vm creation
    "2009-11-09 07:15:10" INFO=> new_async_task_ext: success. ->cp_vm ('/OVS/seed_pool/RHEL5_1C1G_149', '/OVS/running_pool/575_SampleVM3') => 875AD9EC47EC43E599CC7482ACB861E9
    "2009-11-09 07:15:10" INFO=> cp_vm: '/OVS/seed_pool/RHEL5_1C1G_149' -> '/OVS/running_pool/575_SampleVM3'
    "2009-11-09 07:15:11" INFO=> directcall_in_asyncenv: success. utl_get_vm_size ('/OVS/seed_pool/RHEL5_1C1G_149', '875AD9EC47EC43E599CC7482ACB861E9') => success:size=10241
    "2009-11-09 07:15:11" INFO=> directcall_in_asyncenv: success. utl_get_storage_repos ('875AD9EC47EC43E599CC7482ACB861E9',) => success:repos=/OVS;free_space=301273
    "2009-11-09 07:15:11" INFO=> utl_cp_vm: vm('/OVS/seed_pool/RHEL5_1C1G_149') -> vm('/OVS/running_pool/575_SampleVM3') start...
    "2009-11-09 07:19:25" INFO=> xen_correct_qos_cfg: vm_cfg('/OVS/running_pool/575_SampleVM3/vm.cfg')=>success.
    "2009-11-09 07:19:25" INFO=> xen_clear_vif_mac: success. vm('/OVS/running_pool/575_SampleVM3')
    "2009-11-09 07:19:25" INFO=> xen_correct_qos_cfg: vm_cfg('/OVS/running_pool/575_SampleVM3/vm.cfg')=>success.
    "2009-11-09 07:19:25" INFO=> xen_remove_shared_disk: success. vm('/OVS/running_pool/575_SampleVM3').
    "2009-11-09 07:19:25" INFO=> regenuln_uuid: /OVS/running_pool/575_SampleVM3/vm.cfg.
    "2009-11-09 07:19:25" DEBUG=> regenuln_uuid: System.img.
    "2009-11-09 07:19:26" DEBUG=> regenuln_uuid: mount -o loop System.img /tmp/tmpJ8Ag17ovs_mount_point failed.
    "2009-11-09 07:19:26" INFO=> xen_update_uuid: success. vm('/OVS/running_pool/575_SampleVM3/vm.cfg') uuid=65104130-1e5e-18cf-163a-460b853e0c85
    "2009-11-09 07:19:26" INFO=> utl_cp_vm: vm (/OVS/running_pool/575_SampleVM3) created!
    "2009-11-09 07:19:26" INFO=> directcall_in_asyncenv: success. utl_cp_vm ('/OVS/seed_pool/RHEL5_1C1G_149', '/OVS/running_pool/575_SampleVM3', '875AD9EC47EC43E599CC7482ACB861E9') => success:size=10241
    "2009-11-09 07:19:26" INFO=> cp_vm: '/OVS/seed_pool/RHEL5_1C1G_149' -> '/OVS/running_pool/575_SampleVM3' => success:size=10241
    "2009-11-09 07:19:26" INFO=> directcall_in_asyncenv: success. cp_vm ('/OVS/seed_pool/RHEL5_1C1G_149', '/OVS/running_pool/575_SampleVM3', '875AD9EC47EC43E599CC7482ACB861E9') => success:size=10241
    "2009-11-09 07:20:12" INFO=> xen_correct_qos_cfg: vm_cfg('/OVS/running_pool/575_SampleVM3/vm.cfg')=>success.
    "2009-11-09 07:20:12" INFO=> xen_set_vifs: success. vm('/OVS/running_pool/575_SampleVM3') set vif_cfg=00:16:3E:09:56:C2,xenbr0,ioemu, mode=setall, scope=cfg
    "2009-11-09 07:20:12" INFO=> set_vm_vifs: vm('/OVS/running_pool/575_SampleVM3') vif_cfg=00:16:3E:09:56:C2,xenbr0,ioemu scope=cfg => rs=success
    "2009-11-09 07:20:12" INFO=> xen_set_vm_vnc_password: success. vm_path('/OVS/running_pool/575_SampleVM3')
    "2009-11-09 07:20:12" INFO=> set_vm_vnc_password: success. vm_path('/OVS/running_pool/575_SampleVM3') => success
    "2009-11-09 07:20:12" INFO=> set_vm_policy: vm('/OVS/running_pool/575_SampleVM3') policy=[] append=False=> success.
    Log when VM is  powered on
    "2009-11-09 07:34:21" INFO=> xen_correct_qos_cfg: vm_cfg('/OVS/running_pool/575_SampleVM3/vm.cfg')=>success.
    "2009-11-09 07:34:21" INFO=> xen_correct_cfg: success. vm('/OVS/running_pool/575_SampleVM3') => cfg_file('/OVS/running_pool/575_SampleVM3/vm.cfg')
    "2009-11-09 07:34:24" INFO=> xen_start_vm: success. vm('/OVS/running_pool/575_SampleVM3')
    "2009-11-09 07:34:24" INFO=> start_vm: vm('/OVS/running_pool/575_SampleVM3') on srv('10.237.214.149') => success
    "2009-11-09 07:34:24" INFO=> start_vm: success. vm('/OVS/running_pool/575_SampleVM3') ip=''

  • NAC : CAM control over switch using SNMP

    Hi
    I have CAM , CAS in Central, OOB,Virtual,Layer2 lab
    I can see on CAM the access switch ports status which means that SNMP works but when a user is logged on the access switch , the user vlan is not inforced to be changed to Auth vlan
    and he remains in the trusted vlan which is already configured on the acces switch
    I can change in configuration on the switch through CAM but the CAM itself cant change Vlan
    thanks to advise me what part i am missing
    thanks

    in the CAM, when you see the access switch ports status, click on the magnifying glass icon next to a port which is up and see if it's detecting the MAC address of the device which is connected to that port. If it is not it means that SNMP mac-notification is not configured properly. If CAM doesn't detect the MAC address of the device, it wont change the switchport vlan...

  • How to read MAC from Catalyst WS-C4507R using SNMP

    Hello!
    I would like to get all the connected mac addresses from a Switch using SNMP. The all ports are set up as a VLAN 10. VLAN 2 is used as management interface.
    #sh mac-address-table
    Unicast Entries
    vlan   mac address     type        protocols               port
    -------+---------------+--------+---------------------+--------------------
       2    0013.c3c2.1cbf    static ip,ipx,assigned,other Switch               
       2    c42c.030b.c1b5   dynamic ip,other              GigabitEthernet1/1   
      10    3c62.0078.44a7   dynamic ip                    FastEthernet3/4      
      10    3c62.0078.44aa   dynamic ip,other              FastEthernet3/4      
      10    3c62.0078.4b31   dynamic ip                    FastEthernet3/1      
      10    3c62.0078.4cb7   dynamic ip                    FastEthernet3/2      
    Multicast Entries
    vlan    mac address     type    ports
    -------+---------------+-------+--------------------------------------------
       1    ffff.ffff.ffff   system
       2    ffff.ffff.ffff   system Switch,Gi1/1
      10    0100.5e7f.fffa     igmp Fa3/4
      10    ffff.ffff.ffff   system Fa3/1,Fa3/2,Fa3/4
    I used to work with the following string on an old 2950 Switch SNMPv2-SMI::enterprises.236.4.1.8.7.7.10.1.2.1 but this string is not working on the 4500.
    Can anyone help me with my issue?
    Thank you,
    Andreas

    Hi kehander,
    Thanks for the reply. I tried filling a constant path with the Mac-defined path to a data file on the USB disk (ie "DATA2:file1.dat"). This resulted in the same error message.
    I then considered that maybe I was misinterpreting the LV error message, and that perhaps I was supposed to address the file using PC-notation (ie. "DATA2\file1.dat"), even though the app is running on a Mac. No joy with this, but I get a different error msg:
    "Error 1430 occurred at Open File
    Possible reason(s):
    LabVIEW:  The path is empty or relative. You must use an absolute path."
    Can you share what your reasoning was for your suggestion... I'm not sure I understand why a constant path would produce different results?

  • Use SNMP to monitor the power supply status of stacked switches

    Does anybody know how to use SNMP to monitor the status of the internal power supplies of a group of stacked Cisco 3750 switches?
    The switch stack has three 3750-48PS-E switches inter-connected by Cisco StackWise cable. IOS ver 12.1(19)EAlc. A single IP address is used to identify the switch stack. Every time I poll the OID chassisPs1Status (1.3.6.1.4.1.9.5.1.2.4.0 in CISCO-STACK-MIB), I only got the status for the Master switch of the switch stack. Is there any way to poll the power supply status of other switches in the switch stack?
    Thanks a lot!

    Sorry to refresh such an old topic - but I am stuck with exactly this: Monitoring power supplies of a stacked Cisco Catalyst 3750-E.
    I'm using the exact same OID's as described, but the problem is, the information shown on the SNMP output is not correct.
    This morning, a power supply of the first switch failed and switched to RPS. Here the information I got on SNMP:
    snmpwalk -v 2c -c public 192.168.1.50 1.3.6.1.4.1.9.9.13.1
    SNMPv2-SMI::enterprises.9.9.13.1.1.0 = INTEGER: 13
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.2.1006 = STRING: "SW#1, Sensor#1, GREEN "
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.2.2006 = STRING: "SW#2, Sensor#1, GREEN "
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.3.1006 = Gauge32: 41
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.3.2006 = Gauge32: 40
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.4.1006 = INTEGER: 59
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.4.2006 = INTEGER: 59
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.5.1006 = INTEGER: 0
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.5.2006 = INTEGER: 0
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.6.1006 = INTEGER: 1
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.6.2006 = INTEGER: 1
    SNMPv2-SMI::enterprises.9.9.13.1.4.1.2.1060 = STRING: "Switch#1, Fan#1"
    SNMPv2-SMI::enterprises.9.9.13.1.4.1.2.2059 = STRING: "Switch#2, Fan#1"
    SNMPv2-SMI::enterprises.9.9.13.1.4.1.3.1060 = INTEGER: 1
    SNMPv2-SMI::enterprises.9.9.13.1.4.1.3.2059 = INTEGER: 1
    SNMPv2-SMI::enterprises.9.9.13.1.5.1.2.1059 = STRING: "Sw1, PS1 Normal, RPS NotExist"
    SNMPv2-SMI::enterprises.9.9.13.1.5.1.2.2060 = STRING: "Sw2, PS1 Normal, RPS NotExist"
    SNMPv2-SMI::enterprises.9.9.13.1.5.1.3.1059 = INTEGER: 1
    SNMPv2-SMI::enterprises.9.9.13.1.5.1.3.2060 = INTEGER: 1
    SNMPv2-SMI::enterprises.9.9.13.1.5.1.4.1059 = INTEGER: 2
    SNMPv2-SMI::enterprises.9.9.13.1.5.1.4.2060 = INTEGER: 2
    As you see, both PS1 (for both switches) are appearing normal. It doesn't even recognize RPS:
    SNMPv2-SMI::enterprises.9.9.13.1.5.1.2.1059 = STRING: "Sw1, PS1 Normal, RPS NotExist"
    SNMPv2-SMI::enterprises.9.9.13.1.5.1.2.2060 = STRING: "Sw2, PS1 Normal, RPS NotExist"
    The first switch's power supply died and now the cable is disconnected. LED's of the power supply are out. And still: The switch happily announces by SNMP it's power supplies are up.
    Is this a known bug? If yes, has it been fixed?
    Model  WS-C3750E-48TD
    Firmware 12.2(37)SE1
    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Table Normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-priority:99;
    mso-style-qformat:yes;
    mso-style-parent:"";
    mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
    mso-para-margin:0cm;
    mso-para-margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:11.0pt;
    font-family:"Calibri","sans-serif";
    mso-ascii-font-family:Calibri;
    mso-ascii-theme-font:minor-latin;
    mso-fareast-font-family:"Times New Roman";
    mso-fareast-theme-font:minor-fareast;
    mso-hansi-font-family:Calibri;
    mso-hansi-theme-font:minor-latin;
    mso-bidi-font-family:"Times New Roman";
    mso-bidi-theme-font:minor-bidi;}

  • Clearing the switch CAM using SNMP

    How can I clear the Dynamic address table (CAM) using SNMP?  There is a check box for this on the WEB interface.  It appears that the AAT time does not remove all entries older than that time.  I need to do this remotely from software and can't use the WEB interface.
    The switch we are using in an SRW208P.
    Thanks,
    GCL

    I suggest contacting Cisco Tech support to further look into your concern. I believe this unit belongs to the business series devices that Cisco is now supporting. Try to go to this link for the other business series devices and the site where you can get hold of Cisco for support: 
    http://forums.linksysbycisco.com/linksys/board/message?board.id=Switches&message.id=4273&query.id=27...

  • Using a variable in netsh command to set ip address on NIC

    hi friends
    i wrote an script which gets an input & use that variable to set ip address on NIC. but actually it doesn't set ip address. may you please help me.
    my script contains:
    $VMNumber=Read-Host "please enter your VM number (for example 2)"
    Netsh interface ipv4 set address NIC static 192.168.1.$VMNumber

    1. I do not thing that the use of netsh is a right way.
    2. You will need a table with MAC address in first column and IP address in second to correctly map IP address to computer. MAC addresses are unique identification.
    3. Follow this article including comments and adapt scripts to your task
    http://www.powershellpro.com/powershell-tutorial-introduction/powershell-wmi-methods/
    HTH
    Milos
    hi Milos
    thank a lot for your useful answer.
    but let me say that my need has nothing to do with MAC address.
    in my test lab, i need an script which asks the administrators to enter their VM number & it saves this input as a variable & set is as the last octet in their VM IPV4 Address.
    so can we tell it as a rule that variables we create in powershell, can't be used inside non cmdlets (inside legacy cmd commands) ?

  • Trying to set up Firefox Sync and it says my email address is already in use, but won't let me sign in.

    I'm trying to Sync Firefox between my new Android phone with my Macbook Air. It tells me I need to create an account, but says my email address is already in use. So I try to put in the codes in the three boxes, and it leads me back to set up a new account. How can I reset this? How do I proceed?
    Thank you for your help!

    Reset your password
    *https://account.services.mozilla.com/forgot
    *https://support.mozilla.org/en-US/kb/ive-lost-my-firefox-sync-account-information
    How do I manage my Firefox Sync account?
    *https://support.mozilla.org/en-US/kb/how-do-i-manage-my-firefox-sync-account

  • I want to use my icloud email address as a new apple ID.  It was an additional email contact address I originally set up for my child.  But now, I'd like to set her up on Family Sharing, using that email as her ID.  Obviously, when I try to use it wh

    I want to use one of my icloud email addresses as a new apple ID.  It was an additional email contact address I originally set up for my child.  But now, I'd like to set her up on Family Sharing, using that email as her ID.  Obviously, when I try to use it when setting up a new apple ID, it says the email is already being used (Yes, by ME) and I need to select a different one.  Can I somehow delete that email address in order to set up a new apple ID using it?  Or is there another way to "re-use" that address for my child's new ID?

    "Well, then I want to be able to merge that one and the one my purchases are on..."
    This is exactly what I want to do but don't think I can:
    I noticed the following :
    If you attempt to create an Apple ID which is the same as your @icloud email address from the online facility, it does not allow you (can't use an Apple associated email address as your Apple ID). However - if you start a fresh device - such as a new iPhone, iPad (must be mobile it seems), and then create an iCloud account and Apple ID from the prompts when setting up the mobile device, it IS possible to have your Apple ID and @iCloud email address as the same. I know because I just did it!
    Unfortunately for me, the result I got above is not for one of my own ID's but a friends, and I would VERY much like to do the same - my current Apple ID is a completely different email address from my iCloud account. Trying to get them the same in my situation is a major bother - I think that if I wipe a device (such as an iPhone5 that is mine) and try to setup as I did my friend's device, then I will get a conflict because the iCloud email I have ALREADY exists. This is my worry and I will not attempt this until I get the new iPad 4 soon to test this.
    There is an inconsistency here between the two methods of creating Apple ID's and iCloud accounts.
    Overall in my opinion, the Apple ID system as currently available from Apple is not designed very well, and should be addressed.
    Best wishes -

  • How to do a SET using SNMP ?

    Hi,
    I already ask in the forum Advanced Language Topics
    http://forum.java.sun.com/thread.jsp?forum=4&thread=320674
    but I din't receive any answer so I try here maybe some one could help me on this ... ;-)
    I find a nice piece of code on Internet to do SNMP request �
    http://membres.lycos.fr/ysoun/index.html
    http://membres.lycos.fr/ysoun/sck.zip
    It works find to do some GET operations like doing a GET sysDescr (oid 1.3.6.1.2.1.1.1.0).
    But I would like to do a SET operation but I could'nt succeed.
    First I do a get on an oid 1.3.6.1.2.1.1.4.0 (sysContact) and I get the value "hello" which is find and I would like to set this value to "good bye".
    Well I have to say that I don�t know very well the SNMP protocol and I couldn�t figure out where to put the value in order to set "Good bye". Off course I have the right community to do that but I just can't figure out how can I do that ...
    Any comment ... help ... ideas ... are more than welcome !!!! Or maybe some better SNMP package to do that???
    thanks,
    Emmanuel
    Here is the code:
    the function to set using SNMP ...
      public static setSnmpRequest(int snmpPort, int snmpTimeout, String community, String host, String strValue){
          String oid = new String("1.3.6.1.2.1.1.4.0");
          D_SNMP.Message request;
          try {
              InetAddress snmpHost = InetAddress.getByName(host);
              DatagramSocket sock = new DatagramSocket();
              sock.setSoTimeout(snmpTimeout);
              // create pdu.
              //somewhere here I should include my variable "good bye" but I don't really know how
              Var var = new Var(oid);
              OctetString c = new OctetString(community);
              D_SNMP.Integer requestId = new D_SNMP.Integer(0);
              D_SNMP.Integer errorIndex = new D_SNMP.Integer(0);
              D_SNMP.Integer errorStatus = new D_SNMP.Integer(0);
              //For the GET:
              //PduCmd pdu = new PduCmd(Pdu.GET,requestId,errorStatus,errorIndex,new VarList(var));
              //What I would like to do:
              PduCmd pdu = new PduCmd(Pdu.SET,requestId,errorStatus,errorIndex,new VarList(var));
              D_SNMP.Message m = new D_SNMP.Message(c,pdu);
              // send
              byte[] b = m.codeBer();
              DatagramPacket packet = new DatagramPacket(b,b.length,snmpHost,snmpPort);
              byte[] b2 = new byte[1024];
              DatagramPacket p2 = new DatagramPacket(b2,b2.length);
              long startTime = System.currentTimeMillis();
              sock.send(packet);
              sock.receive(p2); // block or ... timeout.
              long time = (System.currentTimeMillis() - startTime);
              // display
              ByteArrayInputStream ber = new ByteArrayInputStream(b2,1,p2.getLength()-1); // without tag !
              D_SNMP.Message m2 = new D_SNMP.Message(ber);
              System.out.println("snmpPing " + host + " :");
              System.out.println(m2.getPdu().getVarList().elementAt(0) + " / time = " + time + "ms" );
              if (debug){
                  StringBuffer buf = new StringBuffer();
                  m2.println("",buf);
                  System.out.println(buf);
          } catch (UnknownHostException ex){
              System.out.println(host + ": unknown host." );
          } catch (InterruptedIOException ex){
              System.out.println("snmpPing "+ host + " : Time-out." );
          } catch ( Exception ex) {
              System.out.println("Error in : ");
              System.out.println(ex);
      } the class Var... where somewhere I should be able to set the variable "Good bye" ...
    import java.io.*;
    import java.util.Vector;
    /** ASN.1 grammar for Var:
    * Var ::=
    * SEQUENCE
    *        { name Oid
    *          value CHOICE {Null, Integer, Counter, gauge, Timeticks, IpAddress, OctetString}
    final public class Var extends construct implements Serializable {
      public Var(Oid o, smi s){
        this();
        valeur.addElement(o);
        valeur.addElement(s);
      /** Same as Var(new Oid(oid), new Null()).
      public Var(String oid) throws IOException{
        this(new Oid(oid), new D_SNMP.Null());
      /** Builds a Var from a ByteArrayInputStream holding a Var Ber coding.
       *  <BR>Bytes read are removed from the stream.
       *  <P><B>Note:</B> The ByteArrayInputStream must not contain the Var Tag.
       *  @exception IOException is thrown if a problem occurs while trying to decode the stream.
      public Var(ByteArrayInputStream inBer) throws IOException{
        this();
        decodeBer(inBer);
      /** Used only by VarList.
      Var(){
        super(smi.SEQUENCE_tag);
        valeur = new Vector(2);
      /** Returns the name of this Var.
      public Oid getName(){
        return (Oid) valeur.elementAt(0);
      /** Returns the value of this Var.
      public smi getValue(){
        return (smi) valeur.elementAt(1);
      /** Returns the value of this Var as a String.
      public String toString() {
        try{
        return ((smi)valeur.elementAt(0)).toString() + " = " + ((smi)valeur.elementAt(1)).toString();
        }catch (IndexOutOfBoundsException e) { // ne doit pas se produire.
          System.out.println("Erreur codage interne type Var.");
          System.exit(1);
        return null;
      /** Used smi.decodeBer().
      void decodeValeur(ByteArrayInputStream bufferBer, int lgBerValeur) throws IOException {
        int tag = bufferBer.read();
        if ( tag != smi.OID_tag )
          throw new IOException ("erreur decodage tag Oid de Var: byte " + java.lang.Integer.toHexString(tag) +" recu.");
        Oid name = new Oid(bufferBer);
        this.valeur.addElement(name);
        // lis l'objet suivant.
        tag = bufferBer.read();
        try{
        smi _valeur = smiFactory.create(tag,bufferBer);
        this.valeur.addElement(_valeur);
        } catch (IOException e){
          throw new IOException ("erreur decodage champ Valeur : " + e);
      /** Custom serialization: Ber coding is written in ObjectOutputStream.
      private void writeObject(ObjectOutputStream out) throws IOException{
        byte b[] = this.codeBer();
        out.writeInt(b.length);
        out.write(b);
        out.flush();
      private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
        this._tag = smi.SEQUENCE_tag;
        this.valeur = new Vector();
        int len = in.readInt();
        byte b[] = new byte[len];
        in.readFully(b);
        this.decodeBer(new ByteArrayInputStream(b,1,b.length-1));
    } the class VarList ...
    import java.io.*;
    import java.util.Vector;
    /** ASN.1 grammar for VarList:
    * VarList ::=
    * SEQUENCE OF Var
    final public class VarList extends construct {
      /** Constructs a VarList holding a single Var.
       *  @param Var to be held by Varlist
       public VarList(Var v){
         super(smi.SEQUENCE_tag);
         valeur = new Vector(1);
         valeur.addElement(v);
      /** Constructs a VarList holding Vars.
       *  @param v Vector of Vars.
       public VarList(Vector v){
         super(smi.SEQUENCE_tag);
         valeur = (Vector) v.clone();
       /** Constructs a VarList holding Vars.
       *  @param tab array of Vars.
       public VarList(Var[] tab){
         super(smi.SEQUENCE_tag);
         int taille = tab.length;
         valeur = new Vector(taille);
         for (int i=0; i<taille; i++)
           valeur.addElement(tab);
    /** Builds a VarList from a ByteArrayInputStream holding a VarList Ber coding.
    * <BR>Bytes read are removed from the stream.
    * <P><B>Note:</B> The ByteArrayInputStream must not contain the Var Tag.
    * @exception IOException is thrown if a problem occurs while trying to decode the stream.
    public VarList(ByteArrayInputStream inBer) throws IOException{
    super(smi.SEQUENCE_tag);
    valeur = new Vector();
    decodeBer(inBer);
    /** Returns the Var at the specified index.
    public Var elementAt(int i) throws IndexOutOfBoundsException {
    return (Var)valeur.elementAt(i); // Sans soucis: Var est immutable
    /** Returns the number of Var held this VarList.
    public int getSize(){
    return valeur.size();
    /** Used by smi.decodeBer().
    * A VarList is in fact an array of Vars.
    void decodeValeur(ByteArrayInputStream bufferBer, int lgBerValeur) throws IOException {
    Var v;
    int lg;
    try{
    while (lgBerValeur >0){
    int tag = bufferBer.read();
    lgBerValeur --;
    if ( tag != smi.SEQUENCE_tag )
    throw new IOException ("error decoding tag Var in VarList: byte " +
    java.lang.Integer.toHexString(tag) +" read.");
    v =new Var();
    lg = v.decodeBer(bufferBer);
    this.valeur.addElement(v);
    lgBerValeur -= lg;
    } catch (IOException e){
    throw new IOException ("error decoding Value : " + e);

    I read the documentation it does not help me much, (it's generated by javadoc and there is not enought comment to understand the whole thing ... in fact it just miss a sample of SET request and it would be perfect ...
    thanks,
    emmanuel
    PS: I'm going to try the author again
    PS: Still ... any help or pakage to do SET request using SNMP are more than welcome ...

  • How to set endpoint address using UTL_DBWS

    Hi,
    I have been struggling to invoke a web service in the Oracle 10g database using UTL_DBWS. Now I reached a point where I need to set an endpoint address using UTL_DBWS to complete the invoking process, I try to use UTL_DBWS.Set_Target_Endpoint_Address to do this, but SQL*Plus is returning an error saying Set_Target_Endpoint_Address must be declared.
    Am I calling the wrong function? If so which function should I call to set endpoint address in UTL_DBWS? I have all the necessary jar files installed and the right grants to access this package.
    any hint would be appreciated.
    Thanks.

    Did you try using 'UTL_SMTP.WRITE_DATA'?
    Like:
    DECLARE
    con UTL_SMTP.CONNECTION;
    BEGIN
    con := UTL_SMTP.OPEN_CONNECTION('alpha.beta.com');
    UTL_SMTP.HELO(con, 'gamma.com');
    UTL_SMTP.MAIL(con, '[email protected]');
    UTL_SMTP.RCPT(con, '[email protected]');
    UTL_SMTP.OPEN_DATA(con);
    UTL_SMTP.WRITE_DATA(con,'Importance: HIGH'||UTL_TCP.CRLF);
    END;I have not tested the code. I am not sure if it is going to work in your case.

  • New ipad3, just getting started, trying to get on facetime but when I try to set up a message appears saying my email address is already in use. I am now stuck and I can't get any further! Help please!

    New ipad3,just getting started,trying to get on FaceTime but when I try to set up a message appears saying my email address is already in use. I can not get any further, help please

    Millietrixie-
    Are you trying to call yourself to test FaceTime?  If so, you must have a second E-Mail address registered with your Apple ID.  In other words, there must be a different E-Mail address on each unit.
    Fred

  • Do I need to create ip address to another switch when i use stack?

    Good Day!
    Please help me to answer this question in my title. I have 2 switches my old switch has configure ip address and i will use stack to my another switch the old one will be the primary and new switch is the secondary do i need to configure the ip address of the new 1 or  no need? i'm totally confuse on it. I hope you can help me regarding on this matter.Thank you.

    no Need.
    Here is the procedure:
    Tips to Add a Switch as a Slave to the Stack
    To add a switch, as a slave, to a stack, complete these steps:
    Note: Make sure the switch that you add into the stack has the same IOS version as the switches in the stack. Refer to Catalyst 3750 Software Upgrade in a Stack Configuration with Use of the Command-Line Interface to upgrade the IOS in a catalyst 3750 switch.
    Change the switch priority of the switch to be added to "1".switch stack-member-number priority new-priority-valueNote: This step is optional, but it will make sure that the switch has fewer chances to become a stackmaster in the future.
    Power off the switch that is to be added.
    Make sure that the stack is fully connected so that, when you connect the new switch, the stack will be at least in half connectivity and does not partition.
    Connect the new switch to the stack with the StackWise ports.
    Power on the newly added switch.
    After the new switch comes up, issue the command show switch to verify stack membership.
    HTH
    Regards
    Inayath
    ***********Plz dont forget to rate all usefull posts*********

  • Setting up new imac on network using dhcp nut not getting a valid ip address. Same happens when I try to connect via wi-fi. IP address being assigned is 10.45.190.195

    Have new Imac that I'm setting up. Company is using DHCP to manage IP addresses. Mac is plugged into netgear hub along with a PC. Mac is getting an invalid IP address of 10.45.190.195. PC is working fine. I've powered the hub on and off. I've renewed th DHCP lease on the Mac many times but IP address always comes back as 10.45.190.195. I've plugged the network cable directly in the network port bypassing the hub. Same result.
    Having the same issue when trying to connect via Wi-Fi,
    Anyone experiencing this issue?

    I see what you are saying. When I lived in the dorms, I was set up in bridge mode because we had that type of modem. My question now is do I distribute a range of static IP's or share a public? Either of these settings give me errors where the starting and ending DHCP addresses conflict. I use 10.0.1.1 and 10.0.1.100 and this error no longer seems to persist, but then I am not able to connect to the internet and the amber light keeps flashing- along with my computer showing that I am still connected to the TM.
    Thank you for your support so far.

Maybe you are looking for

  • BO SSO (SNC) is not working in InfoView

    Hi Gurus, We are facing a very strange scenario in our Production environment. The BO SSO (SNC) is working fine in Dev and QA. The problem is in Production (clustered environment). The details are following: The SIA is running in 3 different servers

  • Help with ipod formating, error 1429 please help!!!!

    30g movie not sure which gen but it was one of the first movie ipods hello, my ipod had died. all i get is a screen telling me to contect to itunes to restore, which i have done but the restore freezes and i get a message "unable to restore ipod erro

  • Time machine disk erorr

    while running time machine under osx 10.5.1 , the disk gives error "disk disconnected" while in fact it is still there and never been moved or touched. !! there is an old backup dated a week ago on that external ( under 10.5) howver i had to reform a

  • One vendor -payments to be made from two house banks

    Hi In our company code, we have a vendor who supplies two kinds of materials, let us say hardware and stationery items. For the supply of hardware materials, I have to pay him from one house bank and for the supplies of stationery, I have to pay him

  • How can I get my "My Passport for Mac" to work on OS Lion?

    I recently upgraded to OS X Lion, and everytime I try to open WD Smartware to back up my computer, it crashes. Is WD or Apple working on a fix, or am I going to have to buy a new external harddrive?