Ssm

The following scenario shows how to configure different SSM (System Service Monitoring) operations. SSM operations can be used to monitor several system states (e.g., CPU, memory, storage and temperature), activating or deactivating previously defined alarms when the monitored states reach certain threshold values.

Monitoring Storage

Description

In this scenario an SSM operation is configured in DUT0 to monitor the storage state of the system and activate or deactivate an alarm when said state reaches a defined threshold value. First, the alarm is activated when a new file is downloaded. Then the alarm is deactivated when the downloaded file is deleted.

Scenario

Step 1: Run the command show system storage on DUT0 and expect the following output:

Show output
Total Storage: 7.767 GB
Free Storage: 7.365 GB
Used Storage: 411.312 MB

Step 2: Set the following configuration in DUT0 :

set service ssm log-level notice
set service ssm operation OPER_STO alarm ALARM_STO activate value 426180.25
set service ssm operation OPER_STO alarm ALARM_STO deactivate value 422848.75
set service ssm operation OPER_STO description 'OPER_STO operation description'
set service ssm operation OPER_STO interval 1
set service ssm operation OPER_STO type storage
set system alarm ALARM_STO
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Note

To emulate an increase in storage usage, a file with a known size could be downloaded. To activate the alarm with this increase in storage used, the alarm activation threshold must be adjusted with the value resulting from adding the current used storage and the size of the new file to be downloaded. In this example, the value set as the activation threshold is 426180.25K, since the value of the current used storage is 421183K and the size of the new file to be downloaded is 6663K. Also, to emulate a decrease in storage used, the previously downloaded file could be deleted. To deactivate the alarm with this decrease in storage used, the alarm deactivation threshold must be adjusted with the value of the storage used before downloading the new file. In this example, the value set as the deactivation threshold is 422848.75K.

Step 3: Run the command service ssm operation show on DUT0 and check whether the output contains the following tokens:

OPER_STO
Show output
-----------------------------------------------------------------------------------------------
Operation   Type    Last-Value    Alarm    Activate   Deactivate  Status  Toggled  Prev-toggled
-----------------------------------------------------------------------------------------------
OPER_STO   storage   421184.00  ALARM_STO  426180.25   422848.75  false

Step 4: Run the command system alarm ALARM_STO show on DUT0 and check whether the output matches the following regular expressions:

(ALARM_STO)\s+(false)
Show output
-------------------------------------------------------------------
Alarm    Status  Toggled  Prev-toggled  Toggle-count  Time up (%)
-------------------------------------------------------------------
ALARM_STO  false                                     0         0.00

Step 5: Run the command service ssm operation OPER_STO show on DUT0 and check whether the output matches the following regular expressions:

(OPER_STO)\s+(storage)[\s\d.]+(ALARM_STO)[\s\d.]+(false)
Show output
-----------------------------------------------------------------------------------------------
Operation   Type    Last-Value    Alarm    Activate   Deactivate  Status  Toggled  Prev-toggled
-----------------------------------------------------------------------------------------------
OPER_STO   storage   421184.00  ALARM_STO  426180.25   422848.75  false

Step 6: Run the command service ssm operation show on DUT0 and check whether the output matches the following regular expressions:

(OPER_STO)\s+(storage)[\s\d.]+(ALARM_STO)[\s\d.]+(false)
Show output
-----------------------------------------------------------------------------------------------
Operation   Type    Last-Value    Alarm    Activate   Deactivate  Status  Toggled  Prev-toggled
-----------------------------------------------------------------------------------------------
OPER_STO   storage   421184.00  ALARM_STO  426180.25   422848.75  false

Note

The previous command output should show that the operation has been created successfully and that the alarm is desactivated, since the storage used has not yet increased.

Step 7: Modify the following configuration lines in DUT0 :

set interfaces ethernet eth0 address 10.215.168.64/24

Step 8: Ping the IP address 10.215.168.1 from DUT0:

admin@DUT0$ ping 10.215.168.1 count 1 size 56 timeout 1
Show output
PING 10.215.168.1 (10.215.168.1) 56(84) bytes of data.
64 bytes from 10.215.168.1: icmp_seq=1 ttl=64 time=0.453 ms

--- 10.215.168.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.453/0.453/0.453/0.000 ms

Step 9: Run the command file copy http://10.215.168.1/~robot/ssm_test_file running:// force on DUT0 and expect the following output:

Show output
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 6663k  100 6663k    0     0   329M      0 --:--:-- --:--:-- --:--:--  342M

Step 10: Run the command file show running:// on DUT0 and check whether the output contains the following tokens:

ssm_test_file
Show output
----------------------------------------------------------------------------------------
Name                           Type                Size     Last modified
----------------------------------------------------------------------------------------
auth/                       directory                         13KB   2026 Jul 24 06:58
base-enc.diff1              application/octet-stream          256B   2026 Jul 24 09:53
base-enc.rules              application/octet-stream          272B   2026 Jul 24 09:53
base.diff2-aes256           application/octet-stream          528B   2026 Jul 24 09:55
block.rules                 text/plain                        125B   2026 Jul 24 13:04
config.boot                 regular file, no read permission  394B   2026 Jul 24 06:59
config.boot.old             regular file, no read permission  324B   2026 Jul 24 06:58
coredump/                   directory                         4.0KB  2026 Jul 24 08:13
dos.rules                   text/plain                        62KB   2026 Jul 24 09:59
drop-performance.rules      text/plain                        200B   2026 Jul 24 10:07
filehash-md5-drop.rules     text/plain                        113B   2026 Jul 24 09:56
filehash-sha1-drop.rules    text/plain                        116B   2026 Jul 24 09:56
filehash-sha256-drop.rules  text/plain                        122B   2026 Jul 24 09:56
firewall/                   directory                         4.0KB  2026 Jul 24 13:04
hashset-md5.list            text/plain                        33B    2026 Jul 24 09:56
hashset-sha1.list           text/plain                        40B    2026 Jul 24 09:56
hashset-sha256.list         text/plain                        65B    2026 Jul 24 09:56
kerneldump/                 directory                         4.3KB  2026 Jul 24 06:59
local.rules                 text/plain                        357B   2026 Jul 24 10:07
log/                        directory                         1.5MB  2026 Jul 24 12:45
nids.html                   text/html                         220B   2026 Jul 24 09:56
ruleset.tar.gz              application/octet-stream          368B   2026 Jul 24 09:55
save-hist/                  directory                         4.0KB  2026 Jul 24 06:54
scripts/                    directory                         4.0KB  2026 Jul 24 06:10
ssm_test_file               text/plain                        6.6MB  2026 Jul 24 13:06
support/                    directory                         4.5KB  2026 Jul 24 07:01
test-performance.rules      text/plain                        266B   2026 Jul 24 10:06
test_file_diff/             directory                         8.1KB  2026 Jul 24 06:55
tor.rules                   text/plain                        714KB  2026 Jul 24 09:59
traffic-proxy.rules         text/plain                        129B   2026 Jul 24 13:00
uid                         text/html                         220B   2026 Jul 24 10:07
user-data/                  directory                         4.0KB  2026 Jul 24 06:10
volatile/                   directory                         4.0KB  2026 Jul 24 09:50

Note

With the previous command, a file with a known size is downloaded, thus causing an increase in the storage used.

Step 11: Run the command show system storage on DUT0 and expect the following output:

Show output
Total Storage: 7.767 GB
Free Storage: 7.359 GB
Used Storage: 417.824 MB

Step 12: Run the command system alarm ALARM_STO show on DUT0 and check whether the output matches the following regular expressions:

(ALARM_STO)\s+(true)
Show output
--------------------------------------------------------------------------------------------
Alarm    Status              Toggled               Prev-toggled  Toggle-count  Time up (%)
--------------------------------------------------------------------------------------------
ALARM_STO  true    2026-07-24 13:06:07.202577+00:00                           1         3.64

Step 13: Run the command service ssm operation OPER_STO show on DUT0 and check whether the output matches the following regular expressions:

(OPER_STO)\s+(storage)[\s\d.]+(ALARM_STO)[\s\d.]+(true)
Show output
---------------------------------------------------------------------------------------------------------
Operation   Type    Last-Value    Alarm    Activate   Deactivate  Status       Toggled       Prev-toggled
---------------------------------------------------------------------------------------------------------
OPER_STO   storage   421184.00  ALARM_STO  426180.25   422848.75  true    1784898367.202577

Step 14: Run the command service ssm operation show on DUT0 and check whether the output matches the following regular expressions:

(OPER_STO)\s+(storage)[\s\d.]+(ALARM_STO)[\s\d.]+(true)
Show output
---------------------------------------------------------------------------------------------------------
Operation   Type    Last-Value    Alarm    Activate   Deactivate  Status       Toggled       Prev-toggled
---------------------------------------------------------------------------------------------------------
OPER_STO   storage   427852.00  ALARM_STO  426180.25   422848.75  true    1784898367.202577

Note

The previous command output should show that the alarm is activated, since the storage used has increased after downloading the new file.

Step 15: Delete a file by running file delete $running://ssm_test_file.

Note

With the previous command, the downloaded file is deleted, thus causing a decrease in the storage used.

Step 16: Run the command show system storage on DUT0 and expect the following output:

Show output
Total Storage: 7.767 GB
Free Storage: 7.365 GB
Used Storage: 411.316 MB

Step 17: Run the command system alarm ALARM_STO show on DUT0 and check whether the output matches the following regular expressions:

(ALARM_STO)\s+(false)
Show output
----------------------------------------------------------------------------------------------------------------
Alarm    Status              Toggled                         Prev-toggled            Toggle-count  Time up (%)
----------------------------------------------------------------------------------------------------------------
ALARM_STO  false   2026-07-24 13:06:08.222283+00:00  2026-07-24 13:06:07.202577+00:00             2        19.36

Step 18: Run the command service ssm operation OPER_STO show on DUT0 and check whether the output matches the following regular expressions:

(OPER_STO)\s+(storage)[\s\d.]+(ALARM_STO)[\s\d.]+(false)
Show output
--------------------------------------------------------------------------------------------------------------
Operation   Type    Last-Value    Alarm    Activate   Deactivate  Status       Toggled         Prev-toggled
--------------------------------------------------------------------------------------------------------------
OPER_STO   storage   427852.00  ALARM_STO  426180.25   422848.75  false   1784898368.222283  1784898367.202577

Step 19: Run the command service ssm operation show on DUT0 and check whether the output matches the following regular expressions:

(OPER_STO)\s+(storage)[\s\d.]+(ALARM_STO)[\s\d.]+(false)
Show output
--------------------------------------------------------------------------------------------------------------
Operation   Type    Last-Value    Alarm    Activate   Deactivate  Status       Toggled         Prev-toggled
--------------------------------------------------------------------------------------------------------------
OPER_STO   storage   421188.00  ALARM_STO  426180.25   422848.75  false   1784898368.222283  1784898367.202577

Note

The previous command output should show that the alarm is deactivated, since the storage used has decreased after the deletion of the downloaded file.