CollWindowsSoapHelper.java 10.4 KB
package com.sitech.ismp.coll.tivoli;

public class CollWindowsSoapHelper {
	//private static String HUB_NAME=SoapParam.getString("HUB_NAME");
	private static String USER ="sysadmin";
	private static String PASSWORD= SoapParam.getString("PASS");	
	
	public static String getNT_System( String host_name)
	{
		StringBuffer result = new StringBuffer();
		String OBJECT="NT_System";
		result.append("	<CT_Get>                                  ");
		result.append("		<object>"+OBJECT+"</object>  		  ");
		result.append("	    <target>Primary:"+host_name+":NT</target>	  ");
		result.append("		<userid>"+USER+"</userid> 			  ");
		result.append("		<password>"+PASSWORD+"</password>     ");
		result.append("		<history>N</history>                  ");
		//attributes
		result.append("		<attribute>	Server_Name	</attribute>  ");
		result.append("		<attribute>	Operating_System_Type	</attribute>  ");
		result.append("		<attribute>	Operating_System_Version	</attribute>  ");
		result.append("		<attribute>	Processor_Queue_Length	    </attribute>  ");
		result.append("		<attribute>	Processor_Type         	    </attribute>  ");
		result.append("		<attribute>	Number_of_Processors	    </attribute>  ");
		result.append("		<attribute>	Network_Address          	</attribute>  ");
		result.append("		<attribute>	Total_Memory_Size 	        </attribute>  ");
		result.append("		<attribute> Total_Privileged_Time  	</attribute>  ");
		result.append("		<attribute>	Total_Processor_Time	</attribute>  ");
		result.append("		<attribute>	Total_User_Time	</attribute>  ");
		/*result.append("		<attribute>	%_Total_Privileged_Time  	</attribute>  ");
		result.append("		<attribute>	%_Total_Processor_Time	</attribute>  ");
		result.append("		<attribute>	%_Total_User_Time	</attribute>  ");*/
		result.append("		<attribute>	Total_InterruptsSec	</attribute>  ");
		
		result.append("		<attribute>	Page_File_Size	</attribute>  ");
		
		result.append("	</CT_Get>                                 ");
		return result.toString();	
	}
	public static String getSoap_cpu_SMPCPU(String soap_host_name){
		StringBuffer result = new StringBuffer();
		String OBJECT="NT_Processor";
		result.append("	<CT_Get>                                  ");
		result.append("		<object>"+OBJECT+"</object>  		  ");
		result.append("	    <target>Primary:"+soap_host_name+":NT</target>	  ");
		result.append("		<userid>"+USER+"</userid> 			  ");
		result.append("		<password>"+PASSWORD+"</password>     ");
		result.append("		<history>N</history>                  ");
		//attributes
		result.append("		<attribute>	Interruptssec	</attribute>  ");
		result.append("		<attribute>	Server_Name	</attribute>  ");
		result.append("		<attribute>	Processor	</attribute>  ");
		/*result.append("		<attribute>	%_Privileged_Time	</attribute>  ");
		result.append("		<attribute>	%_Processor_Time	</attribute>  ");
		result.append("		<attribute>	%_User_Time	</attribute>  ");*/
		result.append("		<attribute>	Privileged_Time	</attribute>  ");
		result.append("		<attribute>	Processor_Time	</attribute>  ");
		result.append("		<attribute>	User_Time	</attribute>  ");

		result.append("		<attribute>	DPC_Bypassessec	</attribute>  ");
		result.append("		<attribute>	DPC_Rate	</attribute>  ");
		result.append("		<attribute>	DPC_Queuedsec	</attribute>  ");
		/*result.append("		<attribute>	%_DPC_Time	</attribute>  ");
		result.append("		<attribute>	%_Interrupt_Time	</attribute>  ");
		*/
		result.append("		<attribute>	DPC_Time	</attribute>  ");
		result.append("		<attribute>	Interrupt_Time	</attribute>  ");
		
		result.append("	</CT_Get>                                 ");
		return result.toString();	
	}
	public static String getSoap_processor_Information(String soap_host_name){
		StringBuffer result = new StringBuffer();
		String OBJECT="NT_Processor_Information";
		result.append("	<CT_Get>                                  ");
		result.append("		<object>"+OBJECT+"</object>  		  ");
		result.append("	    <target>Primary:"+soap_host_name+":NT</target>	  ");
		result.append("		<userid>"+USER+"</userid> 			  ");
		result.append("		<password>"+PASSWORD+"</password>     ");
		result.append("		<history>N</history>                  ");
		//attributes
		result.append("		<attribute>	Current_Clock_Speed	</attribute>  ");
		result.append("		<attribute>	Processor_Name	</attribute>  ");
		result.append("		<attribute>	Load_Percentage	</attribute>  ");
		/*result.append("		<attribute>	%_Privileged_Time	</attribute>  ");
		result.append("		<attribute>	%_Processor_Time	</attribute>  ");
		result.append("		<attribute>	%_User_Time	</attribute>  ");*/
		result.append("		<attribute>	Processor_Manufacturer	</attribute>  ");
		//result.append("		<attribute>	Processor_Time	</attribute>  ");
		result.append("		<attribute>	Processor_Description	</attribute>  ");
		result.append("		<attribute>	Processor_Device_ID	</attribute>  ");
		result.append("		<attribute>	Processor_ID	</attribute>  ");
		
		result.append("	</CT_Get>                                 ");
		return result.toString();	
	}
	public static String getSoap_NT_Memory(String soap_host_name){
		StringBuffer result = new StringBuffer();
		String OBJECT="NT_Memory";
		result.append("	<CT_Get>                                  ");
		result.append("		<object>"+OBJECT+"</object>  		  ");
		result.append("	    <target>Primary:"+soap_host_name+":NT</target>	  ");
		result.append("		<userid>"+USER+"</userid> 			  ");
		result.append("		<password>"+PASSWORD+"</password>     ");
		result.append("		<history>N</history>                  ");
		//attributes
		result.append("		<attribute>	Pages_OutputSec	</attribute>  ");
		result.append("		<attribute>	Pages_InputSec	    </attribute>  ");
		result.append("		<attribute>	Pagessec	        </attribute>  ");
		//虚拟内存
		result.append("		<attribute>	Available_kBytes	</attribute>  ");
		result.append("		<attribute>	Available_Usage_Percentage	</attribute>  ");
		result.append("		<attribute>	Total_Memory_mBytes	</attribute>  ");
		result.append("		<attribute>	Memory_Usage_Percentage	</attribute>  ");
		result.append("	</CT_Get>                                 ");
		return result.toString();	
	}
	public static String getSoap_NT_Disk(String soap_host_name){
		StringBuffer result = new StringBuffer();
		String OBJECT="NT_Logical_Disk";
		result.append("	<CT_Get>                                  ");
		result.append("		<object>"+OBJECT+"</object>  		  ");
		result.append("	    <target>Primary:"+soap_host_name+":NT</target>	  ");
		result.append("		<userid>"+USER+"</userid> 			  ");
		result.append("		<password>"+PASSWORD+"</password>     ");
		result.append("		<history>N</history>                  ");
		//attributes
		result.append("		<attribute>	Free_Megabytes	</attribute>  ");
		result.append("		<attribute>	Total_Size	    </attribute>  ");
		result.append("		<attribute>	Used	        </attribute>  ");
		result.append("		<attribute>	Free	</attribute>  ");
		result.append("		<attribute>	Disk_Name	</attribute>  ");
		result.append("	</CT_Get>                                 ");
		return result.toString();	
	}
	
	public static String getSoap_NT_Physic_Disk(String soap_host_name){
		StringBuffer result = new StringBuffer();
		String OBJECT="NT_Physical_Disk";
		result.append("	<CT_Get>                                  ");
		result.append("		<object>"+OBJECT+"</object>  		  ");
		result.append("	    <target>Primary:"+soap_host_name+":NT</target>	  ");
		result.append("		<userid>"+USER+"</userid> 			  ");
		result.append("		<password>"+PASSWORD+"</password>     ");
		result.append("		<history>N</history>                  ");
		//attributes
		result.append("		<attribute>	Disk_TransfersSec	            </attribute>  ");
		result.append("		<attribute>	Disk_BytesSec	                </attribute>  ");
		result.append("		<attribute>	Disk_Read_BytesSec 	            </attribute>  ");
		result.append("		<attribute>	Disk_Write_BytesSec	            </attribute>  ");
		result.append("		<attribute>	Avg_Disk_MillisecondsTransfer	</attribute>  ");
		result.append("		<attribute>	Disk_Time	                    </attribute>  ");
		result.append("		<attribute>	Disk_Idle_Time	                </attribute>  ");
		result.append("		<attribute>	Disk_Number	                </attribute>  ");
		result.append("		<attribute>	Disk_Name	                </attribute>  ");
		
		result.append("	</CT_Get>                                 ");
		return result.toString();	
	}
	
	public static String getSoap_NT_Process(String soap_host_name){
		StringBuffer result = new StringBuffer();
		String OBJECT="NT_Process";
		result.append("	<CT_Get>                                  ");
		result.append("		<object>"+OBJECT+"</object>  		  ");
		result.append("	    <target>Primary:"+soap_host_name+":NT</target>	  ");
		result.append("		<userid>"+USER+"</userid> 			  ");
		result.append("		<password>"+PASSWORD+"</password>     ");
		result.append("		<history>N</history>                  ");
		//attributes
		result.append("		<attribute>	Binary_Path	            </attribute>  ");
		result.append("		<attribute>	Avg__Processor_Time 	                </attribute>  ");
		result.append("		<attribute>	ID_Process 	            </attribute>  ");
		result.append("		<attribute>	Handle_Count	            </attribute>  ");
		result.append("		<attribute>	Private_kBytes	</attribute>  ");
		result.append("		<attribute>	User	                    </attribute>  ");
		result.append("		<attribute>	Process_Count 	                </attribute>  ");
		result.append("		<attribute>	Elapsed_Time 	                </attribute>  ");
		result.append("		<attribute>	Process_Name 	                </attribute>  ");
		result.append("		<attribute>	Timestamp 	                </attribute>  ");
		
		result.append("	</CT_Get>                                 ");
		return result.toString();	
	}
	public static String getSoap_NT_network(String soap_host_name){
		StringBuffer result = new StringBuffer();
		String OBJECT="NT_Network_Interface";
		result.append("	<CT_Get>                                  ");
		result.append("		<object>"+OBJECT+"</object>  		  ");
		result.append("	    <target>Primary:"+soap_host_name+":NT</target>	  ");
		result.append("		<userid>"+USER+"</userid> 			  ");
		result.append("		<password>"+PASSWORD+"</password>     ");
		result.append("		<history>N</history>                  ");
		//attributes
		result.append("		<attribute>	Network_Interface_Instance	            </attribute>  ");
		result.append("		<attribute>	Current_Bandwidth  	                </attribute>  ");
		result.append("		<attribute>	IPv4_Address 	            </attribute>  ");
		
		result.append("	</CT_Get>                                 ");
		return result.toString();	
	}
	
}