File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 2828#
2929# spark_token : Bearer token for your Spark user/bot
3030# spark_room : Spark room name to which messages will be sent
31+ # device_name : Device name from which the messages will be sent
3132#
3233# E.g.:
3334#
3435# event manager environment spark_token Bearer 1234abd...
3536# event manager environment spark_room Network Operators
37+ # event manager environment device_name C3850
3638#
3739
3840import eem
5860 eem .action_syslog (
5961 'Environment variable "spark_room" must be set' , priority = '3' )
6062 sys .exit (1 )
63+ if 'device_name' not in arr_envinfo :
64+ eem .action_syslog (
65+ 'Environment variable "device_name" must be set' , priority = '3' )
66+ sys .exit (1 )
6167
6268# Get a CLI handle
6369cli = eem .cli_open ()
98104 # No differences found
99105 sys .exit (0 )
100106
101- msg = 'Configuration differences between the running config and last backup:\n '
107+ device_name = arr_envinfo ['device_name' ]
108+ msg = '### Alert: Config changed on ' + device_name + '\n '
109+ msg += 'Configuration differences between the running config and last backup:\n '
102110msg += '```{}```' .format ('\n ' .join (diff_lines [:- 1 ]))
103111
104112headers = {
You can’t perform that action at this time.
0 commit comments