Skip to content

Commit 8db0a1f

Browse files
authored
Adds YANG models for configurable intervals in CONFIG_DB for stormond (#18657)
#### Why I did it This is part of a larger feature: [SONiC Storage Monitoring Daemon](sonic-net/SONiC#1481) -- this commit adds the option to configure the daemon's polling interval and fsstats file sync interval (in seconds) of the daemon via config_db by introducing YANG models. #### How I did it Gives userside the option to dynamically a new table 'STORMOND' with key INTERVALS and fields 'daemon_polling_interval' with default value of '3600' seconds and 'fsstats_sync_interval' with default value of '86400' seconds as defined in the YANG model. #### How to verify it Flash image onto a DUT and add the aforementioned table to the CONFIG_DB. Verify that `stormond` has picked up your config intervals.
1 parent 7d7332a commit 8db0a1f

File tree

5 files changed

+175
-0
lines changed

5 files changed

+175
-0
lines changed

src/sonic-yang-models/doc/Configuration.md

+21
Original file line numberDiff line numberDiff line change
@@ -2072,6 +2072,27 @@ key - name
20722072
| collector_port | Destination L4 port of the Sflow collector | | 6343 | |
20732073
| collector_vrf | Specify the Collector VRF. In this revision, it is either default VRF or Management VRF.| | | |
20742074

2075+
### Storage Monitoring Daemon Interval Configuration
2076+
2077+
These options are used to configure the daemon polling and sync-to-disk interval
2078+
of the Storage Monitoring Daemon (stormond)
2079+
2080+
**Config Sample**
2081+
```
2082+
{
2083+
"STORMOND_CONFIG": {
2084+
"INTERVALS": {
2085+
"daemon_polling_interval" : "60",
2086+
"fsstats_sync_interval" : "360"
2087+
}
2088+
}
2089+
}
2090+
```
2091+
2092+
* `daemon_polling_interval` - Determines how often stormond queries the disk for relevant information and posts to STATE_DB
2093+
* `fsstats_sync_interval` - Determines how often key information from the STATE_DB is synced to a file on disk
2094+
2095+
20752096
### Syslog Global Configuration
20762097

20772098
These configuration options are used to configure rsyslog utility and the way

src/sonic-yang-models/tests/files/sample_config_db.json

+6
Original file line numberDiff line numberDiff line change
@@ -2683,5 +2683,11 @@
26832683
"global": {
26842684
}
26852685
}
2686+
},
2687+
"STORMOND_CONFIG": {
2688+
"INTERVALS": {
2689+
"daemon_polling_interval" : "3600",
2690+
"fsstats_sync_interval" : "86400"
2691+
}
26862692
}
26872693
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"STORMOND_CONFIG_TABLE": {
3+
"desc": "Config DB interval parameters for Storage Monitoring Daemon"
4+
},
5+
"STORMOND_INVALID_POLLING_INTERVAL": {
6+
"desc": "Configure an invalid daemon polling interval",
7+
"eStrKey" : "InvalidValue"
8+
},
9+
"STORMOND_INVALID_SYNC_INTERVAL": {
10+
"desc": "Configure an invalid fsstats file sync interval",
11+
"eStrKey" : "InvalidValue"
12+
},
13+
"STORMOND_POLLING_INTVL_BAD_LEN_MAX": {
14+
"desc": "Configure an invalid daemon polling interval: out of range value",
15+
"eStrKey" : "InvalidValue"
16+
},
17+
"STORMOND_SYNC_INTVL_BAD_LEN_MAX": {
18+
"desc": "Configure an invalid fsstats file sync interval: out of range value",
19+
"eStrKey" : "InvalidValue"
20+
},
21+
"STORMOND_SYNC_INTVL_EMPTY_VALUE": {
22+
"desc": "Configure an empty file sync interval",
23+
"eStrKey" : "InvalidValue"
24+
},
25+
"STORMOND_POLLING_INTVL_EMPTY_VALUE": {
26+
"desc": "Configure an empty file sync interval",
27+
"eStrKey" : "InvalidValue"
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{
2+
"STORMOND_CONFIG_TABLE": {
3+
"sonic-stormond-config:sonic-stormond-config": {
4+
"sonic-stormond-config:STORMOND_CONFIG": {
5+
"INTERVALS":{
6+
"daemon_polling_interval" : "3600",
7+
"fsstats_sync_interval" : "86400"
8+
9+
}
10+
}
11+
}
12+
},
13+
"STORMOND_INVALID_POLLING_INTERVAL": {
14+
"sonic-stormond-config:sonic-stormond-config": {
15+
"sonic-stormond-config:STORMOND_CONFIG": {
16+
"INTERVALS":{
17+
"daemon_polling_interval" : "-1",
18+
"fsstats_sync_interval" : "86400"
19+
20+
}
21+
}
22+
}
23+
},
24+
"STORMOND_INVALID_SYNC_INTERVAL": {
25+
"sonic-stormond-config:sonic-stormond-config": {
26+
"sonic-stormond-config:STORMOND_CONFIG": {
27+
"INTERVALS":{
28+
"daemon_polling_interval" : "3600",
29+
"fsstats_sync_interval" : "five_thousand_two_hundred_seconds"
30+
31+
}
32+
}
33+
}
34+
},
35+
"STORMOND_POLLING_INTVL_BAD_LEN_MAX": {
36+
"sonic-stormond-config:sonic-stormond-config": {
37+
"sonic-stormond-config:STORMOND_CONFIG": {
38+
"INTERVALS":{
39+
"daemon_polling_interval" : "360036003600360036003600360036003",
40+
"fsstats_sync_interval" : "86400"
41+
42+
}
43+
}
44+
}
45+
},
46+
"STORMOND_SYNC_INTVL_BAD_LEN_MAX": {
47+
"sonic-stormond-config:sonic-stormond-config": {
48+
"sonic-stormond-config:STORMOND_CONFIG": {
49+
"INTERVALS":{
50+
"daemon_polling_interval" : "3600",
51+
"fsstats_sync_interval" : "864008640086400864008640086400864"
52+
53+
}
54+
}
55+
}
56+
},
57+
"STORMOND_SYNC_INTVL_EMPTY_VALUE": {
58+
"sonic-stormond-config:sonic-stormond-config": {
59+
"sonic-stormond-config:STORMOND_CONFIG": {
60+
"INTERVALS":{
61+
"daemon_polling_interval" : "3600",
62+
"fsstats_sync_interval" : ""
63+
64+
}
65+
}
66+
}
67+
},
68+
"STORMOND_POLLING_INTVL_EMPTY_VALUE": {
69+
"sonic-stormond-config:sonic-stormond-config": {
70+
"sonic-stormond-config:STORMOND_CONFIG": {
71+
"INTERVALS":{
72+
"daemon_polling_interval" : "",
73+
"fsstats_sync_interval" : "86400"
74+
75+
}
76+
}
77+
}
78+
}
79+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
module sonic-stormond-config{
2+
3+
yang-version 1.1;
4+
5+
namespace "http://github.com/sonic-net/sonic-stormond-config";
6+
prefix stormond-config;
7+
8+
import sonic-types {
9+
prefix stypes;
10+
}
11+
12+
description "STORMOND_CONFIG Table yang Module for SONiC";
13+
14+
container sonic-stormond-config {
15+
16+
container STORMOND_CONFIG {
17+
18+
description "stormond_config table in config_db.json";
19+
20+
container INTERVALS {
21+
22+
leaf daemon_polling_interval {
23+
description "Polling inerval for Storage Monitoring Daemon in STORMOND_CONFIG table";
24+
type uint32 {
25+
range "1..4294967295";
26+
}
27+
default "3600";
28+
}
29+
30+
leaf fsstats_sync_interval {
31+
description "FSSTATS JSON file syncing interval for the Storage Monitoring Daemon in STORMOND_CONFIG table";
32+
type uint32 {
33+
range "1..4294967295";
34+
}
35+
default "86400";
36+
}
37+
}
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)