`
y806839048
  • 浏览: 1119086 次
  • 性别: Icon_minigender_1
  • 来自: 上海
文章分类
社区版块
存档分类
最新评论

syslog

阅读更多
package com.ces.syslog;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.reflect.Field;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.ces.zwww.entity.SafetyAlarm;
import com.ces.zwww.utils.ZwwwConst;

/**
* syslog socket客户端
*
* @author Jusin
*
*/
public  class SyslogClient {

/**
* 以下变量形成配置文件
*/
private static String host = "218.242.122.196";
private String startCMD = "working";
private static int port = 20012;

private int timeout = 30*1000;
private int waitTimeout = 10*1000;

Socket client = null;
private static ObjectOutputStream out;
private static ObjectInputStream in;

public Object getSyslogMsg(){
Object message = null;
try {
Socket client = new Socket(host, port);
System.out.println("start:");
in = new ObjectInputStream(client.getInputStream());
out = new ObjectOutputStream(client.getOutputStream());
try {
message = in.readObject();

return message;
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}

public static void main(String[] args){
try {

List<SafetyAlarm> list = new ArrayList<SafetyAlarm>();
Socket client = new Socket(host, port);
System.out.println("start:");
//objectoutstream
in = new ObjectInputStream(client.getInputStream());
out = new ObjectOutputStream(client.getOutputStream());

System.out.println(System.currentTimeMillis());
Object message = null;
try {
message = in.readObject();
if (message instanceof Map) {
Map<String, String> map = (Map<String, String>) message;
System.out.println("client receive message is:" + map);
} else if(message instanceof List) {
//一个map装一个对象,这样就可以用另外一个map转化,接口中不同的属性名。
List<Map<String, Object>> messageList = (List<Map<String, Object>>) message;
if(messageList != null && messageList.size()>0){
for(Map<String, Object> m : messageList){
SafetyAlarm sa = new SafetyAlarm();
//m.entrySet()把map的键值对变为list
for (Map.Entry<String, Object> entry : m.entrySet()) {// 组装参数
String fieldKey = ZwwwConst.getSyslogFieldMap().get(entry.getKey());
setField(sa, fieldKey, entry.getValue());
}
list.add(sa);
}
}
} else {
System.out.println("The type of the message is not map!");
}
} catch(Exception e){
e.printStackTrace();
//this.clientStart();
}


} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

//属性设值
@SuppressWarnings("rawtypes")
private static void setField(Object bean,String fieldKey,Object fieldValue){
try {
Field field = bean.getClass().getDeclaredField(fieldKey);
field.setAccessible(true);
field.set(bean, fieldValue);
} catch (SecurityException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
/**
* socket的核心区域
*
* @throws IOException
* @throws InterruptedException
*/
private void socket() throws IOException, InterruptedException {
this.client = getSocketClient();
this.client.setSoTimeout(timeout);
out = new ObjectOutputStream(client.getOutputStream());
in = new ObjectInputStream(client.getInputStream());
out.writeObject(startCMD);
out.flush();
while (true) {
Object message = null;
try {
message = in.readObject();
//this.receiveMsg(message);
} catch(Exception e){
e.printStackTrace();
this.clientStart();
}
}
}

/**
* 获取socket客户端
*
* @param client
* @return
* @throws InterruptedException
*/
private Socket getSocketClient() throws InterruptedException {
Socket client = null;
while (true) {
try {
client = new Socket(host, port);
} catch (UnknownHostException e1) {
System.out.println("socket服务器IP或端口无法识别,有可能配置错误,请检查");
e1.printStackTrace();
Thread.sleep(waitTimeout);// 当链接失败的时候,等待60秒再连接一次
continue;
} catch (IOException e1) {
e1.printStackTrace();
Thread.sleep(waitTimeout);// 当链接失败的时候,等待60秒再连接一次
continue;
} finally {
if (client != null&&!client.isConnected()) {
try {
client.close();
} catch (IOException e) {
e.printStackTrace();
}
client = null;
}
}
break;
}
return client;
}

public void clientStart() throws InterruptedException {
while (true) {
try {
this.socket();
} catch (IOException e) {
e.printStackTrace();
continue;
}
}
}

}



package com.ces.syslog;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Map;

public class SyslogServer {

private ServerSocket ss;
private Socket socket;
private ObjectInputStream in;
private ObjectOutputStream out;
private int port = 6688;

public void start() throws ClassNotFoundException, InterruptedException {
while (true) {
try {
ss = new ServerSocket(port);
System.out.println("端口号:" + port + " socket服务启动成功!");
socket = ss.accept();
in = new ObjectInputStream(socket.getInputStream());
out = new ObjectOutputStream(socket.getOutputStream());

while (true) {
Object obj = in.readObject();
String line = null;
if (obj instanceof String) {
line = (String) obj;
}
System.out.println("you input is : " + obj);
if ("working".equals(line)) {
int count = 0;
while (true) {
for (int i = 0; i < 10; i++) {
Map<String, String> map = new HashMap<String, String>();
map.put("START_TIME", "2009-11-20 00:00:00");
map.put("END_TIME", "2009-11-20 00:00:00");
map.put("SRC_ADDRESS", "192.168.1.1");
map.put("SRC_PORT", "2322");
map.put("DEST_ADDRESS", "192.168.1.2");
map.put("DEST_PORT", "80");
map.put("DVC_EVENT_CATEGORY", "扫描");
map.put("MESSAGE", "发现端口扫描");
out.writeObject(map);
out.flush();
count++;
System.out.println(count + "服务端发送消息:"
+ map.toString());
}
Thread.sleep(10000);
}
}
}
} catch (Exception e) {
continue;
} finally {
try {
if (in != null)
in.close();
} catch (IOException e) {
e.printStackTrace();
}
try {
if (out != null)
out.close();
} catch (IOException e) {
e.printStackTrace();
}
try {
if (socket != null)
socket.close();
} catch (IOException e) {
e.printStackTrace();
}
try {
if (ss != null)
ss.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}

/*
* Socket socketConnection = new Socket(InetAddress.getLocalHost(), 6688);
* // 使用ObjectOutputStream和ObjectInputStream进行对象数据传输 ObjectOutputStream out
* = new ObjectOutputStream( socketConnection.getOutputStream());
* ObjectInputStream ins = new ObjectInputStream(
* socketConnection.getInputStream()); List<Map<String, Object>> radlist =
* (List<Map<String, Object>>) ins .readObject();
*/

public static void main(String[] args) throws UnknownHostException,
IOException, ClassNotFoundException, InterruptedException {
SyslogServer server = new SyslogServer();
server.start();

}
}






package com.ces.zwww.utils;

import java.util.HashMap;
import java.util.Map;

public class ZwwwConst {

public static final String HIGHCHARTS_COLORS[] = {"#8085e9","#7cb5ec","#90ed7d","#f7a35c","#434348","#f15c80","#e4d354","#8085e8","#8d4653","#91e8e1"};

public static final String TOPSEC_ASSET_PARAM = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><topsec><mode>asset_list</mode></topsec>";

public static final String ITSM_TICKETS = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><itsm><mode>tickets</mode></itsm>";

private static Map<String,String> syslogFieldMap = new HashMap<String,String>();

public static Map<String,String> getSyslogFieldMap() {
if(syslogFieldMap.isEmpty()){
syslogFieldMap.put("EVENT_ID","eventId");
syslogFieldMap.put("NAME","name");
syslogFieldMap.put("START_TIME","startTime");
syslogFieldMap.put("CUSTOMER","customer");
syslogFieldMap.put("EXTERNAL_ID","externalId");
syslogFieldMap.put("APP_PROTOCOL","appProtocol");
syslogFieldMap.put("END_TIME","endTime");
syslogFieldMap.put("EVENT_TYPE","eventType");
syslogFieldMap.put("DURATION","duration");
syslogFieldMap.put("CAT1_ID","cat1Id");
syslogFieldMap.put("CAT2_ID","cat2Id");
syslogFieldMap.put("CAT3_ID","cat3Id");
syslogFieldMap.put("CAT4_ID","cat4Id");
syslogFieldMap.put("PRIORITY","priority");
syslogFieldMap.put("MSG_ID","msgId");
syslogFieldMap.put("MESSAGE","message");
syslogFieldMap.put("BYTES_IN","bytesIn");
syslogFieldMap.put("BYTES_OUT","bytesOut");
syslogFieldMap.put("PACKETS_IN","packetsIn");
syslogFieldMap.put("PACKETS_OUT","packetsOut");
syslogFieldMap.put("BASE_EVENT_COUNT","baseEventCount");
syslogFieldMap.put("GENERATOR","generator");
syslogFieldMap.put("RAW_EVENT","rawEvent");
syslogFieldMap.put("TRANS_PROTOCOL","transProtocol");
syslogFieldMap.put("SESSION_ID","sessionId");
syslogFieldMap.put("CRYPTO_SIGNATURE","cryptoSignature");
syslogFieldMap.put("SEVERITY","severity");
syslogFieldMap.put("ORIGINATOR","originator");
syslogFieldMap.put("UUID","uuid");
syslogFieldMap.put("RESPONDS","responds");
syslogFieldMap.put("AUTH","auth");
syslogFieldMap.put("ORGANIZE","organize");
syslogFieldMap.put("OBJECT_ID","objectId");
syslogFieldMap.put("OBJECT_PARAM","objectParam");
syslogFieldMap.put("SIM_RULE","simRule");
syslogFieldMap.put("RESULT","result");
syslogFieldMap.put("SIGNATURE","signature");
syslogFieldMap.put("VULNERABILITY","vulnerability");
syslogFieldMap.put("CVE","cve");
syslogFieldMap.put("BID","bid");
syslogFieldMap.put("SOLUTION","solution");
syslogFieldMap.put("RISK_FACTOR","riskFactor");
syslogFieldMap.put("RELATED_VULN_TYPE","relatedVulnType");
syslogFieldMap.put("RELATED_VULN","relatedVuln");
syslogFieldMap.put("DB_NAME","dbName");
syslogFieldMap.put("TABLE_NAME","tableName");
syslogFieldMap.put("DB_CMD","dbCmd");
syslogFieldMap.put("DB_CONTENT","dbContent");
syslogFieldMap.put("SQL_KEY","sqlKey");
syslogFieldMap.put("FLAG","flag");
syslogFieldMap.put("REASON","reason");
syslogFieldMap.put("PARENTID","parentid");
syslogFieldMap.put("CONNID","connid");
syslogFieldMap.put("POLICY","policy");
syslogFieldMap.put("NATID","natid");
syslogFieldMap.put("FWRULE","fwrule");
syslogFieldMap.put("SA","sa");
syslogFieldMap.put("SN","sn");
syslogFieldMap.put("ROLES","roles");
syslogFieldMap.put("CLIENTEVENT","clientevent");
syslogFieldMap.put("SCMEVENT","scmevent");
syslogFieldMap.put("LEFTCLIENT","leftclient");
syslogFieldMap.put("RIGHTCLIENT","rightclient");
syslogFieldMap.put("TUNNELEVENT","tunnelevent");
syslogFieldMap.put("CHECKED","checked");
syslogFieldMap.put("NAV_VIRUS","navVirus");
syslogFieldMap.put("NAV_SCAN_TYPE","navScanType");
syslogFieldMap.put("NAV_VIRUS_LOCATION","navVirusLocation");
syslogFieldMap.put("NAV_PRIMARY_ACTION","navPrimaryAction");
syslogFieldMap.put("NAV_SENDARY_ACTION","navSendaryAction");
syslogFieldMap.put("OP","op");
syslogFieldMap.put("NORMAL_OBJECT","normalObject");
syslogFieldMap.put("VIRUS_OBJECT","virusObject");
syslogFieldMap.put("INT_PATH_INFO","intPathInfo");
syslogFieldMap.put("SENDER","sender");
syslogFieldMap.put("RECEIVER","receiver");
syslogFieldMap.put("SUBJECT","subject");
syslogFieldMap.put("RELAYER","relayer");
syslogFieldMap.put("MANAGER_ID","managerId");
syslogFieldMap.put("MANAGER_RECEIPT_TIME","managerReceiptTime");
syslogFieldMap.put("AGT_DOMAIN_ID","agtDomainId");
syslogFieldMap.put("AGT_TIER_ID","agtTierId");
syslogFieldMap.put("AGT_ADDRESS","agtAddress");
syslogFieldMap.put("AGT_DESCRIPTOR_ID","agtDescriptorId");
syslogFieldMap.put("AGT_RECEIPT_TIME","agtReceiptTime");
syslogFieldMap.put("AGT_SEVERITY","agtSeverity");
syslogFieldMap.put("DVC_ADDRESS","dvcAddress");
syslogFieldMap.put("DVC_PORT","dvcPort");
syslogFieldMap.put("DVC_NAME","dvcName");
syslogFieldMap.put("DVC_MAC_ADDRESS","dvcMacAddress");
syslogFieldMap.put("DVC_DESCRIPTOR_ID","dvcDescriptorId");
syslogFieldMap.put("DVC_EVENT_CATEGORY","dvcEventCategory");
syslogFieldMap.put("DVC_EVENT_CATEGORY2","dvcEventCategory2");
syslogFieldMap.put("DVC_EVENT_CATEGORY3","dvcEventCategory3");
syslogFieldMap.put("DVC_EVENT_CLASS_ID","dvcEventClassId");
syslogFieldMap.put("DVC_TYPE","dvcType");
syslogFieldMap.put("DVC_SEVERITY","dvcSeverity");
syslogFieldMap.put("DVC_FACILITY","dvcFacility");
syslogFieldMap.put("DVC_INBOUND_INTERFACE","dvcInboundInterface");
syslogFieldMap.put("DVC_OUTBOUND_INTERFACE","dvcOutboundInterface");
syslogFieldMap.put("DVC_PRODUCT","dvcProduct");
syslogFieldMap.put("DVC_RECEIPT_TIME","dvcReceiptTime");
syslogFieldMap.put("DVC_DOMAIN","dvcDomain");
syslogFieldMap.put("DVC_VENDOR","dvcVendor");
syslogFieldMap.put("DVC_DIRECTION","dvcDirection");
syslogFieldMap.put("DVC_PAYLOAD_ID","dvcPayloadId");
syslogFieldMap.put("DVC_PROCESS_NAME","dvcProcessName");
syslogFieldMap.put("DVC_ZONE","dvcZone");
syslogFieldMap.put("DVC_TRANS_ADDRESS","dvcTransAddress");
syslogFieldMap.put("DEV_TRANS_PORT","devTransPort");
syslogFieldMap.put("DVC_TRANS_ZONE","dvcTransZone");
syslogFieldMap.put("DVC_ASSET_ID","dvcAssetId");
syslogFieldMap.put("DVC_VLAN_NAME","dvcVlanName");
syslogFieldMap.put("DVC_VLAN_NUM","dvcVlanNum");
syslogFieldMap.put("DVC_CUSTOM_STRING1","dvcCustomString1");
syslogFieldMap.put("DVC_CUSTOM_STRING2","dvcCustomString2");
syslogFieldMap.put("DVC_CUSTOM_STRING3","dvcCustomString3");
syslogFieldMap.put("DVC_CUSTOM_STRING4","dvcCustomString4");
syslogFieldMap.put("DVC_CUSTOM_STRING5","dvcCustomString5");
syslogFieldMap.put("DVC_CUSTOM_STRING6","dvcCustomString6");
syslogFieldMap.put("DVC_CUSTOM_NUMBER1","dvcCustomNumber1");
syslogFieldMap.put("DVC_CUSTOM_NUMBER2","dvcCustomNumber2");
syslogFieldMap.put("DVC_CUSTOM_NUMBER3","dvcCustomNumber3");
syslogFieldMap.put("DVC_CUSTOM_Date1","dvcCustomDate1");
syslogFieldMap.put("DVC_CUSTOM_Date2","dvcCustomDate2");
syslogFieldMap.put("FILE_NAME","fileName");
syslogFieldMap.put("FILE_PATH","filePath");
syslogFieldMap.put("FILE_ID","fileId");
syslogFieldMap.put("FILE_TYPE","fileType");
syslogFieldMap.put("FILE_SIZE","fileSize");
syslogFieldMap.put("FILE_CREATE_TIME","fileCreateTime");
syslogFieldMap.put("FILE_MODIFICATION_TIME","fileModificationTime");
syslogFieldMap.put("FILE_PERMISSION","filePermission");
syslogFieldMap.put("FILE_HASH","fileHash");
syslogFieldMap.put("OLD_FILE_NAME","oldFileName");
syslogFieldMap.put("OLD_FILE_PATH","oldFilePath");
syslogFieldMap.put("OLD_FILE_ID","oldFileId");
syslogFieldMap.put("OLD_FILE_TYPE","oldFileType");
syslogFieldMap.put("OLD_FILE_SIZE","oldFileSize");
syslogFieldMap.put("OLD_FILE_CREATE_TIME","oldFileCreateTime");
syslogFieldMap.put("OLD_FILE_MODIFICATION_TIME","oldFileModificationTime");
syslogFieldMap.put("OLD_FILE_PERMISSION","oldFilePermission");
syslogFieldMap.put("OLD_FILE_HASH","oldFileHash");
syslogFieldMap.put("REQUEST_URL","requestUrl");
syslogFieldMap.put("REQUEST_METHOD","requestMethod");
syslogFieldMap.put("USERAGENT","useragent");
syslogFieldMap.put("REFERER","referer");
syslogFieldMap.put("REQUEST_STATUS","requestStatus");
syslogFieldMap.put("REQUEST_CONTEXT","requestContext");
syslogFieldMap.put("REQUEST_CLIENT_APPLICATION","requestClientApplication");
syslogFieldMap.put("REQUEST_COOKIES","requestCookies");
syslogFieldMap.put("REQUEST_OBJECT","requestObject");
syslogFieldMap.put("REQUEST_DOMAIN","requestDomain");
syslogFieldMap.put("DEST_ADDRESS","destAddress");
syslogFieldMap.put("DEST_PORT","destPort");
syslogFieldMap.put("DEST_HOST_NAME","destHostName");
syslogFieldMap.put("DEST_DNS_DOMAIN","destDnsDomain");
syslogFieldMap.put("DEST_NT_DOMAIN","destNtDomain");
syslogFieldMap.put("DEST_MAC_ADDRESS","destMacAddress");
syslogFieldMap.put("DEST_PROCESS_NAME","destProcessName");
syslogFieldMap.put("DEST_SERVICE_NAME","destServiceName");
syslogFieldMap.put("DEST_TRANS_ADDRESS","destTransAddress");
syslogFieldMap.put("DEST_TRANS_PORT","destTransPort");
syslogFieldMap.put("DEST_TRANS_ZONE","destTransZone");
syslogFieldMap.put("DEST_ZONE","destZone");
syslogFieldMap.put("DEST_USER_PRIVILEGES","destUserPrivileges");
syslogFieldMap.put("DEST_USER_NAME","destUserName");
syslogFieldMap.put("DEST_USER_ID","destUserId");
syslogFieldMap.put("DEST_ASSET_ID","destAssetId");
syslogFieldMap.put("DEST_GEO_ID","destGeoId");
syslogFieldMap.put("DEST_MAP_ADDRESS","destMapAddress");
syslogFieldMap.put("DEST_MAP_PORT","destMapPort");
syslogFieldMap.put("DEST_VLAN_NAME","destVlanName");
syslogFieldMap.put("DEST_VLAN_NUM","destVlanNum");
syslogFieldMap.put("SRC_ADDRESS","srcAddress");
syslogFieldMap.put("SRC_PORT","srcPort");
syslogFieldMap.put("SRC_HOST_NAME","srcHostName");
syslogFieldMap.put("SRC_DNS_DOMAIN","srcDnsDomain");
syslogFieldMap.put("SRC_NT_DOMAIN","srcNtDomain");
syslogFieldMap.put("SRC_MAC_ADDRESS","srcMacAddress");
syslogFieldMap.put("SRC_PROCESS_NAME","srcProcessName");
syslogFieldMap.put("SRC_SERVICE_NAME","srcServiceName");
syslogFieldMap.put("SRC_TRANS_ADDRESS","srcTransAddress");
syslogFieldMap.put("SRC_TRANS_PORT","srcTransPort");
syslogFieldMap.put("SRC_TRANS_ZONE","srcTransZone");
syslogFieldMap.put("SRC_ZONE","srcZone");
syslogFieldMap.put("SRC_USER_PRIVILEGES","srcUserPrivileges");
syslogFieldMap.put("SRC_USER_NAME","srcUserName");
syslogFieldMap.put("SRC_USER_ID","srcUserId");
syslogFieldMap.put("SRC_ASSET_ID","srcAssetId");
syslogFieldMap.put("SRC_GEO_ID","srcGeoId");
syslogFieldMap.put("SRC_VLAN_NAME","srcVlanName");
syslogFieldMap.put("SRC_VLAN_NUM","SRCVLANNUM");
syslogFieldMap.put("FLEX_NUMBER1","flexNumber1");
syslogFieldMap.put("FLEX_NUMBER1_LABEL","flexNumber1Label");
syslogFieldMap.put("FLEX_NUMBER2","flexNumber2");
syslogFieldMap.put("FLEX_NUMBER2_LABEL","flexNumber2Label");
syslogFieldMap.put("FLEX_STRING1","flexString1");
syslogFieldMap.put("FLEX_STRING1_LABEL","flexString1Label");
syslogFieldMap.put("FLEX_STRING2","flexString2");
syslogFieldMap.put("FLEX_STRING2_LABEL","flexString2Label");
syslogFieldMap.put("FLEX_Date1","flexDate1");
syslogFieldMap.put("FLEX_Date1_LABEL","flexDate1Label");
syslogFieldMap.put("LBL_DESCRIPTOR_ID","lblDescriptorId");
syslogFieldMap.put("CUSTOM1","custom1");
syslogFieldMap.put("CUSTOM2","custom2");
syslogFieldMap.put("CUSTOM3","custom3");
syslogFieldMap.put("CUSTOM4","custom4");
syslogFieldMap.put("CUSTOM5","custom5");
syslogFieldMap.put("CUSTOM6","custom6");
syslogFieldMap.put("CUSTOM7","custom7");
syslogFieldMap.put("CUSTOM8","custom8");
syslogFieldMap.put("CUSTOM_INTEGER1","customInteger1");
syslogFieldMap.put("CUSTOM_INTEGER2","customInteger2");
syslogFieldMap.put("CUSTOM_INTEGER3","customInteger3");
syslogFieldMap.put("CUSTOM_INTEGER4","customInteger4");
syslogFieldMap.put("CUSTOM_INTEGER5","customInteger5");
syslogFieldMap.put("CUSTOM_INTEGER6","customInteger6");
syslogFieldMap.put("CUSTOM_INTEGER7","customInteger7");
syslogFieldMap.put("CUSTOM_INTEGER8","customInteger8");
syslogFieldMap.put("CUSTOM_LONG1","customLong1");
syslogFieldMap.put("CUSTOM_LONG2","customLong2");
syslogFieldMap.put("CUSTOM_LONG3","customLong3");
syslogFieldMap.put("CUSTOM_LONG4","customLong4");
syslogFieldMap.put("CUSTOM_LONG5","customLong5");
syslogFieldMap.put("CUSTOM_LONG6","customLong6");
syslogFieldMap.put("CUSTOM_LONG7","customLong7");
syslogFieldMap.put("CUSTOM_LONG8","customLong8");
syslogFieldMap.put("TABLE_SPACE","tableSpace");
syslogFieldMap.put("FILE_SYSTEM","fileSystem");
syslogFieldMap.put("STATUS","status");
syslogFieldMap.put("CAPABILITY","capability");
syslogFieldMap.put("USED","used");
syslogFieldMap.put("AVAILABLE","available");
syslogFieldMap.put("AC_PERCENT","acPercent");
syslogFieldMap.put("UC_PERCENT","ucPercent");
syslogFieldMap.put("MIN_VALUE","minValue");
syslogFieldMap.put("AVG_VALUE","avgValue");
syslogFieldMap.put("MAX_VALUE","maxValue");
syslogFieldMap.put("CPU_USED_PERCENT","cpuUsedPercent");
syslogFieldMap.put("MEM_USED_PERCENT","memUsedPercent");
syslogFieldMap.put("DISK_USED_PERCENT","diskUsedPercent");
syslogFieldMap.put("SESSION_COUNT","sessionCount");
syslogFieldMap.put("SESSION_PERCENT","sessionPercent");
}
return syslogFieldMap;
}
}



分享到:
评论
发表评论

文章已被作者锁定,不允许评论。

相关推荐

    MT_Syslog.exe中文版 MT_Syslog中文版

    MT_Syslog MT_Syslog.exe MT_Syslog中文版 ros日志远程记录 ros日志 网上找了好久也没有找到个中文版的,很是郁闷,最后干脆我自己做个汉化要点分不好意思啊,花了我半天的时间翻译,编译的,一点辛苦,有的地方,不...

    Syslog4j首页、文档和下载 - Syslog协议的Java版 - 开源中国社区.pdf

    ### Syslog4j知识点概述 #### 一、Syslog4j简介 Syslog4j是一款遵循RFC3164标准的Syslog协议的Java实现。它支持多种通信协议,包括UDP/IP、TCP/IP、TCP/IP over SSL/TLS、Unix Syslog和Unix Socket等。Syslog4j...

    SYSLOG日志数据采集实现

    ### SYSLOG日志数据采集实现 #### 一、引言 在网络安全管理中,日志数据的采集至关重要。通过对各种安全设备的日志信息进行收集与分析,可以及时发现潜在的安全威胁,确保网络环境的安全稳定。SYSLOG作为一种广泛...

    kiwi syslog server 9.5

    Kiwi Syslog Server安装教程: 1. 运行Kiwi_Syslog_Server_9.5.0.setup.exe安装程序 2. 安装完成退出程序 3. 拷贝SolarWinds.Licensing.Framework.dll和ufmod.dll两个文件到软件安装目录,选择覆盖目的文件 4. 运行...

    各设备syslog配置手册

    syslog 配置方法详解 Syslog 是一种常见的日志记录协议,用于收集和管理网络设备的日志信息。在网络设备中,syslog 配置是非常重要的,因为它可以帮助网络管理员实时监控网络设备的状态,及时发现和解决网络问题。...

    syslog日志可视化工具

    Syslog日志可视化工具是一种专门用于管理和分析使用syslog协议收集的日志数据的软件或插件。Syslog协议是网络设备、操作系统和其他软件用来记录事件和错误信息的标准。这种工具通常具有用户友好的界面,可以方便地...

    SysLog日志工具1

    例如,`syslog_enable`参数控制是否启用SYSLOG,`syslog_protocol`定义传输协议,`syslog_host`和`syslog_port`分别设置服务器的IP地址和监听端口,而`syslog_charset`设定字符编码。 三、SYSLOG预置数据 在示例中...

    syslog工具(win10可以用)

    syslog工具(win10可以用)syslog工具(win10可以用)syslog工具(win10可以用)syslog工具(win10可以用)syslog工具(win10可以用)syslog工具(win10可以用)syslog工具(win10可以用)syslog工具(win10可以用)syslog工具(win10...

    syslog4j-0.9.46.zip

    syslog4j是一款Java库,专门用于处理syslog(系统日志)协议的发送与接收。syslog协议是一种广泛应用于网络设备、操作系统和应用程序的日志记录标准,它允许系统管理员集中收集和分析来自不同源的日志信息。syslog4j...

    如何在windows服务器中使用syslog功能

    在Windows服务器环境中,syslog是一种广泛使用的日志记录协议,主要用在Unix和Linux系统中。然而,随着跨平台需求的增长,Windows服务器也开始支持syslog服务,以便与不同操作系统之间的日志集成。以下是对如何在...

    syslog-ng安装包及安装步骤

    syslog-ng是一款强大的日志管理工具,用于收集、解析、过滤和转发系统日志。它在Linux和其他类Unix系统中广泛使用,提供了更高级的功能,比如支持多种协议、过滤规则和目的地,使得日志管理更加灵活和高效。下面将...

    [日志分析工具]Syslog Watcher 5

    Syslog Watcher 5是一款强大的日志分析工具,专为IT专业人员设计,用于收集、监控和分析系统日志。在软件调试过程中,它扮演着至关重要的角色,帮助用户快速定位和解决问题,提高工作效率。 首先,我们要理解什么是...

    java发送syslog日志,支持多目的ip

    Java发送Syslog日志是一种常见的系统日志管理方式,尤其在分布式系统中,它能帮助开发者收集、分析和处理来自不同节点的日志信息。Syslog协议是一个标准的日志消息传递协议,广泛应用于网络设备、操作系统和其他软件...

    windows syslog server测试工具

    在IT行业中,日志管理是系统运维工作的重要组成部分,尤其对于服务器监控和故障排查来说,syslog服务扮演了至关重要的角色。Syslog是一种标准的日志协议,广泛应用于各种网络设备、操作系统和应用程序,用于收集和...

    redhat syslog 配置 笔记

    ### Redhat Syslog 配置详解 #### 一、Syslog 概述 Syslog(系统日志)是一项广泛应用于Linux系统中的日志记录服务,主要用于收集和存储来自不同应用程序和系统组件的日志数据。在Redhat Linux环境中,Syslog服务...

    windows下专用kiwi syslog日志服务器安装教程

    ### Windows 下专用 Kiwi Syslog 日志服务器安装教程 #### 一、概述 在Windows平台上部署Syslog日志服务器能够帮助管理员收集、管理和分析来自网络设备的日志信息,这对于网络安全监控、故障排查等方面具有重要...

    将Kiwi Syslog数据导入SQL 2008

    ### 将Kiwi Syslog数据导入SQL 2008 #### 一、Kiwi Syslog简介 Kiwi Syslog是一款强大的日志管理工具,它能够接收来自各种设备的日志信息,并提供统一的管理和监控平台。这对于网络管理员来说非常有用,可以帮助...

    syslog协议发送日志(java)

    syslog协议是网络设备、操作系统和应用程序之间广泛使用的标准日志记录协议,它允许系统将日志消息发送到中央日志服务器,便于管理和分析。在Java环境中实现syslog协议发送日志,我们可以利用相关的库或者自定义编程...

    syslog4j-0.9.46.jar (解决消息内容发送不完整问题)

    syslog4j是一个Java库,专门用于处理和发送syslog协议的消息。Syslog是一种标准的日志记录协议,常用于在网络设备、服务器和其他系统之间传输日志信息。在标题提到的`syslog4j-0.9.46.jar`版本中,主要解决了消息...

    H3C_syslog配置

    H3C_SYSLOG 配置指南 H3C_SYSLOG 是华三系统日志使用讲解,用于记录和管理网络设备日志。 Syslog 是一个 Industry-standard protocol,用于记录网络设备的日志信息。通过 Syslog,可以实时监控网络设备的状态、诊断...

Global site tag (gtag.js) - Google Analytics