AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-34175

hackerhasid's questions

Martin Hope
hackerhasid
Asked: 2012-07-15 19:27:53 +0800 CST

rsyslog 不记录消息

  • 6

我正在尝试设置我的 ec2 实例(运行 amazon linux,据我所知,它是建立在 RHEL 5 上的)将日志消息转发到 loggentries.com,但没有任何内容被转发。作为健全性检查,我按照本文中的说明将另一个 EC2 实例设置为中央服务器,发现没有收到消息。所以我尝试logger -p cron.info TEST在客户端机器上执行,发现/var/log/cron 中没有添加任何内容!显然有些东西不起作用!但是 rsyslogd 正在运行:

ps 辅助 | grep rsys

产出

根 25362 0.0 0.0 183768 1328 ?Sl 14:27 0:00 /sbin/rsyslogd -i /var/run/syslogd.pid -c 5

作为参考,这里是 rsyslog.conf(暂时删除了转发内容,直到我让它在本地工作)

#### MODULES ####

$ModLoad imuxsock.so    # provides support for local system logging (e.g. via logger command)
$ModLoad imklog.so      # provides kernel logging support (previously done by rklogd)
#$ModLoad immark.so     # provides --MARK-- message capability

# Provides UDP syslog reception
#$ModLoad imudp.so
#$UDPServerRun 514

# Provides TCP syslog reception
#$ModLoad imtcp.so  
#$InputTCPServerRun 514


#### GLOBAL DIRECTIVES ####

# Use default timestamp format
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

# File syncing capability is disabled by default. This feature is usually not required, 
# not useful and an extreme performance hit
#$ActionFileEnableSync on


#### RULES ####

# Log all kernel messages to the console.
# Logging much else clutters up the screen.
kern.*                                                 /dev/console

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none                /var/log/messages

# The authpriv file has restricted access.
authpriv.*                                              /var/log/secure

# Log all the mail messages in one place.
mail.*                                                  -/var/log/maillog


# Log cron stuff
cron.*                                                  /var/log/cron

# Everybody gets emergency messages
*.emerg                                                 *

# Save news errors of level crit and higher in a special file.
uucp,news.crit                                          /var/log/spooler

# Save boot messages also to boot.log
local7.*                                                /var/log/boot.log
linux amazon-ec2 syslog rsyslog
  • 1 个回答
  • 24802 Views
Martin Hope
hackerhasid
Asked: 2012-07-05 05:07:31 +0800 CST

启动脚本不在 amazon linux 上执行

  • 2

我正在尝试将 syslog 转发到 logentries.com,这需要在 /etc/rsyslog.conf 中添加一行,到目前为止一切顺利。但是,我在 amazon elastic beanstalk 上运行并且有 3 个环境(开发、暂存、生产),我想根据环境路由到不同的端口(logentries 根据转发的端口区分环境)

我创建了一个在端口 8001 上运行的 apache 站点,它只输出我想用于这个特定服务器的端口(因为弹性 beanstalk 容器属性附加到 php.ini,我需要一种方法来输出 php.ini 变量)。然后我写了一个脚本:

#!/bin/bash
LOGENTRIES_PORT=`curl 127.0.0.1:8001`
if [ "${LOGENTRIES_PORT}" == '' ]; then
  exit -1
fi

echo "*.* @@46.51.181.128:${LOGENTRIES_PORT}" >> /etc/rsyslog.conf
service rsyslog restart

从终端运行时效果很好,但我似乎无法在启动时运行。

我把它插在里面/etc/rc.d/rc.local,我把它插进去/etc/rc.d/rc3.d/S99logentries(777烫发)但没有运气。任何想法为什么会这样?

amazon-web-services startup-scripts
  • 1 个回答
  • 429 Views
Martin Hope
hackerhasid
Asked: 2012-06-19 09:15:30 +0800 CST

bash 选项卡补全仅适用于 root

  • 9

我设置了一个 Ubuntu 12 服务器(在 rackspace 云上使用他们的预配置图像)并创建了一个非 root 用户。当我以标准用户身份登录时,在终端按 [TAB] 输出一个实际的选项卡并按 [UP] 输出 ^[[A 。但是,如果我以 root 身份登录,[UP] 将输入我的最后一个命令并且 [TAB] 会自动完成。

.bashrc 文件在两个用户之间看起来完全一样。我真的不知道还有什么地方可以看。

ubuntu bash command-line-interface bashrc ubuntu-12.04
  • 1 个回答
  • 2211 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve