AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / server / Perguntas / 817510
Accepted
WoJ
WoJ
Asked: 2016-11-29 08:19:26 +0800 CST2016-11-29 08:19:26 +0800 CST 2016-11-29 08:19:26 +0800 CST

Por que as mensagens syslog não são encaminhadas apesar de terem a configuração apropriada?

  • 772

Gostaria de encaminhar ( rsyslog 8.4.2-1) todas as mensagens syslog para uma porta em 127.0.0.1. Para fazer isso, adicionei um arquivo em /etc/rsyslog.d/expose-42000.conf:

*.* @127.0.0.1:42000

Depois de reiniciar o rsyslog (sem mensagens de erro nos logs), tentei ouvir as mensagens recebidas:

netcat -u 127.0.0.1 42000

Não houve saída, apesar de ter mensagens aparecendo no formato /var/log/syslog.

Para ter certeza de que o arquivo está realmente incluído, executei rsyslogd no modo de depuração e vejo que a inclusão acontece:

# rsyslogd -dn
(...)
8836.556859167:main thread    : requested to include config file '/etc/rsyslog.d/expose-42000.conf'
8836.556895084:main thread    : config parser: pushed file /etc/rsyslog.d/expose-42000.conf on top of stack
Next token is token PRIFILT ()
Shifting token PRIFILT ()
Entering state 14
Reading a token: Next token is token LEGACY_ACTION ()
Shifting token LEGACY_ACTION ()
Entering state 12
Reducing stack by rule 35 (line 168):
   $1 = token LEGACY_ACTION ()
8836.557893160:main thread    : tried selector action for builtin:omfile: -2001
8836.557908388:main thread    : tried selector action for builtin:ompipe: -2001
8836.557923233:main thread    : tried selector action for builtin-shell: -2001
8836.558022055:main thread    : tried selector action for builtin:omdiscard: -2001
8836.558038075:main thread    : tried selector action for builtin:omfwd: 0
8836.558052488:main thread    : Module builtin:omfwd processes this action.
8836.558136499:main thread    : template: 'RSYSLOG_TraditionalForwardFormat' assigned
8836.558160039:main thread    : action 1 queue: parameter dump:
8836.558174916:main thread    : action 1 queue: queue.filename '[NONE]'
8836.558273542:main thread    : action 1 queue: queue.size: 1000
8836.558288080:main thread    : action 1 queue: queue.dequeuebatchsize: 16
8836.558302414:main thread    : action 1 queue: queue.maxdiskspace: 0
8836.558368788:main thread    : action 1 queue: queue.highwatermark: -1
8836.558384865:main thread    : action 1 queue: queue.lowwatermark: -1
8836.558413762:main thread    : action 1 queue: queue.fulldelaymark: -1
8836.558442666:main thread    : action 1 queue: queue.lightdelaymark: -1
8836.558470770:main thread    : action 1 queue: queue.discardmark: 980
8836.558552633:main thread    : action 1 queue: queue.discardseverity: 8
8836.558594909:main thread    : action 1 queue: queue.checkpointinterval: 0
8836.558608920:main thread    : action 1 queue: queue.syncqueuefiles: 0
8836.558623042:main thread    : action 1 queue: queue.type: 3 [Direct]
8836.558691335:main thread    : action 1 queue: queue.workerthreads: 1
8836.558727077:main thread    : action 1 queue: queue.timeoutshutdown: 0
8836.558741599:main thread    : action 1 queue: queue.timeoutactioncompletion: 1000
8836.558827751:main thread    : action 1 queue: queue.timeoutenqueue: 50
8836.558855694:main thread    : action 1 queue: queue.timeoutworkerthreadshutdown: 60000
8836.558869846:main thread    : action 1 queue: queue.workerthreadminimummessages: -1
8836.558884102:main thread    : action 1 queue: queue.maxfilesize: 1048576
8836.558950182:main thread    : action 1 queue: queue.saveonshutdown: 1
8836.558983020:main thread    : action 1 queue: queue.dequeueslowdown: 0
8836.558997187:main thread    : action 1 queue: queue.dequeuetimebegin: 0
8836.559011113:main thread    : action 1 queue: queuedequeuetimend.: 25
8836.559025491:main thread    : Action 0xb97a40: queue 0xb99120 created
-> $$ = nterm s_act ()
Stack now 0 1 14
Entering state 22
Reducing stack by rule 32 (line 164):
   $1 = nterm s_act ()
-> $$ = nterm actlst ()
Stack now 0 1 14
Entering state 21
Reading a token: 8836.559386173:main thread    : config parser: reached end of file /etc/rsyslog.d/expose-42000.conf
8836.559390418:main thread    : config parser: resume parsing of file /etc/rsyslog.conf at line 51
(...)

Há algo que estou perdendo?

syslog rsyslog
  • 1 1 respostas
  • 679 Views

1 respostas

  • Voted
  1. Best Answer
    A.B
    2016-11-29T11:31:20+08:002016-11-29T11:31:20+08:00

    Acho que está tudo bem, mas seu uso do netcat.

    Peguei sua alteração de configuração literalmente, executei syslogd -dn

    Mas então eu corri isso:

    nc -u -l -p 42000
    

    E obtive os logs conforme o esperado. -lé para ouvir. Seu comando estava tentando se conectar a uma porta UDP não aberta/de escuta.

    • 4

relate perguntas

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Você pode passar usuário/passar para autenticação básica HTTP em parâmetros de URL?

    • 5 respostas
  • Marko Smith

    Ping uma porta específica

    • 18 respostas
  • Marko Smith

    Verifique se a porta está aberta ou fechada em um servidor Linux?

    • 7 respostas
  • Marko Smith

    Como automatizar o login SSH com senha?

    • 10 respostas
  • Marko Smith

    Como posso dizer ao Git para Windows onde encontrar minha chave RSA privada?

    • 30 respostas
  • Marko Smith

    Qual é o nome de usuário/senha de superusuário padrão para postgres após uma nova instalação?

    • 5 respostas
  • Marko Smith

    Qual porta o SFTP usa?

    • 6 respostas
  • Marko Smith

    Linha de comando para listar usuários em um grupo do Windows Active Directory?

    • 9 respostas
  • Marko Smith

    O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL?

    • 3 respostas
  • Marko Smith

    Como determinar se uma variável bash está vazia?

    • 15 respostas
  • Martin Hope
    Davie Ping uma porta específica 2009-10-09 01:57:50 +0800 CST
  • Martin Hope
    kernel O scp pode copiar diretórios recursivamente? 2011-04-29 20:24:45 +0800 CST
  • Martin Hope
    Robert ssh retorna "Proprietário incorreto ou permissões em ~/.ssh/config" 2011-03-30 10:15:48 +0800 CST
  • Martin Hope
    Eonil Como automatizar o login SSH com senha? 2011-03-02 03:07:12 +0800 CST
  • Martin Hope
    gunwin Como lidar com um servidor comprometido? 2011-01-03 13:31:27 +0800 CST
  • Martin Hope
    Tom Feiner Como posso classificar a saída du -h por tamanho 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent Como determinar se uma variável bash está vazia? 2009-05-13 09:54:48 +0800 CST

Hot tag

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

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve