设为首页 收藏本站
查看: 1141|回复: 0

[经验分享] RSA \envision Redhat linux Apache tomcat日志收集

[复制链接]

尚未签到

发表于 2018-11-25 10:30:04 | 显示全部楼层 |阅读模式
注意:所有操作都需要用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/
## [apachelinux上的日志存放目录,默认是把该目录下的.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 readerdevices以后会自动产生】

## 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、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-639308-1-1.html 上篇帖子: Apache Mina使用JSON数据进行通信的使用方法 下篇帖子: Tomcat与Apache或Nginx的集群负载均衡设置及Sersync同步应用(1)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表