qingkuangs 发表于 2018-11-25 10:30:04

RSA \envision Redhat linux Apache tomcat日志收集

注意:所有操作都需要用root用户.

步骤:
1.到support.rsa.com下载apache的最新的nicsftpagent.sh文件模板,然后根据实际情况修改。
Nicsftpagent.sh文件需要修改的部分(红色部分)
=================================================
#!/bin/bash
#### Copyright Notice:
####
#### Copyright (c) 2007 Network Intelligence Corporation
####
#### Warning: This computer program is protected by copyright law and
#### international treaties.Unauthorized reproduction or distribution
#### of this program, or any portion of it, may result in severe civil
#### and criminal penalties, and will be prosecuted to the maximum
#### extent possible under the law.
####
#### RSA, The Security Division of EMC - Automated FTP/SCP/SFTP Script v2.7.11
####
###################
####
####   Begin User configuration
####
##########
########
######
####
#SILENT MODE
#produce no output to the console;
#set this to true when running from cron
#to reduce emails sent to root.
#SILENT=true
# Have the Solaris POSIX compliant binaries first in the path.
# The /usr/bin directory in Solaris doesn't have POSIX compliant
# binaries. This is particularly a problem for the awk command we are
# using. (ECE-138)
PATH=/usr/xpg6/bin:/usr/xpg4/bin:/usr/css/bin:$PATH
## Enter the hostname/IP address of the enVision machine to which you want to
## send the data files
ENVISION=128.168.100.201
## [改成envision IP]


## Enter the directories where the data files, which you need to send, exist.Separate
## multiple directories with a colon (:).This script must have read permissions
## to the directories.
## Example for multiple folders DATA_DIRECTORY=/var/log/:/var/log/audit

DATA_DIRECTORY=/opt/IBM/HTTPServer/logs/
## 在linux上的日志存放目录,默认是把该目录下的.log文件全部上传,可以通过修改以下字段来达到读取其他文件的目的: FILESPEC=*.log]

## The directory on the enVision box where the files should be written to.This directory
## is relative to the enVision/ftp_files directory.If the directory name contains a
## space it will need to be double escaped.For example, if the directory name is
## "name with spaces", the variable needs to be set to "name\ with\ spaces".

ENVISION_DIRECTORY=APACHE_128.168.100.2
## 【envision上存放日志文件的目录e:\nic\4100\设备名\ftp_files\,该目录需要先在envision上创建file reader的devices以后会自动产生】

## The script keeps its persistent information in a directory.The
## script must have read and write permissions to this directory.

NIC_DIRECTORY=/usr/local/nic
## 【linux 中nicsftpagent.sh文件存放的目录,默认不存在,需要通过mkdir /usr/local/nic创建】

## TRANSFER_METHOD=SFTP/SCP/FTP
## Select the method used to transfer the files to enVision.SFTP is recommended.
## valid options are FTP, SFTP and SCP

TRANSFER_METHOD=SFTP
## 【默认是FTP,需要改为SFTP】

## Enter a username (ftp default: anonymous; SFTP/SCP default: nic_sshd)

USERNAME=nic_sshd
## 【由于上一个字段把传输方式改成SFTP,所以需要把用户名改为nic_sshd】


## Enter a password (anonymous connections accept any password)
PASSWORD=default
## Enter the identity/private key file for the user specified above user
## default is $HOME/.ssh/id_rsa
IDENTITY=~/.ssh/id_rsa
## Enter the file matching specification."*" will send any files in the directory. Separate
## multiplefielnames with a colon (:).
## Example for multiple files::
## FILESPEC=*.log:xyz.log
FILESPEC=*.log
#[修改此字段可以让这脚本读取指定的文件,如:改成 FILESPEC=test.txt,则脚本会把DATA_DIRECTORY字段定义的目录下的test.txt文件上传到指定目录]




2.修改完成后上传到Linux,存放在/usr/local/nic目录下,须先创建/usr/local/nic目录。
注意:上传的时候一定要使用ASCII方式。
方法:
(1) 可以通过SecureCRT工具的ASCII文件传输功能,通过执行rz命令可以实现。参考:http://blog.csdn.net/tianlesoftware/article/details/7746005?1350988490

一般来说,安装linux可能没有把windows工具传输文件特别不方便,可以在安装工作
页: [1]
查看完整版本: RSA \envision Redhat linux Apache tomcat日志收集