diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 37f193e1c5b9..db1709f47e53 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -2072,6 +2072,27 @@ key - name | collector_port | Destination L4 port of the Sflow collector | | 6343 | | | collector_vrf | Specify the Collector VRF. In this revision, it is either default VRF or Management VRF.| | | | +### Storage Monitoring Daemon Interval Configuration + +These options are used to configure the daemon polling and sync-to-disk interval +of the Storage Monitoring Daemon (stormond) + +**Config Sample** +``` +{ + "STORMOND_CONFIG": { + "INTERVALS": { + "daemon_polling_interval" : "60", + "fsstats_sync_interval" : "360" + } + } +} +``` + +* `daemon_polling_interval` - Determines how often stormond queries the disk for relevant information and posts to STATE_DB +* `fsstats_sync_interval` - Determines how often key information from the STATE_DB is synced to a file on disk + + ### Syslog Global Configuration These configuration options are used to configure rsyslog utility and the way diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index db159a93c0e0..36814657de41 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -2683,5 +2683,11 @@ "global": { } } + }, + "STORMOND_CONFIG": { + "INTERVALS": { + "daemon_polling_interval" : "3600", + "fsstats_sync_interval" : "86400" + } } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/stormond.json b/src/sonic-yang-models/tests/yang_model_tests/tests/stormond.json new file mode 100644 index 000000000000..de8c699c49d0 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/stormond.json @@ -0,0 +1,29 @@ +{ + "STORMOND_CONFIG_TABLE": { + "desc": "Config DB interval parameters for Storage Monitoring Daemon" + }, + "STORMOND_INVALID_POLLING_INTERVAL": { + "desc": "Configure an invalid daemon polling interval", + "eStrKey" : "InvalidValue" + }, + "STORMOND_INVALID_SYNC_INTERVAL": { + "desc": "Configure an invalid fsstats file sync interval", + "eStrKey" : "InvalidValue" + }, + "STORMOND_POLLING_INTVL_BAD_LEN_MAX": { + "desc": "Configure an invalid daemon polling interval: out of range value", + "eStrKey" : "InvalidValue" + }, + "STORMOND_SYNC_INTVL_BAD_LEN_MAX": { + "desc": "Configure an invalid fsstats file sync interval: out of range value", + "eStrKey" : "InvalidValue" + }, + "STORMOND_SYNC_INTVL_EMPTY_VALUE": { + "desc": "Configure an empty file sync interval", + "eStrKey" : "InvalidValue" + }, + "STORMOND_POLLING_INTVL_EMPTY_VALUE": { + "desc": "Configure an empty file sync interval", + "eStrKey" : "InvalidValue" + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/stormond.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/stormond.json new file mode 100644 index 000000000000..225e6db22696 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/stormond.json @@ -0,0 +1,79 @@ +{ + "STORMOND_CONFIG_TABLE": { + "sonic-stormond-config:sonic-stormond-config": { + "sonic-stormond-config:STORMOND_CONFIG": { + "INTERVALS":{ + "daemon_polling_interval" : "3600", + "fsstats_sync_interval" : "86400" + + } + } + } + }, + "STORMOND_INVALID_POLLING_INTERVAL": { + "sonic-stormond-config:sonic-stormond-config": { + "sonic-stormond-config:STORMOND_CONFIG": { + "INTERVALS":{ + "daemon_polling_interval" : "-1", + "fsstats_sync_interval" : "86400" + + } + } + } + }, + "STORMOND_INVALID_SYNC_INTERVAL": { + "sonic-stormond-config:sonic-stormond-config": { + "sonic-stormond-config:STORMOND_CONFIG": { + "INTERVALS":{ + "daemon_polling_interval" : "3600", + "fsstats_sync_interval" : "five_thousand_two_hundred_seconds" + + } + } + } + }, + "STORMOND_POLLING_INTVL_BAD_LEN_MAX": { + "sonic-stormond-config:sonic-stormond-config": { + "sonic-stormond-config:STORMOND_CONFIG": { + "INTERVALS":{ + "daemon_polling_interval" : "360036003600360036003600360036003", + "fsstats_sync_interval" : "86400" + + } + } + } + }, + "STORMOND_SYNC_INTVL_BAD_LEN_MAX": { + "sonic-stormond-config:sonic-stormond-config": { + "sonic-stormond-config:STORMOND_CONFIG": { + "INTERVALS":{ + "daemon_polling_interval" : "3600", + "fsstats_sync_interval" : "864008640086400864008640086400864" + + } + } + } + }, + "STORMOND_SYNC_INTVL_EMPTY_VALUE": { + "sonic-stormond-config:sonic-stormond-config": { + "sonic-stormond-config:STORMOND_CONFIG": { + "INTERVALS":{ + "daemon_polling_interval" : "3600", + "fsstats_sync_interval" : "" + + } + } + } + }, + "STORMOND_POLLING_INTVL_EMPTY_VALUE": { + "sonic-stormond-config:sonic-stormond-config": { + "sonic-stormond-config:STORMOND_CONFIG": { + "INTERVALS":{ + "daemon_polling_interval" : "", + "fsstats_sync_interval" : "86400" + + } + } + } + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/yang-models/sonic-stormond-config.yang b/src/sonic-yang-models/yang-models/sonic-stormond-config.yang new file mode 100644 index 000000000000..3b50c6be21a3 --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-stormond-config.yang @@ -0,0 +1,40 @@ +module sonic-stormond-config{ + + yang-version 1.1; + + namespace "http://github.com/sonic-net/sonic-stormond-config"; + prefix stormond-config; + + import sonic-types { + prefix stypes; + } + + description "STORMOND_CONFIG Table yang Module for SONiC"; + + container sonic-stormond-config { + + container STORMOND_CONFIG { + + description "stormond_config table in config_db.json"; + + container INTERVALS { + + leaf daemon_polling_interval { + description "Polling inerval for Storage Monitoring Daemon in STORMOND_CONFIG table"; + type uint32 { + range "1..4294967295"; + } + default "3600"; + } + + leaf fsstats_sync_interval { + description "FSSTATS JSON file syncing interval for the Storage Monitoring Daemon in STORMOND_CONFIG table"; + type uint32 { + range "1..4294967295"; + } + default "86400"; + } + } + } + } +}