Apache-ant combined Nmon native running monitoring database and server

Source: Internet
Author: User
Tags scp file

Nmon and Apache for specific monitoring

Demand:

Company business requirements Performance testing, need to monitor 20 nodes simultaneously, record cup, memory, IO and other indicators;

Through the network data trial open source software nmon can monitor;

Thinking:

If you need to monitor 20 machines at the same time, it is difficult to run the Nmon estimate by the full-beat command, and I think how to run the script in this machine to implement the remote command operation 20 machine monitoring.

Installation steps:
1. First, install Ant
To the official homepage http://ant.apache.org Download the new version or the old version (this time using Ant1.8.1) ant, get a apache-ant-1.8.1-bin.zip compression package. Unzip it to your hard drive, for example: C:\apache-ant-1.8.1.
Second, configure environment variables
Set the ANT environment variable in window:
Ant_home c:/apache-ant-1.8.1
Path c:/Apache-ant-1.8.1/bin
Classpath C:/apache-ant-1.8.1/lib
Note: "
Configure environment variables: My Computer----Properties-----Advanced----Environment Variables
such as: ant_home:c:\apache-ant-1.8.1
Path:%ant_home%\bin (for ease of operation in a DOS environment)
Experiment has always failed, no way to change the address c:/Apache-ant-1.8.1/bin, and no longer use the variable ... It worked..

Third, verify the Ant
To verify that ant is installed successfully, you can do the following:
Select: Start and Run->cmd, enter the following command: Ant
If the following appears, the installation is successful:
Buildfile:build.xml does not exist!
Build failed

View version: Ant-version


However, if the following occurs, ' ant ' is not an internal or external command and is not a running program or batch file. 】

Indicates that the installation failed (you can repeat the preceding steps until the installation is successful.) )

Through the predecessors to provide information, and then implement the script as follows:

<project name= "Anthome" basedir= ". /"default=" main ">

<property name= "User" value= "root"/> <!-user Name
<property name= "passwd" value= "123456"/> <!-Password--

<property name= "M83" value= "192.168.124.83"/> <!-ip Address--

<property name= "TargetDir" value= "/home/weblogic/nmon_dir"/> <!-Path--

<property name= "Nmon_cmd" value= "./nmon_x86_64_sles11-f-t-r-test-s 5-c 60-f"/> <!-nmon location determine if you can run

<property name= "Nmon_filename" value= "nmon_vu_"/> <!-result command rules


<property name= "Nmon_filename_12" value= "${nmon_filename}12.nmon"/>


<property name= "Resultdir" value= "D:/result"/> <!-Save Results


<target name= "Main" >
</target>

<target name= "Run-nmon" >
<sshexec host= "${m12}" Username= "${user}" password= "${passwd}" trust= "true"
command= "CD ${targetdir};
${nmon_cmd} ${nmon_filename_12} "/>

</target>

<target name= "Copy-file" >
<SCP file= "${user}:${passwd}@${m12}:${targetdir}/${nmon_filename_12}" todir= "d:/" trust= "true"/>

</target>


<target name= "clean" >

<sshexec host= "${m12}" Username= "${user}" password= "${passwd}" trust= "true"
Command= "rm ${targetdir}/${nmon_filename_12}"/>


</target>

</project>

The above script saves the name: Build.xml and placed in the D packing directory;

1. Execute The ant command; <?xml:namespace prefix= "O" ns= "Urn:schemas-microsoft-com:office:office" >

?xml:namespace>

2. Locate The path ofthe installation apache-ant , thebulid.xml file is placed in the path, to modify the command, the name is in the XML and implement ant Run-nmon for monitoring;

3. after the monitoring is complete, download the document:ant Copy-file

4. Cleanup: Ant clean command

Thank you for your advice here.

May the people who are destined to use it. May the predecessors and the pioneers and their families safe and healthy;

Apache-ant combined Nmon native running monitoring database and server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.