OID need to run SNMP queries for the CPU usage, etc. in Win XP

Hello

I am unable to get the details (CPU Util, Util Swap) of windows using SNMP (SNMP4j.jar) machine. The SNMP service is running on the Windows XP system target. Where can I find the correct OID for windows XP to retrieve these settings?

Join the code below:

Import org.snmp4j.CommunityTarget;
Import org.snmp4j.PDU;
Import org.snmp4j.Snmp;
Import org.snmp4j.event.ResponseEvent;
Import org.snmp4j.mp.SnmpConstants;
Import org.snmp4j.smi.OID;
Import org.snmp4j.smi.OctetString;
Import org.snmp4j.smi.UdpAddress;
Import org.snmp4j.smi.VariableBinding;
Import org.snmp4j.transport.DefaultUdpTransportMapping;

Configure the Snmp object
private Snmp snmp = null;
private UdpAddress targetAddress = null;
private CommunityTarget target = null;
ResponseEvent responseEvent = null;

targetAddress = new UdpAddress (10.101.210.127 + ' /' + 161);

target = new CommunityTarget();
target.setCommunity (new OctetString ("public"));
target.setAddress (targetAddress);
target.setRetries (2);
target.setTimeout (60000);
target.setVersion (SnmpConstants.version2c);
       
SNMP = Snmp new (new DefaultUdpTransportMapping());
            
       
SNMP. Listen();

CPU usage code
   
Command PDU = new PDU();
command.setType (PDU. (GET);
Command.Add (new VariableBinding (new OID(".1.3.6.1.2.1.25.2.3.1.4"))); / / percentage of CPU Idle time//.1.3.6.1.4.1.311.1.7.3.1.6.0
try {}
responseEvent = snmp.send (command, target);//.1.3.6.1.4.1.2021.11.11.0
} catch (Exception e) {}
System.out.println ("Exception:" + e); e.printStackTrace ();
}
If (responseEvent.getResponse () == null) {}
request timed out
Returns a null value.
} else {}
Response PDU dump
PDU pdu = (responseEvent.getResponse ());
Output vector = new Vector();
Output = pdu.getVariableBindings ();
int val1 = 0;
Double CPUMemUtil = 0;
Dim str As String = null;
Str = Output.get (0) m:System.NET.SocketAddress.ToString ();
String [] Spstr = str.split("=");
Spstr [1] = Spstr [1] .trim ();
try {}
val1 = Integer.parseInt(Spstr[1]);
} catch (Exception e) {}
System.out.println ("An Exception occurred" + e); e.printStackTrace ();
}
CPUMemUtil = (100 - val1);
String OutputMemUtil = Double.toString (CPUMemUtil);
System.out.println ("CPU usage" + OutputMemUtil);

Thanks in advance,

Souto

Hello

Questions like these are much better handled in the TechNet IT Pro Forums.

My moderator tools cannot transfer messages on Windows forums, please re - ask you question there.

http://social.technet.Microsoft.com/forums/en/itproxpsp/threads

Jack-MVP Windows Networking. WWW.EZLAN.NET

Tags: Windows

Similar Questions

  • SG - 500 - OID SNMP to lower the CPU load?

    Hello

    I have several SG500 (autonomous and stacked). How can I get the CPU via SNMP load? Who knows the correct SNMP OID to lower the CPU load?

    In the MIB that are provided for download one was not able to find the correct OID.

    Hello

    There are three OID for the CPU usage:

    CPU utilization for 5 seconds
    . 1.3.6.1.4.1.9.6.1.101.1.7.0
    CPU utilization for 1 minutes
    . 1.3.6.1.4.1.9.6.1.101.1.8.0
    CPU utilization for 5 minutes
    . 1.3.6.1.4.1.9.6.1.101.1.9.0

    This came a note of junk, I got in an email, so I don't know exactly where this information is originally.

    Let me know if it works for you,

    Christopher Ebert - Network Support Engineer

    Cisco Small Business Support Center

    * Please note the useful messages *.

  • In the "CPU usage history" Task Manager, which is the length of the story

    Work Manager "CPU usage history" view which is the length of the story?

    Stephanie

    There is no time for the CPU usage history

    How reach you that conclusion?

    You can change the timespan by changing the speed! You have high, Normal and slow. The displayed time interval will vary depending on the setting. You also Pause setting, which freezes the display.

  • Configure SNMP source for the events of HW for IPMI sensors

    Us run Dell hardware and tested OMSA installed on ESXi5 hosts pointing to OpenManage (OME) Essentials for any interruptions SNMP. As indicated in the following Dell FAQ for OME the 9.5 troubleshooting section, to avoid massive amounts of alerts unknown on the server of the OME from our hosts ESXi5 we define the SNMP CIM for IPMI event source.

    http://en.community.Dell.com/TechCenter/systems-management/w/wiki/3265.OpenManage-Essentials-FAQ.aspx

    This article as well as VMware material and KB, any reference to the need to use the vSphere CLI to make this change, which of course works such as documented. Does anyone know if it is possible to make this change via PowerCLI? We do not want to use the vSphere CLI unless it's the only possible way as all the other configuration items that we have implemented kickstart or PowerCLI scripting.

    http://KB.VMware.com/kb/1008065

    http://pubs.VMware.com/vSphere-50/topic/com.VMware.vSphere.monitoring.doc_50/GUID-01D333E8-0A34-4F04-BB6C-D80A5FDA8CC5.html

    I was able to find the key value pair in PowerCLI where EnvEventSource/directions options, but I don't know if those who may be changed.

    If someone knows a way to do this, I would like to know how it is possible.

    Thank you.

    I think I knew that.  It seems that you have to connect directly to the ESXi host nothing to do with SNMP still, but if someone knows a way to avoid this, I'd love to hear it.  But this seems to work at the same time, but would need to change to more than one host at a time.

    ## Script function: Modify SNMP source for hardware events
    ## Usage: Connect to vCenter where host(s) reside, populate constants below and run
    
    ## Host to make changes to
    $strVMHost = "your_ESXi_5_host"
    
    ## Credentials for ESXi host(s)
    $strUser = "root"
    $strPassword = "your_password"
    
    ## Key to change value on (in case there are different key/value pairs you need to change in the future)
    $keySnmpEventSource = "EnvEventSource"
    
    ## New value for above key
    $valueSnmpEventSource = "sensors"
    
    ## Connect directly to VMHost in order to see the HostSnmpSystem object (http://pubs.vmware.com/vsphere-50/topic/com.vmware.wssdk.apiref.doc_50/vim.host.SnmpSystem.html)
    Connect-VIServer -Server $strVMHost -User $strUser -Password $strPassword
    
    ## Get the VMHost .NET View object and select only the HostSnmpSystem object
    $viewHost = Get-VMHost -Server $strVMHost -Name $strVMHost | Get-View -Property ConfigManager.SnmpSystem
    
    ## Get the HostSnmpSystem object
    $viewHostSnmpSystem = Get-View -Id $viewHost.ConfigManager.SnmpSystem
    
    ## Create new empty HostSnmpConfigSpec (http://pubs.vmware.com/vsphere-50/topic/com.vmware.wssdk.apiref.doc_50/vim.host.SnmpSystem.SnmpConfigSpec.html)
    $specHostSnmpConfigSpec = New-Object VMware.Vim.HostSnmpConfigSpec
    
    ## Populate newly created HostSnmpConfigSpec object with current values
    $specHostSnmpConfigSpec = $viewHostSnmpSystem.Configuration
    
    ## Modify desired value for the matching key
    ($specHostSnmpConfigSpec.Option | ?{$_.Key -eq $keySnmpEventSource}).Value = $valueSnmpEventSource
    
    ## Reconfigure the SNMP agent to take the new value
    $viewHostSnmpSystem.ReconfigureSnmpAgent($specHostSnmpConfigSpec)
    
    ## Disconnect from VMHost
    Disconnect-VIServer -Server $strVMHost -Confirm:$false
    

    Let me know if it works for your environment that we not use SNMP in ours, so I didn't do extensive testing.

  • "Any new name for the program" has encountered a problem and needs to close. Sorry for the inconvience

    Whenever we try to install something new, that settles it, but when we get the same error message

    "the new name of the program" has encountered a problem and needs to close.  Sorry for the inconvience

    We can't get anything to run now

    Hello

    1 is this problem limited only when installing an application?
    2. what application are you trying to install?

    Method 1.
    I recommend you to reregister the Installer engine.
    Here's how:
    a. Click Start, click Accessories and then click command prompt.
    b. at the command prompt, type the following and press ENTER after each line:

    MSIExec /Unregister
     
    MSIExec/regserver

    Method 2.
    For other methods, see the article below.
    How to troubleshoot issues that may occur when you install, uninstall, or upgrade one program on a Windows computer
    http://support.Microsoft.com/kb/2438651/en-us

    I hope this helps.

    Thank you, and in what concerns:
    Shekhar S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.
    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • CQ61-313us: maestro also needing help code is 75957252 for the bios password reset

    Maestro also needing help code is 75957252 for the bios password reset

    Check your other post. I answered here.

  • Error "Generic Host process for Win 32 services has encountered a problem and needs to close." Sorry for the inconvenience. "Please tell MIcrosoft this problem."

    Original title: programs appearing and disappearing

    Generic Host process for Win 32 services has encountered a problem and needs to close.
    Sorry for the inconvenience.
    Please tell this problem to MIcrosoft. We have created an error report that you can send to help us improve the generic
    Host Process for Win 32 Services. We will treat this report as confidential and anonymous. To see the data click on send
    Error report or not send.
    I clicked on the error report, and that's what he said... szAppname:svchost.exe szAppver: 5.1.2600.5512
    szModver: 5.1.2600.5755 szModname: ntdll.dll compensate 00023845 etc, etc.

    Hi 1jimbo1,

    1. when exactly you receive this error message?
    2. did you of recent changes to the computer?

    Method 1:

    Step 1:

    You can try to start in safe mode and check if the problem occurs.

    Check out the link for more information on starting your computer in SafeMode below:

    http://support.Microsoft.com/kb/315222

    Step 2:

    If the problem does not happen in safe mode and then, try to perform a clean boot.

    A clean boot to check if startup item or services to third-party application is causing this issue.

    You can read the following article to put the computer in a clean boot:

    http://support.Microsoft.com/kb/310353

    If your problem is resolved after the clean boot, and then follow the steps mentioned in the article above to refine the exact source.

    After you have used the boot is a way to solve your problem, you can follow the steps to configure Windows XP to start normally.

    Method 2:

    You can also check the following link and complete the scan line on your computer to check whether your computer is infected with a virus or not.

    http://OneCare.live.com/site/en-us/default.html

    Thank you, and in what concerns:
    I. Suuresh Kumar - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • problems of the admin: message saying insufficient privileges: you must be an administrator when you run this application for the first time

    I bought this new comp with windows 7 already installed. has worked fine up intill a week or two it y a. I installed a new game, and after installation, I press launch to play it and pop up with a message saying not sufficient privileges: you must be an administrator when you run this application for the first time. also, I thought that I must be the administrator when I tried to launch the disk defragmentation. my account is the administrator account so I don't understand why they say that.

    I'm sorry. I was reading through additional FAQS regarding the same problem. I saw where someone said to try to add another admisistrator account to try to take on the former. but I had no luck with this ether. I also downloaded the program of the UAC, and I turned it off, reset my computer and still no change to my problem. I also tried to download the MSE restore tool, but I found myself with a message saying that I have no MSE

    Sorry, the MSE tool is to set the MSE when its broken.
    UAC controller Tool v1.0 can be used to control the
    The UAC settings.

    However, I suggest you restart the PC and after BIOS hold the F8 key
    and when the Windows Startup Menu appears, select Mode safe mode with networking.

    Now, you will enter Safe Mode. On the page to connect, you will see the
    Standard Windows administrator click it to open a windows session, press and hold
    in mind, the password can be blank.

    Once you have done that make a new account administrator and giv it a name.
    Restart the PC. That you did this newspaper using the new account.
    Once you have done that decide what to keep with your current administrator
    account once you've done it restart the PC, BIOS hold down the F8 key and
    Select Mode safe mode with network and enter dependencies the Standard Windows administrator.

    Go to control panel-> user accounts control and security for the family-> user accounts, then
    Select manage another account. In the list, select the administrator account
    your select and then delete the account, then it will ask you if you want to keep
    files etc, it's your own decision. Itknowledge24.com

  • Windows 7 says I need to install this driver for the scanner to work, but I can't. HP m1522nf driver wia

    Windows 7 says I need to install this driver for the scanner to work, but I can't.

    As for all the HP drivers, simply visit the HP support site http://support.hp.com/, enter the model number in the search box, click on the link drivers and you're there.  http://h20000.www2.HP.com/bizsupport/TechSupport/DriverDownload.jsp?prodNameId=3442754&lang=en&cc=us&TaskID=135&prodTypeId=18972&prodSeriesId=3442750

  • I am trying to download CS on my HP Z400 running Windows 7 for the first time.  The installer won't boot.  It finally gives a "server not available" error after 30-45 minutes

    I am trying to download CS on my HP Z400 running Windows 7 for the first time.  The installer won't boot.  It finally gives a "server not available" error after 30 to 45 minutes.  I checked to be sure there is no Adobe folder in my program files.

    Hello

    Please check the help below document:

    Error download or update Adobe Creative Cloud applications

    You can also view the nets below where the issue has been addressed:

    Error 207 to "install Adobe".

    Adobe creative cloud installation does not work. Get the error code 207. All solutions?

    Kind regards

    Sheena

  • I searched for a solution for the problem I was on Win 7 Pro Service Pack 1 in the links on an open Adobe Acrobat file will not open in my browser Firefox 33.0.2. The error I get is "Acrobat could not run the web browser.  Unknown error. (123).

    I want a solution for the problem I was on Win 7 Pro Service Pack 1 in the links on an open Adobe Acrobat Pro 10.1.12 file will not open in my browser Firefox 33.0.2. The error I get is "Acrobat could not run the web browser.  Unknown error. (123).

    You can try a repair of your Acrobat installation. Maybe, at least it's a start toward a solution.

  • game does not open on steam, but says its running on the CPU usage

    football manager 2011 order opening via steam as usual. but it shows that it is running on the CPU usage

    Hello

    1. what version of windows is installed on the computer?

    2. were you able to play the game before?

    3. what browser do you use?

    I suggest you to give us more information about the issue so that we can help you better.

    It will be useful.

  • The CPU usage goes to 100% frequently for all the computers on the network.

    Hi, I'm an engineer, for the past two weeks, my users are complaining about slow and found the CPU usage goes to 100% frequently, as we have laptop Dell Latitude with i7, 4 GB memory, Win7 64 bit OS. but this problem is din't solve even after fresh OS installation.

    Check your remote destop setting. When something like that happens, its been my experience that someone or something keep 'rattling' computers trying to connect to them i.e. virus/trojan or something that someone installed which is now trying to hit everything on the network.

  • When I used to hit ctrl, ALT, delete, Task Manager appears. Now, just the screen CPU usage. How can I get that back for the bigger task manager, which, the CPU usage was a tab to the breast? Thank you.

    The Task Manager is now just 'CPU' because I must have hit something wrong.  I was hoping just to click on the tab use the CPU in the Task Manager, now somehow when I hit CTRL, remove alt. it shows only the CPU usage graph.

    Double-click the window border.

  • Satellite A200 crashing when moved or when the CPU usage is too high

    Well so recently my Toshiba Satellite A200 started crashing everytime I have to pick up the laptop or run any processes taking the CPU up to 100% usage.

    This means essentially no rendering 3D games and no Photoshop or current iTunes running at the same time, etc. Here are the best even if it happens only when the laptop is plugged and not when only battery power. I tried to use another AC adapter, and I cleaned the hard drive for a new installation of Windows 7 that never solved the problem. I even went so far as to update the BIOS.

    I am not quite determined that he is just a hardware problem, but I was wondering if anyone had suggestions about which party can act up on me. As I said still works like a dream when running on battery power.

    > Here is the kicker if this happens only when the laptop is plugged and not when only battery power.

    The energy saving switch to another profile, using the AC adapter.
    Maybe you can try to change the speed of treatment at a lower level and could increase the cooling method parameters in the energy saving profile when the AC adapter is in use.

    Otherwise, it could be a hardware problem and in this case, you will need a help of ASP.

Maybe you are looking for

  • Bookmark icon does not appear on the top right corner next to the icon of the homepage

    Bookmark icon does not appear on the top right corner next to the icon of the homepage

  • HP S5220SC: Ram Maximum for a HP S5220SC

    Hello Have an old HP computer that works absolutely fine except for speed. I currently 4 GB of Ram and you want to upgrade, but not sure it's possible. I can't find anything in my manual and found a site where it is written that it is not possible to

  • iCloud Contacts do not sync with the iPad

    I put the new coordinates in my Contacts on my MacBook. It syncs with my iCloud account. But it is not sync with my iPad. On my iPad app, "all the iCloud" is checked. On my iPad, in the Mail, Contacts, calendars section, the scanning of Contacts butt

  • BlackBerry Smartphones BLACKBERRY TORCH IM ISSUE

    I recently changed my phone from Blackberry BB 9000 to BB Torch 9800. Since the change over some of my contacts no. is more receive IM messages. They contacted their support and I contacted my service provider, to always have a problem. Help!

  • WHERE conditional clause with CASE statement

    Hi experts,I have a table:CREATE THE TABLE HR. TABLE_Y(NUMBER (2),ID NUMBER (2),NUMBER (5) CALC)Insert into human resources. TABLE_Y(TYPE, ID, CALC)Values(1, 1, 10);Insert into human resources. TABLE_Y(TYPE, ID, CALC)Values(1, 2, 15);Insert into huma