mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-01 05:13:01 +02:00
confd: adjust Frr logging for staticd and ospfd
Ensure Frr logs to the local2 syslog facility to allow sorting all Frr (staticd, ospfd) logs into a dedicated /var/log/routing log file. We activate OSPF debugging, but keep log level at 'informational' for the time being. The YANG model needs some sort of "knob" to toggle debug messages when troubleshooting OSPF. Fixes #541 Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -2,7 +2,7 @@ Reserved facilities for logging in various subsystems:
|
||||
|
||||
- local0: rauc
|
||||
- local1: containers
|
||||
- local2:
|
||||
- local2: routing (frr)
|
||||
- local3:
|
||||
- local5:
|
||||
- local6: reserved
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
local2.* -/var/log/routing
|
||||
@@ -0,0 +1 @@
|
||||
d /var/run/frr 0755 frr frr -
|
||||
@@ -17,12 +17,14 @@
|
||||
#define BFDD_CONF "/etc/frr/bfd_enabled" /* Just signal that bfd should be enabled*/
|
||||
#define BFDD_CONF_NEXT BFDD_CONF "+"
|
||||
|
||||
#define FRR_STATIC_CONFIG "! Generated by Infix\n\
|
||||
#define FRR_STATIC_CONFIG "! Generated by Infix confd\n\
|
||||
frr defaults traditional\n\
|
||||
hostname Router\n\
|
||||
password zebra \n\
|
||||
enable password zebra\n\
|
||||
log syslog informational\n"
|
||||
no log unique-id\n\
|
||||
log syslog informational\n\
|
||||
log facility local2\n"
|
||||
|
||||
int parse_ospf_interfaces(sr_session_ctx_t *session, struct lyd_node *areas, FILE *fp)
|
||||
{
|
||||
@@ -126,6 +128,14 @@ int parse_ospf_areas(sr_session_ctx_t *session, struct lyd_node *areas, FILE *fp
|
||||
|
||||
int parse_ospf(sr_session_ctx_t *session, struct lyd_node *ospf)
|
||||
{
|
||||
const char *static_debug = "! OSPF default debug\
|
||||
debug ospf bfd\n \
|
||||
debug ospf packet all detail\n \
|
||||
debug ospf ism\n \
|
||||
debug ospf nsm\n \
|
||||
debug ospf default-information\n \
|
||||
debug ospf nssa\n\
|
||||
! OSPF configuration\n";
|
||||
struct lyd_node *areas, *default_route;
|
||||
const char *router_id;
|
||||
int bfd_enabled = 0;
|
||||
@@ -139,6 +149,8 @@ int parse_ospf(sr_session_ctx_t *session, struct lyd_node *ospf)
|
||||
}
|
||||
|
||||
fputs(FRR_STATIC_CONFIG, fp);
|
||||
fputs(static_debug, fp);
|
||||
|
||||
areas = lydx_get_child(ospf, "areas");
|
||||
router_id = lydx_get_cattr(ospf, "explicit-router-id");
|
||||
bfd_enabled = parse_ospf_interfaces(session, areas, fp);
|
||||
|
||||
Reference in New Issue
Block a user