FRRouting / frr

The FRRouting Protocol Suite
https://frrouting.org/
Other
3.35k stars 1.26k forks source link

`debug` and `log` entries do not write anything to `vtysh` console #3787

Closed siriobalmelli closed 5 years ago

siriobalmelli commented 5 years ago

Things you may try first

(put "x" in "[ ]" if you already tried following)

Description

A debug command does not cause any terminal output in vtysh.

Please forgive me, this feels like user error (I should be enabling some option) but I cannot find it despite repeated attempts!

Any hints or help are much appreciated.

Steps to Reproduce

  1. configure debug logging:
    host# conf t
    host(config)# debug ospf packet all 
    host(config)# log stdout debugging 
    host(config)# log monitor debugging 
    host(config)# exit
    host# wri mem
    Note: this version of vtysh never writes vtysh.conf
    Building Configuration...
    Integrated configuration saved to /etc/frr/frr.conf
    [OK]
    host# 
  2. crickets chirping
  3. Attempt to follow this instruction and issue the terminal monitor instruction, but it is missing from vtysh:
    host# terminal 
    length    Set number of lines on a screen
    paginate  Use pager for output scrolling
    host# terminal 
  4. Verify that logging and debugging are indeed enabled:
    
    host# show debugging 

OSPF debugging status: OSPF packet Hello debugging is on OSPF packet Database Description debugging is on OSPF packet Link State Request debugging is on OSPF packet Link State Update debugging is on OSPF packet Link State Acknowledgment debugging is on

% Command incomplete.

% Command incomplete: show debugging

host# show logging Logging configuration for zebra: Syslog logging: level informational, facility daemon, ident zebra Stdout logging: level debugging Monitor logging: level debugging File logging: disabled Protocol name: ZEBRA Record priority: disabled Error code: disabled Timestamp precision: 0

Logging configuration for ospfd: Syslog logging: level informational, facility daemon, ident ospfd Stdout logging: level debugging Monitor logging: level debugging File logging: disabled Protocol name: OSPF Record priority: disabled Error code: disabled Timestamp precision: 0

Logging configuration for watchfrr: Syslog logging: level informational, facility daemon, ident watchfrr Stdout logging: disabled Monitor logging: disabled File logging: disabled Protocol name: WATCHFRR Record priority: disabled Error code: disabled Timestamp precision: 0

Logging configuration for staticd: Syslog logging: level informational, facility daemon, ident staticd Stdout logging: level debugging Monitor logging: level debugging File logging: disabled Protocol name: STATIC Record priority: disabled Error code: disabled Timestamp precision: 0

host#

5. Prove that there should be debug output:

host# show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL $NEIGHBOR 1 Full/DR 30.788s $NEIGHBOR eth0:$SELF 0 0 0

host# show ip ospf interface eth0 is up ifindex 2, MTU 1500 bytes, BW 1000 Mbit <UP,BROADCAST,RUNNING,MULTICAST> Internet Address $SELF/27, Broadcast $SELF_BROADCAST, Area $AREA MTU mismatch detection: enabled Router ID $SELF, Network Type BROADCAST, Cost: 20 Transmit Delay is 1 sec, State Backup, Priority 1 Backup Designated Router (ID) $SELF, Interface Address $SELF Saved Network-LSA sequence number 0x80000003 Multicast group memberships: OSPFAllRouters OSPFDesignatedRouters Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5 Hello due in 4.389s Neighbor Count is 1, Adjacent neighbor count is 1 lo is up ifindex 1, MTU 65536 bytes, BW 0 Mbit <UP,LOOPBACK,RUNNING> Internet Address $SELF/32, Area $AREA MTU mismatch detection: enabled Router ID $SELF, Network Type LOOPBACK, Cost: 1 Transmit Delay is 1 sec, State Loopback, Priority 1 No backup designated router on this network Multicast group memberships: Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5 Hello due in inactive Neighbor Count is 0, Adjacent neighbor count is 0

host#


**Expected behavior:**
Logging info printed to vtysh terminal

**Actual behavior:**
Nothing printed to vtysh terminal

### Versions
* OS: Ubuntu 16.04.5 LTS
* Kernel: Linux 4.4.0-131-generic
* FRR: 6.0.2
* FRR version command:
```bash
host# show version 
FRRouting 6.0.2 (host).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
configured with:
    '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' '--libdir=${prefix}/lib/x86_64-linux-gnu' '--libexecdir=${prefix}/lib/x86_64-linux-gnu' '--disable-maintainer-mode' '--enable-exampledir=/usr/share/doc/frr/examples/' '--localstatedir=/var/run/frr' '--sbindir=/usr/lib/frr' '--sysconfdir=/etc/frr' '--with-vtysh-pager=/usr/bin/pager' '--libdir=/usr/lib/x86_64-linux-gnu/frr' '--with-moduledir=/usr/lib/x86_64-linux-gnu/frr/modules' '--disable-dependency-tracking' '--enable-systemd=yes' '--enable-rpki' '--with-libpam' '--enable-doc' '--enable-doc-html' '--enable-snmp' '--enable-fpm' '--disable-protobuf' '--disable-zeromq' '--enable-ospfapi' '--enable-bgp-vnc' '--enable-multipath=256' '--enable-user=frr' '--enable-group=frr' '--enable-vty-group=frrvty' '--enable-configfile-mask=0640' '--enable-logfile-mask=0640' 'build_alias=x86_64-linux-gnu'
host#
eqvinox commented 5 years ago

@siriobalmelli unfortunately, vtysh doesn't currently support log monitoring; it originally worked on telnet login sessions but the feature just doesn't exist for vtysh.

It is certainly possible to add this, but it's going to be quite a bit of work to get done...

eqvinox commented 5 years ago

(That's also why terminal monitor is missing from vtysh - the command does exist on telnet, and does work there. As a workaround you can log into the daemon using telnet and get the log there.)

siriobalmelli commented 5 years ago

Ah thank you, I understand! Thanks for shedding light on what's happening with this - no problems I'll enable telnet and get debug logs that way :)

pfolk commented 3 years ago

Seems that at the very least this could be documented somewhere other than in a bug report. vtysh man page? 'log monitor' command reference? vtysh # term monitor could reply "console logging not supported in non-telnet command shells" or something =)

akhomyakov commented 3 years ago

Stumbled on this after trying to debug BGP in Cumulus. So the way this bug reads is that log stdout and log monitor don't do anything at all? If these commands don't do what they say they do, why have them? Why have documentation reference terminal monitor if it's not even a valid command? https://docs.frrouting.org/en/latest/basic.html#basic-config-commands

And more generally speaking, how does one debug BGP in FRR?

rubenrdp commented 2 years ago

I am also interested in learning how to debug BGP and other routing protocols. BTW, I am using FRR in GNS3 if that helps.

Thanks

kthomas8 commented 2 years ago

This trail went cold pretty quickly. Maybe if we off free beer we can find out how to debug BGP and other routing protocols?

albert-a commented 2 years ago

I found here https://docs.nvidia.com/networking-ethernet-software/cumulus-linux-41/Layer-3/Configuring-FRRouting/ that you need to configure log file: log file /var/log/frr/debug.log And in this case the log level is set to 7 (Debug) automatically. I did this as well as making the file world writable, and now I see the logging